Skip to main content

A pipeline implementing TB-Profiler for batch detection and reporting of anti-microbial resistance in TB for public health and clinical use.

Project description

Python 3.7


Detection of resistance mechanisms in Mycobacterium tuberculosis is dependent upon identification of SNPs that may confer decreased susceptibility to anti-mycobacterial drugs. Troika is a pipeline, which calls SNPs for both phylogenetic analysis and determination of AST. Troika leverages high quality tools, including Snippy and TB-profiler and its related database to detect resistance conferring mutations from Illumina read data and filters these results for reporting for public health and clinical use in Australia.


There are many tools and databases available, however, for the purposes of reporting genomic AST for M. tuberculosis in the context of public health and clinical use in Australia customisation is required. Rather than reinventing the wheel, Troika leverages a high quality database and a detection tool which is highly customisable.


Troika is designed for batch reporting of AST in M. tuberculosis isolates generated from Illumina reads and phylogenetic analysis and clustering to identify potentially related isolates. This pipeline is in use at MDU Victoria Australia for Tuberculosis surveillance and AST reporting.


Conda (Recomended)



pip3 install Troika-Tb

Running Troika


Input for troika is a tab-delimited file containing three columns (no header) <sample_name> <path_to_read1> <path_to_read2>

troika -h

usage: [-h] [-v] [--input_file INPUT_FILE] [--detect_species]
                    [--resistance_only] [--Singularity]
                    [--profiler_singularity_path PROFILER_SINGULARITY_PATH]
                    [--snippy_singularity_path SNIPPY_SINGULARITY_PATH]
                    [--workdir WORKDIR] [--resources RESOURCES] [--jobs JOBS]
                    [--profiler_threads PROFILER_THREADS]
                    [--kraken_threads KRAKEN_THREADS] [--kraken_db KRAKEN_DB]
                    [--snippy_threads SNIPPY_THREADS] [--mode {mdu,normal}]
                    [--positive_control POSITIVE_CONTROL]
                    [--db_version DB_VERSION] [--min_cov MIN_COV]
                    [--min_aln MIN_ALN]

Troika - a pipeline for phylogenentic analysis, detection and reporting of
genomic AST in Mtb If an arg is specified in more than one place, then
commandline values override environment variables which override defaults.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  --input_file INPUT_FILE, -i INPUT_FILE
                        Input file tab-delimited file 3 columns isolate_id
                        path_to_r1 path_to_r2 (default: )
  --detect_species, -d  Set if you would like to detect species - note if not
                        set troika may include non-tuberculosis species in the
                        analysis. (default: False)
  --resistance_only     If detection of resistance mutations only is needed.
                        Phylogeny will not be performed. (default: False)
  --Singularity, -S     If singularity is to be used for troika. (default:
                        URL for TB-profiler singularity container. (default:
  --workdir WORKDIR, -w WORKDIR
                        Working directory, default is current directory
                        (default: /home/khhor/dev/troika_tb)
  --resources RESOURCES, -r RESOURCES
                        Directory where templates are stored (default:
  --jobs JOBS, -j JOBS  Number of jobs to run in parallel. (default: 8)
                        Number of threads to run TB-profiler (default: 1)
  --kraken_threads KRAKEN_THREADS, -kt KRAKEN_THREADS
                        Number of threads for kraken (default: 4)
  --kraken_db KRAKEN_DB, -k KRAKEN_DB
                        Path to DB for use with kraken2, if no DB present
                        speciation will not be performed. [env var:
                        KRAKEN2_DEFAULT_DB] (default: None)
  --snippy_threads SNIPPY_THREADS, -st SNIPPY_THREADS
                        Number of threads for snippy (default: 8)
  --mode {mdu,normal}, -m {mdu,normal}
                        If running for MDU service use 'mdu', else use
                        'normal' (default: normal)
                        Path to positive control - REQUIRED if running for MDU
                        service (default: )
  --db_version DB_VERSION
                        The version of database being used. (default:
  --min_cov MIN_COV, -mc MIN_COV
                        Minimum coverage for quality checks, isolates with
                        coverage below this threshold will not be used in the
                        analysis. (default: 40)
  --min_aln MIN_ALN, -ma     MIN_ALN
                        Minimum alignment for phylogenetic analysis,
                        alignments lower than this threshold will not be
                        included in the calculation of core-genome. (default:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Troika-TB, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size Troika_TB-0.0.5-py3-none-any.whl (1.3 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size Troika_TB-0.0.5.tar.gz (1.3 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page