This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract the species group information from the ENSEMBL IDs

I want to extract the group information of the species given the ENSEMBL ID

For example, The ENSZALG00000010594 ID is for the species Zonotrichia albicollis and belongs to group bird.

I have a list of IDs and corresponding species name. I want to know if there is any way to extract the group information given the ENSMBL ID or the species name. Can anyone please help me in this regard?

sequence gene genome alignment

To add further, I found out the grouping of species here. Is there any way I can find this information based on species name or ENSMBL IDs.

2 answers

Using Entrezdirect you can get this information from NCBI:

$ esearch -db taxonomy -query "Zonotrichia albicollis" | efetch -format native -mode xml | xtract -pattern Taxon -block "*/Taxon" -unless Rank -equals "no rank" -tab "\n" -element Rank,ScientificName
superkingdom    Eukaryota
kingdom Metazoa
phylum  Chordata
subphylum       Craniata
superclass      Sarcopterygii
class   Aves
infraclass      Neognathae
order   Passeriformes
family  Passerellidae
genus   Zonotrichia

Using Ensembl REST API:

https://rest.ensembl.org/taxonomy/id/Zonotrichia%20albicollis

id: 44394
leaf: 1
name: Zonotrichia albicollis
parent: 
  id: 44387
  leaf: 0
  name: Zonotrichia
  scientific_name: Zonotrichia
  tags: 
    name: 
      - Zonotrichia
    scientific_name: 
      - Zonotrichia
scientific_name: Zonotrichia albicollis
tags: 
  authority: 
    - Zonotrichia albicollis (Gmelin, 1789)
  genbank_common_name: 
    - white-throated sparrow
  name: 
    - Zonotrichia albicollis
  scientific_name: 
    - Zonotrichia albicollis

Yes, I had tried ENSEMBL Rest API. But, I could not get the correct information I was looking for using the API. The Entrezdirect option does work for extracting the taxon information. Sorry for not being very specific in my question earlier. By group in the question, I meant the NCBI-Blast name.

From this link i got the taxon-id for all the species. Then after entering the taxon-id here. I got the NCBI-blast name as output which I was looking for. However, doing this manually one by one would be tedious. @genomax can you please tell me if there is any way to extract NCBI-Blast names given the list of taxon-id.

@Abhijeet: Now you seem to be asking a different/circular question. What do you mean by "NCBI-Blast name"?

One can probably use Entrezdirect but you can also look into TaxonKit toolkit written by @Shenwei.

Sorry, I should have mentioned NCBI-blaste instead of group in the original group. Please see this image showing the "NCBI-Blast name" based on "taxon-id" ss

You will need to use birds (taxid:8782) taxID if you want to limit your blast searches to that ID. That NCBI blast name is referring to this TaxID.

You have this information available in taxonomy lookup from NCBI in class Aves which is Birds.

It can also be obtained by querying:

$ esearch -db taxonomy -query "birds" | efetch -format TaxId
8782

or if you want that specific bird

$ esearch -db taxonomy -query "Zonotrichia albicollis" | efetch -format TaxId
44394

Thank you very much @genomax. Much appreciate it.

There's a table mapping the ID prefixes to species names. The alternative would be to use the perl API.

@Abhijeet is looking for taxonomy information AFAI can tell.

Indeed, I missed this. The API would then be the way to go.

Log in to answer this question.