How To Parse The Xml From Entrez Db=Protein Using Biopython
I want to obtain a proteins gi no# along with its cd root no# and taxid from a proteins NP_xxx. 1 (id#) when I use the Biopython's entrez as following
handle= Entrez.efetch(db='protein', id='NP_000368.1', retmode='xml')
record= Entrez.read(handle)
the record is a list-elements object.and looks very complicated and I somehow can not really locate the "Tag" or "Key"??.How i parse the output to obtain the information I interested in?
BTW where I can see the overview for which DTD information has been retrieved from the ncbi?
• 5,415 views
•
link
0 answers
No answers yet.
Log in to answer this question.
what do you mean with the "tag" or the "key" ?
if the rettype change to "gb"
Keys. Tag might not be the accurate words but i meant the identities label/Tag name, I need to extract the Gi and CD information
why do you need to parse the XML manually? When above you already have BioPython reading the file
eh...i am not sure if.Biopython is able to pass the xml from db='protein'. biopython should be able to parse most of the xml from entrez but not each one as long as I know... i can somehow put the above information into SeqIO.read(), and convert it into the Bio.SeqRecord but i can only have following informations.
Number of features: 0 SeqRecord(seq=Seq('MSGGPMGGRPGGRGAPAVQQNIPSTLLQDHENQRLFEMLGRKCLTLATAVVQLY...WDD', IUPACProtein( )), id='NP000368.1', name='NP000368', description='wiskott-Aldrich syndrome protein [Homo sap iens].', dbxrefs=[])
but I need the protein gi along the protein_cdd information
I am confused. If you want a SeqRecord from a Biopython parser, just ask Entrez for a GenBank format file (as you have shown). Currently the SeqIO parsing framework doesn't handle the equivalent XML file - it could be done but appears to add relative little benefit in terms of new functionality.
Thanks a lot for replying and sorry for confusing.. It does not really matter the retmode/rettype is 'xml' or'gb' ..I think at the moment I should simplify the question into "how i use Refseq id of a protein to obtain its Gi and CDD information."
I think that makes more sense and please post it as a new question