taxa-py
MIBiG taxonomy handling python bindings
This package is designed to help MIBiG-related python code to handle NCBI taxid lookups using NCBI taxdump data.
This package contains the python bindings for the MIBiG taxa-rs package to manage a local JSON-based cache of interesting taxa, allowing bulk database imports to speed up compared to parsing directly from the taxdump files.
Installation
To install taxa-py, run the following (assuming you are in a python virtualenv):
pip install mibig-taxa
Usage
To create a cache file, first grab the latest taxdump collection and extract it. You'll also need a directory containing the MIBiG BGC entry JSON files.
Then run the following:
from mibig_taxa import TaxonCache
cache = TaxonCache()
cache.initialise(
taxdump="path/to/taxa/rankedlineage.dmp",
merged_id_dump="path/to/taxa/merged.dmp",
datadir="path/to/mibig-json/data"
)
# Save the cache to a file for later use
cache.save("my_cache.json")
If you want to use the cache in a different process, simply load the cache like this:
from mibig_taxa import TaxonCache
cache = TaxonCache("my_cache.json")
# Or, if you prefer the longer form
cache = TaxonCache()
cache.load("my_cache.json")
To get an ID mapping, use
from mibig_taxa import TaxonCache
cache = TaxonCache("my_cache.json")
id_to_map = 123456
name = get_name_by_id(id_to_map)
print(f"Taxon with ID {id_to_map} is called {name}")
If you want to transparently support deprecated IDs, also set the allow_deprecated argument to True:
from mibig_taxa import TaxonCache
cache = TaxonCache("my_cache.json")
deprecated_id_to_map = 123456
name = get_name_by_id(deprecated_id_to_map, allow_deprecated=True)
print(f"Taxon with deprecated ID {deprecated_id_to_map} is called {name}")
To get the mapping to an antiSMASH --taxon value, use:
from mibig_taxa import TaxonCache
cache = TaxonCache("my_cache.json")
tax_id = 123456
as_taxon = cache.get_antismash_taxon(tax_id)
print(f"For antiSMASH, use --taxon {as_taxon} with tax_id {tax_id}")
You can also grab individual entries directly:
from mibig_taxa import TaxonCache
cache = TaxonCache("my_cache.json")
tax_id = 123456
entry = cache.get(tax_id)
# "class" is a reserved keyword in python, can't use it directly
entry_class = getattr(entry, "class")
print(f"{entry.superkingdom} > {entry.kingdom} > {entry.phylum} > {entry_class} > {entry.order} > {entry.family} > {entry.name}")
License
Licensed under the Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as Apache-2.0, without any additional terms or conditions.
Metadata
Release files for mibig-taxa 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mibig_taxa-0.1.4.tar.gz | 8.8 kB | Details |
Built distributions (wheels)
Total release size: 11.0 MB
Release files / mibig_taxa-0.1.4.tar.gz
| Download URL | mibig_taxa-0.1.4.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77bce4c03d90822eff0309b3709aa452c5a0d53ede0d27fc9b03e16a5e3dc505
|
|
BLAKE2b-256 checksum How to use checksums |
b12441e480ed408e937ae8024358378b2f24a15dd102f961bd7238d8436417e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.4-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Linux glibc 2.5+ x86-64 PyPy 3.7 PyPy 3.7 7.3 |
|
SHA-256 checksum How to use checksums |
a12c7bd080b2d1b7be128c920902931a14f40bc955eeab9081115d0d8d05e450
|
|
BLAKE2b-256 checksum How to use checksums |
375b880d9daf3725eeae0101757b5dcdce14a496887f6cdc99a704ba8652977f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
5e656de38b8ac0de3bc5a96397af77a44dd6cd662ae9181471d509d25cd25cf4
|
|
BLAKE2b-256 checksum How to use checksums |
c90b23609d31b2c3fd086f9a8538f3aaa7128510ffb0f3caf8c9bdec6b5e6fdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp310-none-win_amd64.whl
| Download URL | mibig_taxa-0.1.4-cp310-none-win_amd64.whl |
|---|---|
| Size | 211.5 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9136000b5cbbf55f3636b735cb93e8837d14a044d19f8ff3a210314aced18424
|
|
BLAKE2b-256 checksum How to use checksums |
24413a8e21647df53ccadc903a21226c843fa77b379f86815628626d8dbe4d2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
8f87cd025c3e2d4f243fa1edc07f71a49285716b219b8ccb0db9df8d2d884e39
|
|
BLAKE2b-256 checksum How to use checksums |
24eec83fa9df92e02baf1bdf92d252deb293ef07adf5e317207a3fc3451b6277
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | mibig_taxa-0.1.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 624.6 kB |
| Tags | CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2331be2afb92fe9bf1332a9b0b17c8f501cd8832e5ff832f170198f6e7af9a9b
|
|
BLAKE2b-256 checksum How to use checksums |
1778a62e5a2b0de444f48916220f28db4f3a72c4a0fe442c06226d2854652fe2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp39-none-win_amd64.whl
| Download URL | mibig_taxa-0.1.4-cp39-none-win_amd64.whl |
|---|---|
| Size | 211.6 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b4bc9d49c8ab9c7458a2cdb46fd3b1b083559daee042a831e558cc863e930c09
|
|
BLAKE2b-256 checksum How to use checksums |
acbd365fac0d92e335a53481f5718f7efc7d296cc59bc7e65283cfa53c3be988
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.9 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
2902935f26fc56942ea50fdb423a150a71f90b54839a0e58fcfd90230d078142
|
|
BLAKE2b-256 checksum How to use checksums |
4b1e11620ab139809db2582cf8044aaa00ed2fc1fdd34604d38d720fc04562b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | mibig_taxa-0.1.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 625.1 kB |
| Tags | CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
694ac70d39f08501656cf24f9c27f274aee7f3159156e27618b8eda61f55a65e
|
|
BLAKE2b-256 checksum How to use checksums |
e96b711f4f4f7cea0098618a4a63f5625d45b29b86f6201a914dfbfd64ae161d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp38-none-win_amd64.whl
| Download URL | mibig_taxa-0.1.4-cp38-none-win_amd64.whl |
|---|---|
| Size | 211.5 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6a25af64eaa01cc4c21bd8d67e3dcbba49a6b49d8df24302a96c070a0044679e
|
|
BLAKE2b-256 checksum How to use checksums |
c6c96f5c60deee8901329c8d7410861cf3a363d9ceca09732621136dd6ff348f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
a05bee664f1d2109f91ff6d3ad1857a3b1f50aa12808cb6dd25bf1afa099c632
|
|
BLAKE2b-256 checksum How to use checksums |
4fa1fda27190d5b291c9869bbde7c6592456c4b471ba1c8421fbd9aaac70d1a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | mibig_taxa-0.1.4-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 625.1 kB |
| Tags | CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
22f11c78aa8083a202546ab8b61e3c3f12becc30ff659b158c79ce212bb4b332
|
|
BLAKE2b-256 checksum How to use checksums |
a5eb2e43c2da1c8d928f13c3e1f8b9633be3681400c6de38cc6c3e2e60bf6ade
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp37-none-win_amd64.whl
| Download URL | mibig_taxa-0.1.4-cp37-none-win_amd64.whl |
|---|---|
| Size | 211.6 kB |
| Tags | CPython 3.7 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ff2eb8f64ee669adae4b350a003edf506118f383ab14ae097aa159febddede7c
|
|
BLAKE2b-256 checksum How to use checksums |
53392a1331519630f3b3105a7056bdda7c3229d664ec02a3b025996bf1782542
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
337f47e86bc6996b7020eac22394570b88bdfd9da1cd62f9890005d66f12782c
|
|
BLAKE2b-256 checksum How to use checksums |
b8e8f8b6a4af022664c42837193d62ed77b9f63f317634e5276f5631f253cd05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | mibig_taxa-0.1.4-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 624.5 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4ea5aa9e3ba1e46995b9a95fc3b7d267406ab3805f5b3023251c7566263dc08b
|
|
BLAKE2b-256 checksum How to use checksums |
2e90f5d35f9d3e50ed596b7345a19483b72166d5cc0773b154e1d4251ed598fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / mibig_taxa-0.1.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
f9451c6b1186cefbccfd621e1f9a6835f24850bf9d6cfbb58fd10c6f6331c94a
|
|
BLAKE2b-256 checksum How to use checksums |
c04809430f748457350da929bbbf814e30018bc26e538080a7a6d066c312b993
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|