# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.4.0](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.3.4...v0.4.0) - 2026-06-08

### Added

- *(vcf)* add --output-unresolvable
- *(vcf)* unify and refactor counters
- *(vcf)* MAPQ and base-quality gates for phasing
- *(vcf)* granular phasing resolution counters
- *(vcf)* reconstruct per-haplotype records on passthrough
- *(vcf)* thread allele number through phasing downstream
- *(vcf)* refactor phasing to allow for 1/2 records
- *(vcf)* implement local read-based phasing
- *(vcf)* haplotype-aware cluster splitting

### Fixed

- *(vcf)* ignore ref/ref reads in local phasing
- *(vcf)* add hom-alt into phased haplotype groups
- *(vcf)* remove unneccessary debug info
- *(vcf)* clippy
- *(vcf)* add reference to phasing bam reader to allow cram files
- *(vcf)* clippy + cargo-fmt
- *(vcf)* some more phasing fixes

### Other

- *(vcf)* add phasing trace logging, fix stats separator
- *(vcf)* add documentation on phasing
- *(vcf)* assert slot-to-haplotype phasing orientation
- *(vcf)* tests for local read-phasing
- *(vcf)* verify split-haplotype cluster correlation
- *(vcf)* remove phasing to re-implement from scratch

## [0.3.4](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.3.3...v0.3.4) - 2026-06-01

### Added

- *(viz)* accept float-formatted integers (42.0) in input CSV

## [0.3.3](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.3.2...v0.3.3) - 2026-05-26

### Added

- add --range-extension parameter to expand AlignmentRange

### Fixed

- *(vcf)* remove dead clear_cache() call; reads clears on tid change
- *(align)* release cache lock before DB write; close in_progress/finished gap
- *(vcf)* record first write error and return it after draining all messages
- *(vcf)* propagate Clusterizer init errors instead of silently producing empty output
- *(vcf)* flush SortingWriter explicitly before drop to propagate tail errors
- *(vcf)* track rid in FilteredOutputWriter to prevent cross-contig window bleed
- *(reads)* propagate CSV flush error from writer task
- *(vcf)* propagate BAM open error instead of panicking
- *(vcf)* warn on multi-allelic records in apply_mutations

### Other

- *(reads)* rename find_clusters -> find_cigar_clusters
- *(vcf)* replace bcf::Read impl with inherent methods
- *(reads)* replace htslib::Read impl with inherent methods
- *(vcf)* rename ClusterSettings -> ClusterizerSettings
- *(vcf)* document why alt_context_region equals ref_context_region
- *(reads)* remove obsolete channel from ClusterFinder
- *(reads)* cache hot counters outside read/cluster loops
- remove commented-out dbg! blocks

## [0.3.2](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.3.1...v0.3.2) - 2026-05-21

### Added

- *(viz)* only require the necessary fields in the input csv
- *(vcf)* warn if the input vcf has more than one sample
- remove -s flag to avoid confusion with -s from bcftools. --soft-mask still works as before.

### Fixed

- *(align)* re-enable extension of alignment ranges in tsalign

## [0.3.1](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.3.0...v0.3.1) - 2026-05-19

### Added

- *(vcf)* write cluster hash as VCF info field TSID
- *(vcf)* report TSCOST, TSINNERLEN, TSJUMP in output records
- *(align)* option to output failed alignment regions to file

### Fixed

- *(vcf)* compute AN from called genotype alleles, not ALT count
- clippy

### Other

- *(vcf)* verify variant ID written to VCF records

## [0.3.0](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.2.2...v0.3.0) - 2026-05-19

### Added

- *(db)* store constraints, retry OOM/timeout on larger limits

### Fixed

