Skip to main content

Taxonova

License: MIT PyPI Python 3.8+ Web server

Taxonova is a deep learning classifier for the taxonomic assignment of microbial ribosomal RNA amplicon sequences, from single variable regions of the 16S rRNA gene to the full rRNA operon. For each sequence it reports a lineage from domain to species together with a confidence at each rank. When the confidence at a rank is below its threshold, Taxonova reports the lineage only down to the rank above, for example a genus without a species, rather than assigning an unsupported label. The thresholds therefore set the balance between assigning more sequences and making fewer incorrect assignments.

Species names follow the Genome Taxonomy Database (GTDB): the 16S rRNA models are trained on Greengenes2, which takes its nomenclature from GTDB, and the full-operon model on GROND with GTDB taxonomy.

Web server

The simplest way to use Taxonova is the web server, which needs no installation:

https://huggingface.co/spaces/claessonlab/Taxonova

Upload a FASTA file or paste sequences, select the amplicon region and, if needed, a confidence threshold. The web server screens each sequence with an rRNA gene filter before classification and returns the same results as the command-line tool. For large datasets, or to train a model on your own reference, install the package as described below.

Performance

In the accompanying manuscript (in revision), evaluated on physical and biome-simulated mock communities against seven published classifiers, Taxonova reached species-level F-measures of 0.76 to 1.00 (median 0.94) on short-read and 0.82 to 0.99 (median 0.97) on long-read amplicons of 250 bp to 4,900 bp, and made a median of 7.2-fold fewer false-positive species assignments than the other classifiers. It classifies about 100 sequences per second on a single CPU core with a peak memory use of 0.82 GB; no GPU is used for classification.

Installation

pip install taxonova

or, from this repository:

git clone https://github.com/kardokhk/taxonova.git
cd taxonova
pip install -e .

Pretrained models

Model file Region Reference
gg2_v4_mrgroups_model.pt V4 Greengenes2
gg2_v3v4_mrgroups_model.pt V3-V4 Greengenes2
gg2_v5v7_mrgroups_model.pt V5-V7 Greengenes2
gg2_v1v9_mrgroups_model.pt whole 16S (V1-V9) Greengenes2
gtdb_rrn_mrgroups_model.pt full rRNA operon (16S-ITS-23S) GROND, GTDB taxonomy

The checkpoints (about 240 MB each) are attached to the GitHub Release and can be downloaded with the built-in tool:

taxonova download-models --list            # available and downloaded models
taxonova download-models --models gg2_v4   # one model; keys: gg2_v4, gg2_v3v4, gg2_v5v7, gg2_v1v9, gtdb_rrn
taxonova download-models --models all      # all five

Models are stored in ~/.taxonova/models/, or in the directory given by the TAXONOVA_MODELS_DIR environment variable, and can then be referred to by file name. Confidence calibration is already applied in the released checkpoints. See MODELS.md for details.

Usage

taxonova classification \
    --input reads.fasta \
    --model_input gg2_v4_mrgroups_model.pt \
    --output predictions.tsv
Option Meaning
--input query sequences in FASTA format
--model_input pretrained checkpoint (path or file name)
--output output table (TSV)
--confidence_threshold species threshold, default 0.8; the thresholds of the other ranks scale with it
--domain_threshold ... --genus_threshold set the threshold of a single rank explicitly
--cpu_threads number of CPU threads

The default thresholds are 0.5 for domain to family, 0.7 for genus and 0.8 for species. Because the same threshold does not give the same abstention rate in every amplicon region or with every reference, we recommend choosing the threshold that gives the abstention rate a study requires on a held-out subset of the reference.

The output table has one row per sequence: sequence_id, then a label and a confidence for each of the seven ranks. The confidence at each rank is capped at that of the rank above. A rank whose confidence is below its threshold, and every rank below it, is reported as Unclassified.

Other modes are training (train a model on your own reference; --smart_full_data selects the number of epochs on a validation split and then retrains on all sequences), calibrate (temperature scaling) and fit-ood (out-of-distribution threshold). Run taxonova <mode> --help for all options, and see QUICKSTART.md for a short worked example.

Benchmark

The evaluation framework used in the manuscript, Taxobench, is available at https://github.com/kardokhk/TaxoBench.

Citation

Kakabra K, Patel S, Temko A, Claesson MJ. Taxonova: deep learning enables fast and accurate microbiome species-level amplicon classification. Manuscript in revision.

A full citation will be added on publication.

License

MIT; see LICENSE.

Contact

Kardokh Kakabra, kardokhkaka@gmail.com. Developed in the Claesson Lab, University College Cork and APC Microbiome Ireland.

Metadata

Release files for taxonova 26.9.2

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

Source distribution (sdist)

Source distribution for taxonova 26.9.2
File Size Uploaded Provenance Actions
taxonova-26.9.2.tar.gz 124.9 kB Without provenance Details for taxonova-26.9.2.tar.gz

Built distribution (wheel)

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

Total release size: 212.8 kB

Release files / taxonova-26.9.2.tar.gz

Download URL taxonova-26.9.2.tar.gz
Size 124.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d4729009961a5d0371f78a76eee9882ea8ecfccb5cd3beeefcc7c7e7a748cb19
BLAKE2b-256 checksum
How to use checksums
6b1be8680c4ba3f18002fa407e0c77bb32481e853ef019b31970ca4de8a0e67e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / taxonova-26.9.2-py3-none-any.whl

Download URL taxonova-26.9.2-py3-none-any.whl
Size 87.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
809a348f2e3bc0afc752612273c2cf0f0359afccb549b2294921ed921e65bd63
BLAKE2b-256 checksum
How to use checksums
1a978c593daaa0b98a9cb9657f0d9b75eb604a751df1f370365ff33c447bc999
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for taxonova 26.9.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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