Skip to content

Repository files navigation

ZipStrain

Strain-resolution metagenomics at scale.

ZipStrain is a Python package specializing in strain-level metagenomic analysis. It profiles mapped reads into per-position nucleotide counts and compares metagenomic samples at genome and gene scope. ZipStrain is designed for large datasets, with an accompanying nextflow pipeline (See the documentation - https://olmlab.github.io/ZipStrain)

Documentation Tests Conda Docker Coverage Python 3.12+

ZipStrain logo

Developed by Parsa Ghadermazi and the Olm Lab, University of Colorado Boulder.

Strain-level metagenomics in three commands: ZipStrain maps reads, profiles them at single-nucleotide resolution, and compares samples by ANI to tell whether they share a strain.

ZipStrain workflow

Documentation

Full documentation available at https://olmlab.github.io/ZipStrain/

Install

# Conda (recommended — bundles samtools and the map aligners)
conda create -n zipstrain -c conda-forge -c bioconda python=3.12 zipstrain bowtie2 samtools sylph
conda activate zipstrain
zipstrain test

Prefer pip? pip install zipstrain (then install samtools separately). Full options: Installation.

The three commands

ZipStrain overview: map turns reads into BAMs, profile turns BAMs into nucleotide profiles, compare turns profiles into ANI

1. map — reads → BAMs

Aligns reads to a reference and writes sorted BAMs plus a samples.txt ready for profiling. Omit --reference-fasta to let Sylph pick and build a reference automatically. Resumable if interrupted.

zipstrain map -i reads.csv -o mapped \
  --reference-fasta ref.fna --stb-file ref.stb

zipstrain map

2. profile — BAMs → nucleotide profiles

Counts A/C/G/T at every reference position and writes per-genome stats (coverage, breadth, a present/absent call) and SNVs. Missing assets are auto-generated and cached.

zipstrain profile -i mapped/samples.txt -f ref.fna -s ref.stb -r profiled

zipstrain profile

3. compare — profiles → ANI

Compares every pair of samples by popANI (near 100% ⇒ same strain). Point --profile-db at a CSV of profile_name,profile_location.

zipstrain compare --profile-db profiles.csv -r compared

zipstrain compare

Every run writes a zipstrain_run.log so you can tell if it is running, finished, or crashed. Prefer a pipeline? A Nextflow implementation runs all of this end to end.

Citation

If you use ZipStrain in your research, please cite the preprint:

Ghadermazi P, Emerson JB, Olm MR. 2026. ZipStrain Enables Rapid and Precise Strain-Resolved Metagenomics. bioRxiv. https://doi.org/10.64898/2026.05.20.726564

GitHub can also expose the citation metadata directly from CITATION.cff.

License

ZipStrain is distributed under the terms described in LICENSE.

About

Official Repository for ZipStrain python package

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages