https://github.com/cvua-rrw/taxidtools
Python library to deal with taxonomic IDs and lineages from the NCBI's Taxdump files
https://github.com/cvua-rrw/taxidtools
ancestry lineage lineages ncbi ncbi-taxonomy python python-library taxdump taxids taxonomy
Last synced: 4 months ago
JSON representation
Python library to deal with taxonomic IDs and lineages from the NCBI's Taxdump files
- Host: GitHub
- URL: https://github.com/cvua-rrw/taxidtools
- Owner: CVUA-RRW
- License: bsd-3-clause
- Created: 2020-10-02T11:35:52.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-06-25T11:01:30.000Z (almost 2 years ago)
- Last Synced: 2025-10-21T20:08:01.228Z (8 months ago)
- Topics: ancestry, lineage, lineages, ncbi, ncbi-taxonomy, python, python-library, taxdump, taxids, taxonomy
- Language: Python
- Homepage: https://cvua-rrw.github.io/taxidtools/
- Size: 1.01 MB
- Stars: 2
- Watchers: 0
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/CVUA-RRW/taxidTools/actions/workflows/python-package.yml)
[](LICENSE)
[](https://github.com/CVUA-RRW/taxidtools/releases)
[](https://anaconda.org/conda-forge/taxidtools)
[](https://pypi.org/project/taxidTools/)
[](https://hub.docker.com/r/gregdenay/taxidtools/tags)
[](https://zenodo.org/doi/10.5281/zenodo.5094583)
# TaxidTools - A Python Toolkit for Taxonomy
**taxidTools** is a Python library to handle Taxonomy definitions.
## Highlights
* Load taxonomy defintions for the NCBI's taxdump files
* Prune, filter, and normalize branches
* Save as JSON for later use
* Determine consensus, last common ancestor, or distances
* Retrieve ancestries or list descendants
* Export as Newick trees
## Installation
With `pip`:
```bash
pip install taxidtools
```
With `conda`:
```bash
conda install -c conda-forge taxidtools
```
With `docker`:
```bash
docker pull gregdenay/taxidtools
```
## Quickstart
With the [NCBI's taxdump files](https://ftp.ncbi.nlm.nih.gov/pub/taxonomy/new_taxdump/) installed locally:
```python
>>> import taxidTools
>>> tax = taxidTools.read_taxdump('nodes.dmp', 'rankedlineage.dmp', 'merged.dmp')
>>> tax.getName('9606')
'Homo sapiens'
>>> lineage = tax.getAncestry('9606')
>>> lineage.filter()
>>> [node.name for node in lineage]
['Homo sapiens', 'Homo', 'Hominidae', 'Primates', 'Mammalia', 'Chordata', 'Metazoa']
>>> tax.lca(['9606', '10090']).name
'Euarchontoglires'
>>> tax.distance('9606', '10090')
18
```
## Documentation
Full documentation is hosted on the [homepage](https://cvua-rrw.github.io/taxidtools/)
## Cite us
If you use taxidTools for your reasearch, you can cite it using the
DOI at the top of this page.