- *(docs)* small fixes in the cli help options ([#59](https://version.helsinki.fi/kraujasp/twitcher/pulls/59))

### Other

- *(reads)* add DB retry integration test for OOM with larger memory

## [0.2.2](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.2.1...v0.2.2) - 2026-05-13

### Added

- *(build)* update caching mechanism for gitlab runner

### Fixed

- *(vcf)* fix potential NPE
- *(build)* simplify CI build with stages

### Other

- *(vcf)* add crash regression from #58 as test
- add --fpa flag tests to vcf_tests and reads_tests
- add reads/viz integration tests, restructure test modules
- add meaningful integration tests with real WGS data

## [0.2.1](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.2.0...v0.2.1) - 2026-05-12

### Other

- update Cargo.toml dependencies

## [0.2.0](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.13...v0.2.0) - 2026-05-12

### Added

- *(align)* update default costs to something slightly more sensible
- include a default `.tsa` cost file in our repo
- *(align)* Allow to restrict that all TSMs have the same descendant
- *(viz)* align the cli interface more with `tsalign`
- *(viz)* add flags for eq range visualisation and context
- *(viz)* use id instead of cluster number for output files

### Fixed

- *(align)* flip default, `--only-equal-descendants` becomes `--allow-mixed-descendants`
- rename variable
- temporatily disable assertion

### Other

- update deps

## [0.1.13](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.12...v0.1.13) - 2026-05-07

### Added

- *(fpa)* add RQR template switch support
- add id to csv output that is a unique hash

## [0.1.12](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.11...v0.1.12) - 2026-04-30

### Fixed

- *(vcf)* repair progress bar
- *(clippy)* some pedantic / nursery lints

## [0.1.11](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.10...v0.1.11) - 2026-04-29

### Other

- update Cargo.lock dependencies

## [0.1.10](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.9...v0.1.10) - 2026-04-27

### Fixed

- *(fpa)* correct first_offset coordinate system
- *(reads)* exclude soft-clipped bases from window
- *(reads)* fix alignment indexing error

## [0.1.9](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.8...v0.1.9) - 2026-04-23

### Added

- *(viz)* Add id selector
- *(vcf)* enable csv output, some small buxfixes to make that happen
- *(viz)* add svg visualization subcommand
- *(csv)* output MI-string and alignment details

### Fixed

- clippy
- *(build)* update rust to 1.88 (needed by lib_tsshow)
- *(deps)* use crates.io version of tsalign libs

### Other

- update reads and vcf pipelines to use new alignment types
- extract alignment operations into dedicated module

## [0.1.8](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.7...v0.1.8) - 2026-03-25

### Added

- use new cluster density also in \'reads\' mode
- *(vcf)* expose clustering settings, add density parameter

### Fixed

- apply custom costs to tsalign (lost during refactor)

### Other

- write up some basic functionality

## [0.1.7](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.6...v0.1.7) - 2026-03-19

### Fixed

- test (again...)
- use characters M and X in vcf output cigar strings
- fix a test failure that expected M instead of = in cigar string

### Other

- update lib_tsalign to version 1

## [0.1.6](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.5...v0.1.6) - 2026-03-10

### Added

- add cram support
- add database feature to store known alignment cases
- in-memory deduplication of alignments
- show running alignments in progress bar

### Fixed

- buffer db writes, refactor counters
- Handle matches (eq or diff) properly in reads mode
- simplify dependencies
- some test coverage
- reduce tokio features

## [0.1.5](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.4...v0.1.5) - 2026-02-27

### Added

- parameter for buffer size, smaller tweaks
- rewrite many methods to async
- basic setup for tokio
- implement timeout for worker
- properly limit memory usage per alignment
- more info in log messages
- describe subcommands
- update to latest lib_tsalign with serde support

### Fixed

- lots of clippy fixes about number conversions, some of which have caused issues crashed
- differentiate between non-zero exit and signal termination
- Use subprocesses for the aligner to fail gracefully

## [0.1.4](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.3...v0.1.4) - 2026-02-18

### Added

- Refactor plumbing code to allow a selection of the aligner
- implement DP-based Four-Point-Aligner
- add --min-quality to require minimum quality for cluster bases
- *(vcf)* add command to output header
- some progress bars and less memory usage

### Fixed

- indexing bug in record creation, allow for full-range TSes in FPA
- clippy
- small changes to --help
- update test method to use new `augment_header` method
- make memory limit arg global so that it can be used at any point
- don't exclude reference parts with lowercase, even with --soft-mask
- use capped allocator for memory limit

## [0.1.3](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.2...v0.1.3) - 2026-02-02

### Added

- Add counters for alignments to reads mode
- add counters and runtime to reads mode (and refactor)

### Fixed

- use bounded channels to avoid uncontrolled memory growth

## [0.1.2](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.1...v0.1.2) - 2026-01-30

### Added

- unify the alignment tpool stuff, report alignment cost without TS for reads mode

### Fixed

- coordinate fix in soft mask feature
- update readme to use published twitcher version

## [0.1.1](https://version.helsinki.fi/kraujasp/twitcher/compare/v0.1.0...v0.1.1) - 2026-01-30

### Other

- Add some metadata to Cargo.toml
