{"id":16849233,"url":"https://github.com/mbhall88/tbpore","last_synced_at":"2026-03-01T21:38:29.220Z","repository":{"id":39236132,"uuid":"431738979","full_name":"mbhall88/tbpore","owner":"mbhall88","description":"Mycobacterium tuberculosis genomic analysis from Nanopore sequencing data","archived":false,"fork":false,"pushed_at":"2024-06-12T00:59:14.000Z","size":3479,"stargazers_count":12,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-01-20T05:12:14.553Z","etag":null,"topics":["bioinformatics","drug-resistance-prediction","genomics","mycobacterium-tuberculosis","nanopore","variant-calling"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbhall88.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-11-25T06:33:42.000Z","updated_at":"2025-09-18T11:48:30.000Z","dependencies_parsed_at":"2023-12-27T06:41:13.492Z","dependency_job_id":"a30a3f02-8fbd-4727-bef8-8e3fa643517e","html_url":"https://github.com/mbhall88/tbpore","commit_stats":{"total_commits":261,"total_committers":4,"mean_commits":65.25,"dds":0.3639846743295019,"last_synced_commit":"bda8a36a35081831e47e530173ca13706da18473"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/mbhall88/tbpore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbhall88%2Ftbpore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbhall88%2Ftbpore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbhall88%2Ftbpore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbhall88%2Ftbpore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbhall88","download_url":"https://codeload.github.com/mbhall88/tbpore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbhall88%2Ftbpore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29984725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T21:06:37.093Z","status":"ssl_error","status_checked_at":"2026-03-01T21:05:45.052Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioinformatics","drug-resistance-prediction","genomics","mycobacterium-tuberculosis","nanopore","variant-calling"],"created_at":"2024-10-13T13:14:40.406Z","updated_at":"2026-03-01T21:38:29.202Z","avatar_url":"https://github.com/mbhall88.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TBpore\n\n*Mycobacterium tuberculosis* genomic analysis from Nanopore sequencing data\n\n[![Python CI](https://github.com/mbhall88/tbpore/actions/workflows/ci.yaml/badge.svg)](https://github.com/mbhall88/tbpore/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/mbhall88/tbpore/branch/main/graph/badge.svg)](https://codecov.io/gh/mbhall88/tbpore)\n[![PyPI](https://img.shields.io/pypi/v/tbpore)](https://pypi.org/project/tbpore/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tbpore)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n[TOC]: #\n\n# Table of Contents\n\n- [TBpore](#tbpore)\n- [Table of Contents](#table-of-contents)\n  - [Synopsis](#synopsis)\n  - [Citation](#citation)\n  - [Installation](#installation)\n    - [conda](#conda)\n    - [pip](#pip)\n      - [Dependencies](#dependencies)\n    - [Container](#container)\n      - [`singularity`](#singularity)\n      - [`docker`](#docker)\n  - [Configuring the decontamination database index](#configuring-the-decontamination-database-index)\n  - [Performance](#performance)\n    - [`tbpore process`](#tbpore-process)\n    - [`tbpore cluster`](#tbpore-cluster)\n  - [Usage](#usage)\n    - [General usage](#general-usage)\n    - [process](#process)\n    - [cluster](#cluster)\n    - [download](#download)\n\n## Synopsis\n\n`tbpore` is a tool with two main goals.\nFirst is to process Nanopore Mycobacterium tuberculosis sequencing data to describe\nvariants with respect to the\ncanonical TB strain H37Rv and predict antibiotic resistance (command `tbpore process`).\nVariant description is done by decontaminating reads, calling variants with\n[bcftools](https://github.com/samtools/bcftools) and filtering variants.\nAntibiotic resistance is predicted\nwith [mykrobe](https://github.com/Mykrobe-tools/mykrobe).\nSecond, `tbpore` can be used to cluster TB samples based on their genotyping and a given\ndistance threshold (command\n`tbpore cluster`).\n\n## Citation\n\nTBpore is a slimmed-down version of\nthe [full pipeline](https://github.com/mbhall88/head_to_head_pipeline) used\nin our paper 👇\n\n\n\u003e Hall, M. B. et al. Evaluation of Nanopore sequencing for Mycobacterium tuberculosis drug susceptibility testing and outbreak investigation: a genomic analysis. *The Lancet Microbe* 0, (2022) doi: [10.1016/S2666-5247(22)00301-9][doi].\n\n[doi]: https://doi.org/10.1016/S2666-5247(22)00301-9\n\n## Installation\n\n### conda\n\n[![Conda (channel only)](https://img.shields.io/conda/vn/bioconda/tbpore)](https://anaconda.org/bioconda/tbpore)\n[![bioconda version](https://anaconda.org/bioconda/tbpore/badges/platforms.svg)](https://anaconda.org/bioconda/tbpore)\n![Conda](https://img.shields.io/conda/dn/bioconda/tbpore)\n\nPrerequisite: [`conda`][conda] (and bioconda channel [correctly set up][channels])\n\n```shell\n$ conda install tbpore\n```\n\n### pip\n\n![PyPI](https://img.shields.io/pypi/v/tbpore)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tbpore)\n\nThe python components of `tbpore` are availble to install through [PyPI].\n\n```shell\npip install tbpore\n```\n\n**However**, you will need to install the following dependencies, which cannot be\ninstalled through PyPI.\n\n#### Dependencies\n\n* [`rasusa`](https://github.com/mbhall88/rasusa) version 2.x\n* [`psdm`](https://github.com/mbhall88/psdm) version 0.1.x\n* [`samtools`](https://github.com/samtools/samtools) version 1.13\n* [`bcftools`](https://github.com/samtools/bcftools) version 1.13\n* [`mykrobe`](https://github.com/Mykrobe-tools/mykrobe) version 0.12.x\n* [`minimap2`](https://github.com/lh3/minimap2) version 2.22\n* [`seqkit`](https://bioinf.shenwei.me/seqkit/) version 2.x\n* [`nanoq`](https://github.com/esteinig/nanoq) version 0.9.x\n\nWe make no guarentees about the performance of `tbpore` with versions other than those\nspecified above. In particular, the `bcftools` version is very important. The latest\nversions of the other dependencies can likely be used.\n\n### Container\n\nDocker images are provided through biocontainers.\n\n#### `singularity`\n\nPrerequisite: [`singularity`][singularity]\n\n```shell\n$ URI=\"docker://quay.io/biocontainers/tbpore:\u003ctag\u003e\"\n$ singularity exec \"$URI\" tbpore --help\n```\n\nsee [here][tags] for valid values for `\u003ctag\u003e`.\n\n#### `docker`\n\n[![Docker Repository on Quay](https://quay.io/repository/biocontainers/tbpore/status \"Docker Repository on Quay\")](https://quay.io/repository/biocontainers/tbpore)\n\nPrerequisite: [Docker]\n\n```shell\n$ docker pull quay.io/biocontainers/tbpore:\u003ctag\u003e\n$ docker run quay.io/biocontainers/tbpore:\u003ctag\u003e tbpore --help\n```\n\nsee [here][tags] for valid values for `\u003ctag\u003e`.\n\n## Configuring the decontamination database index\n\nAfter installing TBpore, you will need to download the decontamination database index.\n\n```\n$ tbpore download\n```\n\nBy default, this will download the index\nto `${HOME}/.tbpore/decontamination_db/remove_contam.map-ont.mmi`, as this is the\ndefault location `tbpore process` will search for.\n\nIf you prefer to download the index to another location, this can be done with\n\n```\n$ tbpore download -o other/location/db.mmi\n```\n\nKeep in mind, if you specify a non-default location, you will need to use the `--db`\noption when running `tbpore process`.\n\n## Performance\n\n### `tbpore process`\n\nBenchmarked on 151 TB ONT samples with 1 thread:\n\n* Runtime: `2103`s avg, `4048`s max (s = seconds);\n* RAM: `12.4`GB avg, `13.1`GB max (GB = Gigabytes);\n\n### `tbpore cluster`\n\nClustering 151 TB ONT samples:\n\n* Runtime: `286`s;\n* RAM: `\u003c1`GB;\n\n## Usage\n\n### General usage\n\n```\nUsage: tbpore [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  -h, --help     Show this message and exit.\n  -V, --version  Show the version and exit.\n  -v, --verbose  Turns on debug-level logger. Option is mutually exclusive\n                 with quiet.\n  -q, --quiet    Turns off all logging except errors. Option is mutually\n                 exclusive with verbose.\n\nCommands:\n  cluster   Cluster consensus sequences\n  download  Download and validate the decontamination database\n  process   Single-sample TB genomic analysis from Nanopore sequencing data\n```\n\n### process\n\n```\nUsage: tbpore process [OPTIONS] [INPUTS]...\n\n  Single-sample TB genomic analysis from Nanopore sequencing data\n\n  INPUTS: Fastq file(s) and/or a directory containing fastq files. All files\n  will be joined into a single fastq file, so ensure they're all part of the\n  same sample/isolate.\n\nOptions:\n  -h, --help                      Show this message and exit.\n  -r, --recursive                 Recursively search INPUTS for fastq files\n  -S, --name TEXT                 Name of the sample. By default, will use the\n                                  first INPUT file with fastq extensions\n                                  removed\n  -A, --report_all_mykrobe_calls  Report all mykrobe calls (turn on flag -A,\n                                  --report_all_calls when calling mykrobe)\n  --db PATH                       Path to the decontaminaton database\n                                  [default: /home/mihall/.tbpore/decontaminati\n                                  on_db/remove_contam.map-ont.mmi]\n  -m, --metadata PATH             Path to the decontaminaton database metadata\n                                  file  [default: /data/scratch/projects/punim\n                                  1703/tmp/outliers/tbpore/data/decontaminatio\n                                  n_db/remove_contam.tsv.gz]\n  -c, --coverage INTEGER          Depth of coverage to subsample to. Use 0 to\n                                  disable\n  -o, --outdir DIRECTORY          Directory to place output files  [default:\n                                  .]\n  --tmp DIRECTORY                 Specify where to write all (tbpore)\n                                  temporary files. [default: \u003coutdir\u003e/.tbpore]\n  -t, --threads INTEGER           Number of threads to use in multithreaded\n                                  tools  [default: 1]\n  -d, --cleanup / -D, --no-cleanup\n                                  Remove all temporary files on *successful*\n                                  completion  [default: no-cleanup]\n  --cache DIRECTORY               Path to use for the cache  [default:\n                                  /home/mihall/.cache]\n```\n\n### cluster\n\n```\nUsage: tbpore cluster [OPTIONS] [INPUTS]...\n\n  Cluster consensus sequences\n\n  Preferably input consensus sequences previously generated with tbpore\n  process.\n\n  INPUTS: Two or more consensus fasta sequences. Use glob patterns to input\n  several easily (e.g. output/sample_*/*.consensus.fa).\n\nOptions:\n  -h, --help                      Show this message and exit.\n  -T, --threshold INTEGER         Clustering threshold  [default: 6]\n  -o, --outdir DIRECTORY          Directory to place output files  [default:\n                                  .]\n  --tmp DIRECTORY                 Specify where to write all (tbpore)\n                                  temporary files. [default: \u003coutdir\u003e/.tbpore]\n  -t, --threads INTEGER           Number of threads to use in multithreaded\n                                  tools  [default: 1]\n  -d, --cleanup / -D, --no-cleanup\n                                  Remove all temporary files on *successful*\n                                  completion  [default: no-cleanup]\n  --cache DIRECTORY               Path to use for the cache  [default:\n                                  /Users/michaelhall/.cache]\n```\n\n### download\n\n```\nUsage: tbpore download [OPTIONS]\n\n  Download and validate the decontamination database\n\nOptions:\n  -h, --help         Show this message and exit.\n  -o, --output PATH  Download database to a specified filepath  [default: ${HOME}/\n                     .tbpore/decontamination_db/remove_contam.map-ont.mmi]\n  -f, --force        Force overwrite if the database already exists\n```\n\n[channels]: https://bioconda.github.io/#usage\n\n[conda]: https://docs.conda.io/projects/conda/en/latest/user-guide/install/\n\n[PyPI]: https://pypi.org/project/tbpore/\n\n[singularity]: https://sylabs.io/guides/3.6/user-guide/quick_start.html#quick-installation-steps\n\n[tags]: https://quay.io/repository/biocontainers/tbpore?tab=tags\n\n[Docker]: https://docs.docker.com/v17.12/install/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbhall88%2Ftbpore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbhall88%2Ftbpore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbhall88%2Ftbpore/lists"}