# Twitcher
**T**emplate s**witch** align**er**.
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)](https://doi.org/10.1101/gr.214973.116)).
The tool operates in two stages:
1. 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.
2. 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):
```bash
cargo install twitcher
```
Get cargo e.g. via [rustup](https://rustup.rs/). 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.
```bash
twitcher vcf <input.vcf> <reference.fa> [-o <output.vcf>]
```
### Arguments
Use `twitcher --help` for a list of arguments and settings.
### Example
```bash
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](https://github.com/sebschmi/template-switch-aligner).