SNPick¶
Fast, memory-efficient extraction of variable sites from FASTA alignments.
Get started Usage reference View on GitHub
SNPick extracts variable (SNP) sites from whole-genome FASTA alignments. It produces reduced alignments ready for phylogenetic inference with ascertainment-bias correction (ASC) in IQ-TREE and RAxML, and optionally generates VCF files.
Why not snp-sites?
snp-sites works well for small datasets but struggles with large alignments — it loads the whole matrix into memory and scales poorly. SNPick uses a zero-copy, memory-mapped architecture that handles thousands of genomes in seconds with minimal RAM.
What you get¶
-
Variable sites only
A reduced FASTA with just the informative columns — a drop-in, much smaller input for phylogenetics.
-
ASC-ready
Constant-site counts (
fconst) printed for IQ-TREE's+ASCmodels, so branch lengths stay unbiased. -
Optional VCF
VCF v4.2 with per-sample genotypes, a configurable contig name, alignment-column
POS(or ungapped reference coordinates with--ref-coords), and gap/ambiguity handling. -
Filter & mask
Per-site missingness / MAC / MAF / allele filters, BED region masking and sample selection — without breaking
fconst. -
Pipeline-native
gzip & stdin/stdout streaming, PHYLIP/NEXUS output, and a
--stats-jsonsidecar so nothing scrapes stderr. -
Built for scale
Zero-copy mmap + parallel, auto-vectorized scan: O(L) memory, thousands of genomes in seconds.
SNPick vs snp-sites¶
| SNPick | snp-sites | |
|---|---|---|
| Architecture | Zero-copy mmap, parallel scan | Full matrix in memory |
| 250 seqs × 4.4 Mbp | 1.72 s, 105 MB | 9.38 s, 213 MB |
| 1000 seqs × 4.4 Mbp | 10.27 s, 217 MB | killed (OOM) |
ASC fconst output | Built-in | Not supported |
| VCF output | Optional | Default |
| Gap handling | Optional (-g) | Default |
| IUPAC ambiguous | Tracked as ambiguous | Treated as variant |
Quick start¶
# Install from Bioconda
conda install -c bioconda snpick
# Extract variable sites
snpick -f alignment.fasta -o snps.fasta
# With a VCF, on 8 threads, quietly
snpick -f alignment.fasta -o snps.fasta --vcf -t 8 -q
Citation¶
If you use SNPick in your research, please cite:
@software{snpick,
author = {Ruiz-Rodriguez, Paula and Coscolla, Mireia},
title = {SNPick: Fast extraction of variable sites from FASTA alignments},
url = {https://github.com/PathoGenOmics-Lab/snpick},
doi = {10.5281/zenodo.14191809},
license = {GPL-3.0}
}
Paula Ruiz-Rodriguez and Mireia Coscolla — Institute for Integrative Systems Biology, I²SysBio, University of Valencia-CSIC, Valencia, Spain.
