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}")
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.2
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.2.tar.gz | 8.2 kB | Details |
Built distributions (wheels)
Total release size: 10.8 MB
Release files / mibig_taxa-0.1.2.tar.gz
| Download URL | mibig_taxa-0.1.2.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
369b18f8a56532bf91aa11924b01849bfdbc7de82bcab1804f88db2049aeb44c
|
|
BLAKE2b-256 checksum How to use checksums |
89e92ad7932564fad5c86cb8f4cd03551117b77b553728b14df110326883f85a
|
| 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.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.2-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 |
749544cb15a68b50050a521613d605ae982af5ab8e0437ee068887ddc37cc133
|
|
BLAKE2b-256 checksum How to use checksums |
976066d30f3bf3f1315529d62604376095e743610981ccfa4993f4483183afbe
|
| 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.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.2-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 |
ca7bc0b93fc724d3f8776b6485b77ce9627cda774c2e9d40437ac83750c45e80
|
|
BLAKE2b-256 checksum How to use checksums |
9ea597a95a7f428d1231cc633a04d00947e5f2074ded0019a9dc84d35007228e
|
| 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.2-cp310-none-win_amd64.whl
| Download URL | mibig_taxa-0.1.2-cp310-none-win_amd64.whl |
|---|---|
| Size | 201.5 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5efadd4ce9e7d285505d2bf2ae27ae25f6411158a515fa0039afef75d4265e59
|
|
BLAKE2b-256 checksum How to use checksums |
65fde78811d258425a4677c82992d9cb7420057bf90fbad9e6e8c5a0b284d490
|
| 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.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.2-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 |
5a11d0311a7db9c674a59fb382e709390a1a008adcabf14a8695ba304262b8af
|
|
BLAKE2b-256 checksum How to use checksums |
5a9a2475902e53fe5dff018a0e04f0f6d35509ed043b62294a93e686144f810c
|
| 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.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | mibig_taxa-0.1.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 605.9 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 |
9beb5e3efb7e9c96feac92903b7041812676507e2c9d92beb80e5cd552c354ab
|
|
BLAKE2b-256 checksum How to use checksums |
f22ab47538b817e8d65841f9f0d7d17f95b7e2285a7fd1fb4ce8ecd55e7633e0
|
| 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.2-cp39-none-win_amd64.whl
| Download URL | mibig_taxa-0.1.2-cp39-none-win_amd64.whl |
|---|---|
| Size | 201.6 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
33c903010a7a54b2eef672776f79380fae7a031951b9c4123b92330b2ef4e188
|
|
BLAKE2b-256 checksum How to use checksums |
6926e49fa8e3ef4f682bf1a711edcceb2fb41e427aabefd7adc8469838b58d91
|
| 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.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.2-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 |
f19c3701a9dbc0ce1d1d221b755bfa968adf899b82886b68b0633fcf7510a827
|
|
BLAKE2b-256 checksum How to use checksums |
e639fc94a044271f6b6c8dd892719d0bb8861c7d8190223000ee35e9b58a7544
|
| 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.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | mibig_taxa-0.1.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 606.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 |
bff4a99748dfc67ae58f179633f6db9d1c4ba9439d4b57c2307dd4c7e5fd044e
|
|
BLAKE2b-256 checksum How to use checksums |
49e112158bcf44d2224a8a85f654b6b4a6dbb2a7e60cfa38f19c034cb102fa51
|
| 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.2-cp38-none-win_amd64.whl
| Download URL | mibig_taxa-0.1.2-cp38-none-win_amd64.whl |
|---|---|
| Size | 201.6 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
158a8eab19423e9d1a30f5ba5b8e102acb439b081f2ee08090123e95f85f9d2d
|
|
BLAKE2b-256 checksum How to use checksums |
baa46fe75e3d69249706cb4235b2f8003b1dee24dac22abea2f5a0432e24bcb9
|
| 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.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.2-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 |
163b4801b1057b5bde00e2f4e60d04066d24a3b4ac686ca14ce4b62ef970f44c
|
|
BLAKE2b-256 checksum How to use checksums |
5822e979529fd80f5cbdb5c44a57605aa16678537c1db37ac8e7f3fd2c7418d7
|
| 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.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | mibig_taxa-0.1.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 606.3 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 |
28087c88ae0ca7c2f188ab58d908e6e4db09948f58459ecc4f9a22cd97f63d92
|
|
BLAKE2b-256 checksum How to use checksums |
3201f61a35e0dee8ca395b56ff4d8602f20fac679ef9e16166d281ad2c72a772
|
| 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.2-cp37-none-win_amd64.whl
| Download URL | mibig_taxa-0.1.2-cp37-none-win_amd64.whl |
|---|---|
| Size | 201.5 kB |
| Tags | CPython 3.7 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f5ab6409c6f4d9b1fd5e12feac009317252ede10eaff834be864fcf0154237af
|
|
BLAKE2b-256 checksum How to use checksums |
e59a44c528728e55ff534cad544d8421184955d410af7489a88088df50480e16
|
| 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.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.2-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 |
7a971346a7971bf60d1873bc1d0d0ee04d8c8e314bc797569ecefa495cd6ed46
|
|
BLAKE2b-256 checksum How to use checksums |
429dd1f5d0ae23394c890e1014b29af4b1fb0adc3d838d7d64b7415d400b21d6
|
| 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.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | mibig_taxa-0.1.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 605.8 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 |
2ef74d938699dd9f36b98ebc41ddf93aee1737f2f211115f40e5b10ee6480273
|
|
BLAKE2b-256 checksum How to use checksums |
6dbee7107df03dbf036cddafa87b884bad25ec468af8670b61474a10e0c023f1
|
| 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.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | mibig_taxa-0.1.2-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 |
906db6f1d8c01ed6425b2e35692b83298f55a8e9c1475b24819598207c06daa6
|
|
BLAKE2b-256 checksum How to use checksums |
e7dfceeb1f674ecf19d45fdf5c926a412f2ba12fb5f2bc1147751070f54ddd65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|