How to fill taxonomy informations from NCBI?
2
0
Entering edit mode
3.3 years ago
Camp • 0

Hi, there!

I've seen questions related to that but none addressing in with lay explanations which is very much indeed my case. I have about 500 species list to fill with Kingdom, Phylum, Class, Order, Family

I saw that i should follow something such as "specie OR specie OR..." in NCBI taxonomy > Display setting > common tree > Save as

When i save this it just gives me a messy information in all one column

I looked for simple tutorials, scripts but didnt find any

Would love and deeply appreciate some help for a lay person!

Taxonomy NCBI • 1.5k views
ADD COMMENT
1
Entering edit mode
3.3 years ago
MSRS ▴ 590

Step 1

Use NCBI Taxonomy browser to convert species name to corresponding Taxonomy ID.

Step 2

Use TaxonKit to convert related lineage detail (Phylum, class, order,....species) of those TaxId

taxonkit lineage id.txt | tee lineage.txt

Step 3

Use csvtk to formating these lineage.

cat lineage.txt \
    | taxonkit reformat \
    | csvtk -H -t cut -f 1,3 \
    | csvtk -H -t sep -f 2 -s ';' -R \
    | csvtk add-header -t -n taxid,kindom,phylum,class,order,family,genus,species \
    | csvtk pretty -t > out_id.txt

Thank you

ADD COMMENT
1
Entering edit mode

taxonkit reformat supports input of TaxIds (since v0.8.0) and recognizes "\t" in output format. Therefore, it can be simplified as:

taxonkit name2taxid names.txt \
    | taxonkit reformat -I 2 -f "{k}\t{p}\t{c}\t{o}\t{f}\t{g}\t{s}" -o result.txt

Add header and save to XLSX format if you like:

taxonkit name2taxid names.txt \
    | taxonkit reformat -I 2 -f "{k}\t{p}\t{c}\t{o}\t{f}\t{g}\t{s}" \
    | csvtk add-header -t -n "name,taxid,kindom,phylum,class,order,family,genus,species" \
    | csvtk csv2xlsx -t -o result.xlsx
ADD REPLY
0
Entering edit mode
3.3 years ago
GenoMax 147k

See answers here:

Convert list of Accession Numbers to Full Taxonomy
converting taxID to taxonomy

If this does not help solve your problem provide examples of species names.

ADD COMMENT

Login before adding your answer.

Traffic: 1713 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6