Skip to content

Repository files navigation

fstic

Fstic: Allele-Frequency-based Genetic distance calculator

Documentation License: GPL v3 fstic Anaconda-Server Badge Anaconda-Version Badge PGO DOI

Paula Ruiz-Rodriguez1 and Mireia Coscolla1
1. I2SysBio, University of Valencia-CSIC, FISABIO Joint Research Unit Infection and Public Health, Valencia, Spain


Pairwise genetic distance matrices from allele-frequency data. Fstic reads single-sample VCFs or frequency tables and computes eight standard estimators (FST, GST, Jost's D, Reynolds, Nei, Cavalli-Sforza chord, Rogers, Bray-Curtis) in parallel, writing an N x N matrix.

It is built for data where a sample is not a single genotype but a frequency spectrum: mixed infections, deep-sequenced isolates, pooled populations.

📖 Documentation

pathogenomics-lab.github.io/fstic

Tutorial Four samples from raw VCFs to a tree, finding a mixed infection on the way. Ten minutes, no downloads.
Installation Bioconda, or building from source.
Input formats What Fstic reads from a VCF or a table, and what it skips.
Choosing an estimator All eight formulas, their ranges, and when disagreement between them means something.
Filtering Setting thresholds for consensus, within-host and deep amplicon work.
Command-line reference Every flag, with defaults and exit codes.
How it works The model the estimators rest on, and what stops a run rather than warning.

Install

conda install -c bioconda fstic

Or build it, which needs a Rust toolchain:

git clone https://github.com/PathoGenOmics-Lab/fstic.git
cd fstic && cargo build --release

Sixty seconds

One VCF per sample, named after the sample:

fstic --vcf TB-*.vcf --output distances.csv
sample,TB-001,TB-002,TB-003
TB-001,0.0000000000,1.0000000000,7.0000000000
TB-002,1.0000000000,0.0000000000,8.0000000000
TB-003,7.0000000000,8.0000000000,0.0000000000

Those are cumulative totals, not values in [0, 1]. Adding --normalize divides by the locus count and gives 0.125, 0.875 and 1.0 instead.

Pick an estimator, normalise per locus, and tighten the filters:

fstic --vcf-list samples.txt \
      --output chord.tsv \
      --formula chord \
      --min-depth 50 \
      --min-af 0.01 \
      --pass-only

Note

--formula fst sums the per-locus Nei GST across sites, so it grows with the locus count and is not bounded by 1. Use --normalize for the mean, or --formula gst for a bounded ratio. The estimator guide explains the difference.

Citation

Ruiz-Rodriguez, P. and Coscolla, M. Fstic: allele-frequency-based genetic distance calculator. Zenodo. doi:10.5281/zenodo.16813662

Please cite the original paper for whichever estimator you used as well; they are listed on the citation page.

Contributing

Bug reports with a reproducer are the most useful thing you can send. See contributing for building, testing and adding an estimator.

cargo test && cargo clippy --all-targets

fstic is developed with ❤️ by:

Paula Ruiz-Rodriguez

💻 🔬 🤔 🔣 🎨 🔧

Mireia Coscolla

🔍 🤔 🧑‍🏫 🔬 📓

This project follows the all-contributors specification (emoji key).


License

GPL-3.0

Releases

Packages

Contributors

Languages