Retrieve exon ranges from E-utils
2
0
Entering edit mode
4.6 years ago
speycast • 0

Hi,

I'm trying to retrieve exon ranges for a gene from GenBank format efetch -id NG_007086.2 -format gb -mode xml -db nucleotide | xtract -pattern GBFeature -match GBFeature_key: exon -first GBFeature_location but it's giving me error message saying ERROR: Unexpected 'exon' argument after 'GBFeature_key', I tried to play around with GBFeature_key: exon, but couldn't get it right.

I followed their tutorial demo: https://ftp.ncbi.nlm.nih.gov/pub/education/public_webinars/2016/06Jun29_Exons/Gene_Exon_Demos.txt

Any help would be greatly appreciated

Thanks!

etuils ncbi exon GenBank • 820 views
ADD COMMENT
2
Entering edit mode
4.6 years ago

using xslt


<xsl:stylesheet version="1.0" xmlns:xsl="&lt;a href=" http:="" www.w3.org="" 1999="" XSL="" Transform"="" rel="nofollow">http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:apply-templates select="//GBFeature[GBFeature_key='exon']/GBFeature_intervals/GBInterval"/>
</xsl:template>
<xsl:template match="GBInterval">
<xsl:value-of select="GBInterval_from/text()"/><xsl:text> </xsl:text><xsl:value-of select="GBInterval_to/text()"/><xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>

usage:

 wget -q  -O - "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=NG_007086.2&retmode=xml&rettype=gb" | xsltproc biostars.xsl - 

5002 5115
8439 8511
10887 11061
12995 13154
14397 14491
14836 14940
15131 15267
15518 16105
ADD COMMENT
1
Entering edit mode
4.6 years ago
speycast • 0

I used -if ... -equals .. and it worked,

efetch -id NG_007086.2 -format gb -mode xml -db nucleotide | xtract -pattern GBFeature -if GBFeature_key -equals exon -first GBFeature_location

ADD COMMENT
0
Entering edit mode

Since this answer works you can accept this as well. It is different from what @Pierre provided and actually answers your own question with same software package.

ADD REPLY

Login before adding your answer.

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