Can someone please explain this error?
I hava a smal script that tries to fetch information from the a NCBI BioAssay using the Entrez module form Bipython. I get an error I do not understand. I try to run:
from Bio import Entrez
Entrez.email="yourname@mail.se"
handle_esummary=Entrez.esummary(db='pcassay',id='1337')
record_esummary=Entrez.read(handle_esummary)
I get the error:
File "smaltest.py", line 5, in <module>
record_esummary=Entrez.read(handle_esummary)
File "/usr/common/schrodinger/mmshare-v20109/lib/Linux-x86_64/lib/python2.7/site-packages/Bio/Entrez/__init__.py", line 297, in read
record = handler.run(handle)
File "/usr/common/schrodinger/mmshare-v20109/lib/Linux-x86_64/lib/python2.7/site-packages/Bio/Entrez/Parser.py", line 90, in run
self.parser.ParseFile(handle)
File "/usr/common/schrodinger/mmshare-v20109/lib/Linux-x86_64/lib/python2.7/site-packages/Bio/Entrez/Parser.py", line 105, in startElement
itemtype = str(attrs["Type"]) # convert from Unicode
KeyError: 'Type'
I tried handle_esummary=Entrez.esummary(db="journals",id="30367"); record = Entrez.read(handle_esummary) and it is ok. But I got same error message, so I think it is the parsing problem of biopython to different database.
I tried handle_esummary=Entrez.esummary(db="journals",id="30367"); record = Entrez.read(handle_esummary) and it is ok. But I got same error message when I use your example, so I think it is the parsing problem of biopython to different database.
It's about programmatically access of esummary, efetch with available database (pcassay, pubmed, nucleotide, journal) at NCBI have nothing to do with parsing I guess.
http://biopython.org/DIST/docs/api/Bio.Entrez.Parser-pysrc.html
I think the error raised at the line 263 when biopython tried to parse the XML result but failed to get an attribute named "type". I didn't read it carefully, so it is just my guessing.