Skip to main content
added 238 characters in body
Source Link
Chris_Rands
  • 4k
  • 13
  • 31

These are NCBI taxonomy ID's rather than anything specific to UniProt. One way to parse them would be using BioPython via Bio.Entrez, for example:

from Bio import Entrez

def get_taxon_name_from_NCBI_id(id_):
    Entrez.email = '[email protected]'
    handle = Entrez.efetch(db='taxonomy', id= id_, retmode='xml')
    records = Entrez.read(handle)[0]
    return records['ScientificName'], records['TaxId']

print(get_taxon_name_from_NCBI_id(9606))
# ('Homo sapiens', '9606')

Of course you could query Entrez directly: https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=taxonomy&id=9606

Or even more basically do a manual search of NCBI taxonomy: https://www.ncbi.nlm.nih.gov/taxonomy/?term=9606

These are NCBI taxonomy ID's rather than anything specific to UniProt. One way to parse them would be using BioPython via Bio.Entrez, for example:

from Bio import Entrez

def get_taxon_name_from_NCBI_id(id_):
    Entrez.email = '[email protected]'
    handle = Entrez.efetch(db='taxonomy', id= id_, retmode='xml')
    records = Entrez.read(handle)[0]
    return records['ScientificName'], records['TaxId']

print(get_taxon_name_from_NCBI_id(9606))
# ('Homo sapiens', '9606')

These are NCBI taxonomy ID's rather than anything specific to UniProt. One way to parse them would be using BioPython via Bio.Entrez, for example:

from Bio import Entrez

def get_taxon_name_from_NCBI_id(id_):
    Entrez.email = '[email protected]'
    handle = Entrez.efetch(db='taxonomy', id= id_, retmode='xml')
    records = Entrez.read(handle)[0]
    return records['ScientificName'], records['TaxId']

print(get_taxon_name_from_NCBI_id(9606))
# ('Homo sapiens', '9606')

Of course you could query Entrez directly: https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=taxonomy&id=9606

Or even more basically do a manual search of NCBI taxonomy: https://www.ncbi.nlm.nih.gov/taxonomy/?term=9606

Source Link
Chris_Rands
  • 4k
  • 13
  • 31

These are NCBI taxonomy ID's rather than anything specific to UniProt. One way to parse them would be using BioPython via Bio.Entrez, for example:

from Bio import Entrez

def get_taxon_name_from_NCBI_id(id_):
    Entrez.email = '[email protected]'
    handle = Entrez.efetch(db='taxonomy', id= id_, retmode='xml')
    records = Entrez.read(handle)[0]
    return records['ScientificName'], records['TaxId']

print(get_taxon_name_from_NCBI_id(9606))
# ('Homo sapiens', '9606')