4 releases
Uses new Rust 2024
| new 0.1.3 | Feb 2, 2026 |
|---|---|
| 0.1.2 | Jan 30, 2026 |
| 0.1.1 | Jan 30, 2026 |
| 0.1.0 | Jan 30, 2026 |
#122 in Biology
155KB
4K
SLoC
Twitcher
Template switch aligner.
A tool to re-annotate VCF files. We want to explain clusters of SNVs/Indels with one or more short-range template switches (Löytynoja and Goldman (2017)).
The tool operates in two stages:
- While reading the input vcf file (either from stdin or a file), find suspicious™ clusters of SNVs and Indels, e.g. more than 3 indels within 10 basepairs.
- Realign those clusters under consideration of a few hundred surrounding base pairs. If the mutation cluster can be better explained with one or more template switches, output the new, reannotated vcf records instead of the original ones.
The tool is designed to enrich the vcf file with more information. Unaffected records are output as-is.
Installation
You can install the tool from source using cargo (needs at least version 1.87.0):
cargo install twitcher
Get cargo e.g. via rustup. You'll also need the clang C compiler to compile the underlying htslib bindings.
Usage
The main (and currently only) command is vcf. It takes an input VCF file, a
reference FASTA file, and optionally an output VCF file.
twitcher vcf <input.vcf> <reference.fa> [-o <output.vcf>]
Arguments
Use twitcher --help for a list of arguments and settings.
Example
twitcher vcf --memory-limit 2gb --padding 200 my_variants.vcf reference.fa -o my_reannotated_variants.vcf
Background
The underlying pairwise aligner is developed on GitHub by Sebastian Schmidt.
Dependencies
~40MB
~651K SLoC