[Biopython-dev] Entrez documentation and DTD checking

Peter Cock p.j.a.cock at googlemail.com
Fri Feb 24 00:24:01 UTC 2012


Hi all,

Prompted by this query I did check the Tutorial and docstrings and
updated most (hopefully all) the efetch examples to include the now
required retmode="text" argument.

I also found a few missing DTD files as well while writing some
doctests for Bio.Entrez (not sure right now how to integrate
these into our run_tests.py framework while making them
conditional on the --offline switch which we use on the buildbot).

I'd be grateful if anyone has time to check for any other examples
that need updating, or further NCBI DTD files we should include.

This page claims nothing has changed since 2009 which is wrong:
http://www.ncbi.nlm.nih.gov/corehtml/query/DTD/index.shtml

This page claims nothing has changed since 2002 which is worse:
http://www.ncbi.nlm.nih.gov/data_specs/dtd/other/entrez/

There are a few recent DTD files listed here though they may
not apply to Entrez: http://www.ncbi.nlm.nih.gov/dtd/
or alternatively http://www.ncbi.nlm.nih.gov/data_specs/dtd/

Peter


---------- Forwarded message ----------
From: Peter Cock <p.j.a.cock at googlemail.com>
Date: 2012/2/23
Subject: Re: [Biopython] Entrez and SeqIO "no records found in handle"
To: "高凤(Feng GAO)" <fenggao0907 at yahoo.com.cn>
Cc: "biopython at lists.open-bio.org" <biopython at lists.open-bio.org>


2012/2/23 高凤(Feng GAO) <fenggao0907 at yahoo.com.cn>:
> Hi all,
> We have some python code using gi number to get record from Genbank.
> Part of the code is:
>
> handle = Entrez.efetch(db="protein", id=ID, rettype="gb")
> record = SeqIO.read(handle,"genbank")
>
> We have had no problem with this code
>  until this week when we started getting "ValueError: No records found in handle".
> Anyone have an idea how to fix it now? Thanks!
> Feng

Try using an explicit retmode="text" in the efetch call.
The NCBI changed the defaults with EFetch 2.0, which
went live earlier this month. You're probably getting
XML back instead.

Note to self: I wonder if the Biopython tutorial examples
need to be updated as well...

Peter




More information about the Biopython-dev mailing list