Skip to main content

spoligotyper: in silico spoligotyping of the M. tuberculosis complex

Tests Coverage Release PyPI Bioconda Python 3.10–3.14 License Documentation DOI

In silico spoligotyping of Mycobacterium tuberculosis complex (MTBC) samples, from sequencing reads (fastq) or genome assemblies (fasta). spoligotyper finds the 43 spacers of the direct repeat (DR) locus with Seal from BBTools and reports the spoligotype as binary, octal and hexadecimal codes, and as an SB number from the Mbovis.org database. It also identifies the species and the lineage, and flags contaminated or mixed samples.

Summary page of the PDF report, with the spoligotype pattern of three samples Sample page of the PDF report, with the reads supporting each spacer
PDF report of the tutorial: summary, and the evidence for each sample. Full example report (PDF).

Features

  • Reads or assemblies: single-end or paired-end fastq, or fasta, gzipped or not. For nanopore data, type the assembly (why).
  • Batch mode: point it at a folder; fastq and fasta files are detected and R1/R2 files paired automatically.
  • All the standard codes: binary, octal, hexadecimal, SB number (M. bovis and other animal-adapted lineages), and SIT and SITVIT2 family with the optional SIT database.
  • Species and lineage: M. tuberculosis, M. africanum, M. bovis, BCG, M. caprae, M. orygis, ... from regions of difference, the lineage (1 to 7 and sublineages) from a 62-SNP barcode, and the lineage of the livestock-associated complex (La1 to La3, and the M. bovis sublineages La1.1 to La1.8, e.g. La1.8.1 = Eu1), and the 32 sublineages of lineage 1 (e.g. L1.2.2.2).
  • Quality checks: fraction of MTBC reads (contamination), mixed samples, consistency between the spoligotype, species and lineage, and the closest known patterns for new spoligotypes.
  • PDF report for QA: results, reads supporting each spacer, input files with checksums, software versions, parameters, operator, date, and a review box. Plus a table, JSON and a MultiQC section for pipelines.
  • Validated on 31 reference genomes, 46 public and 7 simulated read sets of known species, lineage and spoligotype (Validation).
  • Workflow ready: nf-core module and Galaxy tool in integrations/.
  • Transparent: borderline calls, low depth and failed samples are flagged, never hidden.
  • Fast: a few seconds per sample, with 1 GB of memory.

Installation

conda install -c bioconda bbmap    # BBTools (seal.sh), if not installed yet
pip install spoligotyper

A bioconda package (conda install -c conda-forge -c bioconda spoligotyper, with BBTools) is under review: use pip until it is available. See Installation for other options. For SIT numbers, run spoligotyper-download-sit once.

Quick start

spoligotyper -r1 sample_R1.fastq.gz -r2 sample_R2.fastq.gz -o results/   # Paired-end reads
spoligotyper -r1 sample.fastq.gz -o results/                             # Single-end reads
spoligotyper -r1 assembly.fasta -o results/                              # Assembly (also for nanopore data)
spoligotyper -i folder/ -o results/                                      # All the samples in a folder

The results are printed and saved in results/ as a table and a PDF report. New to the tool? The tutorial types three public genomes in a few minutes.

Documentation

The wiki covers usage and options, output files, how it works, species and lineage, validation, troubleshooting and the FAQ.

Citing

If you use spoligotyper, please cite it and BBTools, which finds the spacers:

Duceppe M-O. spoligotyper: in silico spoligotyping of Mycobacterium tuberculosis complex genomes. Zenodo. https://doi.org/10.5281/zenodo.22926160

This DOI always points to the latest version; each release also has its own DOI, listed on Zenodo. GitHub's "Cite this repository" button gives the same citation in APA and BibTeX formats.

Bushnell B. BBTools. https://sourceforge.net/projects/bbmap/

For the lineage, please also cite the SNP barcode:

Coll F et al. A robust SNP barcode for typing Mycobacterium tuberculosis complex strains. Nat Commun 5, 4812 (2014). https://doi.org/10.1038/ncomms5812

and, for the livestock lineages (La1 to La3):

Zwyer M et al. A new nomenclature for the livestock-associated Mycobacterium tuberculosis complex based on phylogenomics. Open Research Europe 1, 100 (2021). https://doi.org/10.12688/openreseurope.14029.2

and, for the lineage 1 sublineages:

Netikul T et al. Whole-genome single nucleotide variant phylogenetic analysis of Mycobacterium tuberculosis Lineage 1 in endemic regions of Asia and Africa. Sci Rep 12, 1565 (2022). https://doi.org/10.1038/s41598-022-05524-0

Contributing

Bug reports, questions and pull requests are welcome: see CONTRIBUTING.md.

Author

Marc-Olivier Duceppe, Canadian Food Inspection Agency (CFIA): marc-olivier.duceppe@inspection.gc.ca

License

MIT

Metadata

Release files for spoligotyper 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spoligotyper 0.9.0
File Size Uploaded
spoligotyper-0.9.0.tar.gz 255.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spoligotyper 0.9.0
File Interpreter ABI Platform
spoligotyper-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 495.4 kB

Release files / spoligotyper-0.9.0.tar.gz

Download URL spoligotyper-0.9.0.tar.gz
Size 255.8 kB
Tags Source
SHA-256 checksum
How to use checksums
92c58a233869472a99447799a53546d611e79802abb917c1d435ac4632f55177
BLAKE2b-256 checksum
How to use checksums
913b76bd0fa5140d69586aca867e9b0addb637c75639bc961daa3faaa064457e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / spoligotyper-0.9.0-py3-none-any.whl

Download URL spoligotyper-0.9.0-py3-none-any.whl
Size 239.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51742db1c6482514c1dbad296abef516707fa877e53f0764e76c34e035080fe8
BLAKE2b-256 checksum
How to use checksums
e2ed1ad8f7a0468f1c1bdb1100ceedf1d9e0ea85b362fc0862f4bccd36751856
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page