[Biopython] Eftech and db='bioproject'... DTD problem?

Nicolas Joannin nicolas.joannin at gmail.com
Wed Jun 12 03:04:31 UTC 2013


Hello,

I'm trying to use Entrez.efetch to retrieve info about a BioProject.
However, I get DTD error (see ouput below).
Using "validate=False" avoids the error, but results in an empty string
output..

Any idea as to how I can read BioProject data from Entrez?

Best regards,
Nicolas

Example output:

>>> h=Entrez.efetch(db='bioproject', id='20431')
>>> p=Entrez.read(h)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Bio/Entrez/__init__.py",
line 368, in read
    record = handler.read(handle)
  File
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Bio/Entrez/Parser.py",
line 184, in read
    self.parser.ParseFile(handle)
  File
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Bio/Entrez/Parser.py",
line 300, in startElementHandler
    raise ValidationError(name)
Bio.Entrez.Parser.ValidationError: Failed to find tag 'RecordSet' in the
DTD. To skip all tags that are not represented in the DTD, please call
Bio.Entrez.read or Bio.Entrez.parse with validate=False.


Nicolas Joannin, Ph.D.
Bioinformatics Center
Kyoto University, Uji campus, Japan



More information about the Biopython mailing list