Skip to content

Snippy-NG

CZI's Essential Open Source Software for Science PyPI - Version PyPI - Python Version Test Coverage Benchmark

Snippy-NG is the next generation of microbial variant calling with Snippy. It provides command-line pipelines for assembly, short-read, long-read, and multi-sample SNP analysis, plus tools for core alignment construction, phylogenetic tree building, and interactive report generation.

Snippy-NG is under active development and should not replace Snippy for production analyses without validation.

Follow progress on the Snippy-NG Development Blog.

Installation

For most users, install the complete Snippy-NG environment with:

curl -sSL https://cpg.org.au/snippy-ng/install.sh | bash -s -- --force

The Python package is also available from PyPI:

pip install snippy-nextgen

The installed command is:

snippy-ng --help

See the installation guide for dependency details, Clair3 setup, and development installs.

Commands

Command Purpose
snippy-ng asm Assembly-based SNP calling from a reference and assembly FASTA.
snippy-ng short Short-read SNP calling from paired-end reads or an existing BAM.
snippy-ng long Long-read SNP calling from FASTQ reads or an existing BAM.
snippy-ng multi Run multi-sample analysis and construct a core alignment.
snippy-ng core Create a core alignment from multiple Snippy-NG run directories.
snippy-ng tree Build a phylogenetic tree from an alignment.
snippy-ng gui Launch the optional Gradio graphical interface.
snippy-ng utils ref Prepare a reference genome for Snippy-NG.
snippy-ng utils gather Discover sample files and write TSV or JSON input for multi.
snippy-ng utils samclip Filter clipped reads from SAM alignments.
snippy-ng utils cnv Estimate contig or feature copy numbers from aligned BAM or CRAM depth.
snippy-ng utils report-tree Create an interactive HTML report from a Newick tree.

Examples

Run assembly-based SNP calling:

snippy-ng asm --ref tests/data/reference.gbk --asm tests/data/wildtype.contigs.fa

Run short-read SNP calling:

snippy-ng short \
  --ref tests/data/reference.gbk \
  --R1 tests/data/mutant_R1.fastq.gz \
  --R2 tests/data/mutant_R2.fastq.gz

Run long-read SNP calling:

export CLAIR3_MODELS=./clair3_models
snippy-ng long --ref tests/data/JKD6159.fasta --reads tests/data/JKD6159.fastq.gz

Run a multi-sample workflow and build a report:

snippy-ng utils gather --json --ref tests/data/reference.gbk tests/data/{wildtype,mutant}* > samples.json
snippy-ng multi samples.json --cpus 6 -o multi
snippy-ng tree --fast multi/core/core.095.aln -o multi/tree
snippy-ng utils report-tree multi/tree/tree.treefile --metadata multi/snippy.vcf.summary.tsv -o multi/report

Documentation

Development

To set up a development environment, clone the repository and install pixi and hatch.

git clone [email protected]:centre-pathogen-genomics/snippy-ng.git
cd snippy-ng
curl -fsSL https://pixi.sh/install.sh | bash
pixi global install hatch

Activate the pixi environment and launch a hatch shell:

pixi shell
hatch shell

Run the default fast test suite:

pixi run test

Run simulation-backed integration tests:

pixi run -e integration test-integration

License

Snippy-NG is distributed under the terms of the MIT license.