This is a test version of Biostars. For the public version, visit https://www.biostars.org.
From accession ID to phylum taxid.

Hello all,

I am using PLAST (which is some kind of faster BLAST) against the whole NCBi protein database to detect some unknown contamination in my fasta.file.

As a result I have a table with 10 000 lines and 3 columns : the id of the contig (from my fasta), the hit accession and the hit id (gi|219129610|ref|XP_002184977.1| for instance ) .

I would like to know for each line if the blast match is in Rhodophyta, in order to delete the contig or keep it.

To do this I first plan to add tomy table a new 4th column with the phylum taxid associated with the hit accession. But I don't know how to do that. I would be happy if somebdy helps me to do this or knows a better way to achieve my goal.

I've looked BBMAP (How to obtain taxonomic information from GIs ) but it requires the database ftp://ftp.ncbi.nih.gov/pub/taxonomy/gi_taxid_prot.dmp.gz that have been deleted in 2019 ...

Thank you again for your help !

alignment r rna-seq

People can't see your results so without an example this question has no chance of getting an answer. Please edit your original question. Add a representative example of output you have. Provide an example of what you expect the final output to be.

For example you can use Entrezdirect to find TaxId and taxonomy information like this:

$ esearch -db protein -query "XP_002184977.1" | elink -target taxonomy | efetch -format native -mode xml | xtract -pattern Taxon -block "*/Taxon" -unless Rank -equals "no rank" -tab "\n" -element Rank,TaxId,ScientificName
superkingdom    2759    Eukaryota
clade   2698737 Sar
clade   33634   Stramenopiles
clade   2696291 Ochrophyta
phylum  2836    Bacillariophyta
class   33849   Bacillariophyceae
clade   33850   Bacillariophycidae
order   38748   Naviculales
family  38749   Phaeodactylaceae
genus   2849    Phaeodactylum
species 2850    Phaeodactylum tricornutum

You could then grep for that line e.g. grep phylum and then extract the TaxId which is in column 2.

$ esearch -db protein -query "XP_002184977.1" | elink -target taxonomy | efetch -format native -mode xml | xtract -pattern Taxon -block "*/Taxon" -unless Rank -equals "no rank" -tab "\n" -element Rank,TaxId,ScientificName | grep phylum
phylum  2836    Bacillariophyta

0 answers

No answers yet.

Log in to answer this question.