How to use extractfeat in bash to obtain feature tags values ?
1
0
Entering edit mode
4.8 years ago
kA • 0

Hi,

I am writing a bash script to extract some features like CDS from my sequences. I have noticed some of them have tags like Organism and Organelle, whose values I would like to extract. Like this example of a gene

I am not sure what the syntax would be in bash if this is possible, as I cannot get the script to extract these values.

bash emboss • 832 views
ADD COMMENT
1
Entering edit mode

From your example, extracting "Organism" in a Bash script can be:

$ ORG=$(grep 'ORGANISM' sequence.gb | sed -r 's/\s+ORGANISM\s+//')
$ echo $ORG
Caenorhabditis elegans
ADD REPLY
1
Entering edit mode
4.8 years ago
$ wget -q  -O - "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=JF896456.1&retmode=xml" |\
xmllint --xpath '//GBSeq_organism/text()' - 

Caenorhabditis elegans
ADD COMMENT

Login before adding your answer.

Traffic: 1891 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