NCBI

ncbi.search(modifier=None, rank_query=None)

Search NCBI’s taxonomic data - get NCBI taxonomic IDs

Parameters
  • sci_com – list of common or scientific names

  • modifier – A modifier to the sci_com given. Options include: Organism, Scientific Name, Common Name, All Names, Division, Filter, Lineage, GC, MGC, Name Tokens, Next Level, PGC, Properties, Rank, Subtree, Synonym, Text Word. These are not checked, so make sure they are entered correctly, as is.

  • rank_query – A taxonomic rank name to modify the query sent to NCBI. Though note that some data sources use atypical ranks, so inspect the data itself for options. Optional.

Note

Remember to set your Entrez API key as ENTREZ_KEY

Returns

dict, named with values given to sci_com, where each value in the dict is a list of NCBI taxonomic identifiers

Usage:

from pytaxize import ncbi

ncbi.search(sci_com = "Apis")

# Many names
ncbi.search(sci_com=["Apis", "Puma concolor", "Pinus"])

# Example with more than 1 result
ncbi.search(sci_com='Satyrium')
ncbi.search(sci_com=['Satyrium', 'Pinus'])

# common names
ncbi.search(sci_com = 'bear')
ncbi.hierarchy()

Get a full taxonomic hierarchy from NCBI

Parameters

ids – one or more NCBI taxonomy ids

Note

Remember to set your Entrez API key as ENTREZ_KEY

Returns

dict, named with ids given to ids, where each value in the dict is a list of taxa, each a dict with the fields ScientificName, Rank, and TaxId

Usage:

from pytaxize import ncbi
ncbi.hierarchy(ids=9606)
ncbi.hierarchy(ids=[9606,55062,4231])