works great, Thanks!!!
• 0 views
•
link
Hi everyone, I have a blastx file with no name in the sseqid just the accession number, I am thinking use this to obtain the DEFINITION field and add it as 13th column in my file. Could somebody help me with this task?
You need Entrez Direct for this:
cat gi-list
807531832
195954015
for next in $(cat gi-list); do title=$(epost -db protein -id "$next" | efetch -format docsum | xtract -element Title); echo -e "$next\t$title"; done
807531832 ATP6 (mitochondrion) [Campethera nivosa]
195954015 atp6 (mitochondrion) [Ochrogaster lunifer]
Then you can use a tool like join.
works great, Thanks!!!
EDirect 3.30 is now out on the NCBI ftp site. efetch -format docsum (and elink) can accept a single sequence accession number in the -id argument. For scripts that loop through one accession at a time, this will eliminate the epost step.
Here is some simplified code for doing that:
for next in $(cat gi-list)
do
efetch -db protein -id "$next" -format docsum |
xtract -pattern DocumentSummary -lbl "$next" -element Title
done
Log in to answer this question.
search this site for ncbi eutils