Skip to main content

Python bindings to the MIBiG taxon handling

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mibig_taxa-0.1.2.tar.gz (8.2 kB view details)

Uploaded Source

Built Distributions

mibig_taxa-0.1.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view details)

Uploaded PyPymanylinux: glibc 2.5+ x86-64

mibig_taxa-0.1.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.5+ x86-64

mibig_taxa-0.1.2-cp310-none-win_amd64.whl (201.5 kB view details)

Uploaded CPython 3.10Windows x86-64

mibig_taxa-0.1.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.5+ x86-64

mibig_taxa-0.1.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (605.9 kB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

mibig_taxa-0.1.2-cp39-none-win_amd64.whl (201.6 kB view details)

Uploaded CPython 3.9Windows x86-64

mibig_taxa-0.1.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.5+ x86-64

mibig_taxa-0.1.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (606.1 kB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

mibig_taxa-0.1.2-cp38-none-win_amd64.whl (201.6 kB view details)

Uploaded CPython 3.8Windows x86-64

mibig_taxa-0.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

mibig_taxa-0.1.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (606.3 kB view details)

Uploaded CPython 3.8macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

mibig_taxa-0.1.2-cp37-none-win_amd64.whl (201.5 kB view details)

Uploaded CPython 3.7Windows x86-64

mibig_taxa-0.1.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ x86-64

mibig_taxa-0.1.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (605.8 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

mibig_taxa-0.1.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.5+ x86-64

File details

Details for the file mibig_taxa-0.1.2.tar.gz.

File metadata

  • Download URL: mibig_taxa-0.1.2.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mibig_taxa-0.1.2.tar.gz
Algorithm Hash digest
SHA256 369b18f8a56532bf91aa11924b01849bfdbc7de82bcab1804f88db2049aeb44c
MD5 27434eaed601e2499ac0ccaf5a448733
BLAKE2b-256 89e92ad7932564fad5c86cb8f4cd03551117b77b553728b14df110326883f85a

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for mibig_taxa-0.1.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 749544cb15a68b50050a521613d605ae982af5ab8e0437ee068887ddc37cc133
MD5 c155a71caf9b8565fd15eae84281bd70
BLAKE2b-256 976066d30f3bf3f1315529d62604376095e743610981ccfa4993f4483183afbe

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for mibig_taxa-0.1.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ca7bc0b93fc724d3f8776b6485b77ce9627cda774c2e9d40437ac83750c45e80
MD5 b0ff9e169f72e6c7b99d4d85489a45a1
BLAKE2b-256 9ea597a95a7f428d1231cc633a04d00947e5f2074ded0019a9dc84d35007228e

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp310-none-win_amd64.whl.

File metadata

  • Download URL: mibig_taxa-0.1.2-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 201.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mibig_taxa-0.1.2-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 5efadd4ce9e7d285505d2bf2ae27ae25f6411158a515fa0039afef75d4265e59
MD5 8616f19f86ebc29f8ab20a79ed63ff73
BLAKE2b-256 65fde78811d258425a4677c82992d9cb7420057bf90fbad9e6e8c5a0b284d490

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for mibig_taxa-0.1.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5a11d0311a7db9c674a59fb382e709390a1a008adcabf14a8695ba304262b8af
MD5 53e1d1f6cbf4a8095a5159acc5a75eaa
BLAKE2b-256 5a9a2475902e53fe5dff018a0e04f0f6d35509ed043b62294a93e686144f810c

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for mibig_taxa-0.1.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9beb5e3efb7e9c96feac92903b7041812676507e2c9d92beb80e5cd552c354ab
MD5 95e74ba08eb6068a1ddecc05ec825c46
BLAKE2b-256 f22ab47538b817e8d65841f9f0d7d17f95b7e2285a7fd1fb4ce8ecd55e7633e0

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp39-none-win_amd64.whl.

File metadata

  • Download URL: mibig_taxa-0.1.2-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 201.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mibig_taxa-0.1.2-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 33c903010a7a54b2eef672776f79380fae7a031951b9c4123b92330b2ef4e188
MD5 67cc48bf11201e54691bb42aa7777874
BLAKE2b-256 6926e49fa8e3ef4f682bf1a711edcceb2fb41e427aabefd7adc8469838b58d91

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for mibig_taxa-0.1.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f19c3701a9dbc0ce1d1d221b755bfa968adf899b82886b68b0633fcf7510a827
MD5 ef1bb66f4d81b32ce9a1c7315e102655
BLAKE2b-256 e639fc94a044271f6b6c8dd892719d0bb8861c7d8190223000ee35e9b58a7544

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for mibig_taxa-0.1.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 bff4a99748dfc67ae58f179633f6db9d1c4ba9439d4b57c2307dd4c7e5fd044e
MD5 be964b798c9a472fd86969e301bb0742
BLAKE2b-256 49e112158bcf44d2224a8a85f654b6b4a6dbb2a7e60cfa38f19c034cb102fa51

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp38-none-win_amd64.whl.

File metadata

  • Download URL: mibig_taxa-0.1.2-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 201.6 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mibig_taxa-0.1.2-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 158a8eab19423e9d1a30f5ba5b8e102acb439b081f2ee08090123e95f85f9d2d
MD5 2f5f11f3db110c4563b2ac820e528f72
BLAKE2b-256 baa46fe75e3d69249706cb4235b2f8003b1dee24dac22abea2f5a0432e24bcb9

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for mibig_taxa-0.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 163b4801b1057b5bde00e2f4e60d04066d24a3b4ac686ca14ce4b62ef970f44c
MD5 0f16c13910026592e44564458e049077
BLAKE2b-256 5822e979529fd80f5cbdb5c44a57605aa16678537c1db37ac8e7f3fd2c7418d7

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for mibig_taxa-0.1.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 28087c88ae0ca7c2f188ab58d908e6e4db09948f58459ecc4f9a22cd97f63d92
MD5 35d04352e7eb3ec02d9ead70bc2fd366
BLAKE2b-256 3201f61a35e0dee8ca395b56ff4d8602f20fac679ef9e16166d281ad2c72a772

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp37-none-win_amd64.whl.

File metadata

  • Download URL: mibig_taxa-0.1.2-cp37-none-win_amd64.whl
  • Upload date:
  • Size: 201.5 kB
  • Tags: CPython 3.7, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mibig_taxa-0.1.2-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 f5ab6409c6f4d9b1fd5e12feac009317252ede10eaff834be864fcf0154237af
MD5 845b6871ea3b16b7a3a6d8d2a6202e79
BLAKE2b-256 e59a44c528728e55ff534cad544d8421184955d410af7489a88088df50480e16

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for mibig_taxa-0.1.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7a971346a7971bf60d1873bc1d0d0ee04d8c8e314bc797569ecefa495cd6ed46
MD5 21eb31c595d5058cbfa5c0b17f59beaf
BLAKE2b-256 429dd1f5d0ae23394c890e1014b29af4b1fb0adc3d838d7d64b7415d400b21d6

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for mibig_taxa-0.1.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2ef74d938699dd9f36b98ebc41ddf93aee1737f2f211115f40e5b10ee6480273
MD5 d39457ef41150fe69703104f04511c57
BLAKE2b-256 6dbee7107df03dbf036cddafa87b884bad25ec468af8670b61474a10e0c023f1

See more details on using hashes here.

File details

Details for the file mibig_taxa-0.1.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for mibig_taxa-0.1.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 906db6f1d8c01ed6425b2e35692b83298f55a8e9c1475b24819598207c06daa6
MD5 0ee2bd35c2e991d1117c7f7eb95be345
BLAKE2b-256 e7dfceeb1f674ecf19d45fdf5c926a412f2ba12fb5f2bc1147751070f54ddd65

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page