<div dir="ltr"><div>Hi Peter,<br><br></div><div>Indeed... Works perfectly. I had tried <<retmode="gbwithparts", rettype="text">> and was wondering why I got unparsed results... Typing fast makes for bad coding! ;-)<br><br></div><div>Thanks a ton.<br><br></div><div>Ivan<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 22, 2016 at 12:47 PM, Peter Cock <span dir="ltr"><<a href="mailto:p.j.a.cock@googlemail.com" target="_blank">p.j.a.cock@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ivan,<br>
<br>
I think you need to be using:<br>
<br>
..., retype="gbwithparts", retmode="text", ...<br>
<br>
not:<br>
<br>
..., retmode="gbwithparts", rettype="gb", ...<br>
<br>
See also <a href="https://www.biostars.org/p/79436/" rel="noreferrer" target="_blank">https://www.biostars.org/p/<wbr>79436/</a><br>
<br>
Sadly the NCBI Entrez API does not always give helpful<br>
error messages for things like this :(<br>
<br>
Peter<br>
<div><div class="h5"><br>
On Thu, Sep 22, 2016 at 5:04 PM, Ivan Erill <<a href="mailto:ivan.erill@gmail.com">ivan.erill@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I am trying to download a full genome record from NCBI Entrez, using<br>
> 'gbwithparts' to get the full record. However, when I run my code, I get<br>
> only the 'header' portion of the record, without either the features or the<br>
> sequence at the bottom (even though a simple browser access to the record<br>
> (without requesting GenBank (full)) will at least provide the annotation.<br>
><br>
> If I try the same with the equivalent GenBank accession for the record, I<br>
> get the full record (features and sequence).<br>
><br>
> This is reproducible at least for several other bacterial genomes.<br>
><br>
> I had previously downloaded RefSeq records using the same type of call, so I<br>
> was wondering whether this might be related to NCBI transitioning to HTTPS,<br>
> the phasing-out of GI numbers, or both. Before pestering the NCBI staff,<br>
> however, I thought I would ask whether there have been any changes to the<br>
> BioPython parser that might explain the effect.<br>
><br>
> Here is the code:<br>
><br>
> #*****************************<wbr>******************************<wbr>*******************<br>
> # -*- coding: utf-8 -*-<br>
> from Bio import Entrez<br>
> Entrez.email ="<a href="mailto:ivan.erill@gmail.com">ivan.erill@gmail.com</a>"<br>
><br>
> #RefSeq accession for Acetobacterium woodii DSM 1030, complete genome<br>
> #NC_016894 / 379009891<br>
> ncbi_handle =<br>
> Entrez.efetch(db='nuccore',id=<wbr>'379009891',retmode='<wbr>gbwithparts',\<br>
>                             rettype='gb')<br>
> ncbi_record = ncbi_handle.read()<br>
> print 'End of RefSeq retrieved record: '<br>
> print ncbi_record[-44:]<br>
> #this gives me:<br>
> #--> End of RefSeq retrieved record:<br>
> #--> CONTIG      join(CP002987.1:1..4044777)<br>
> #--> //<br>
> #showing that the record ends with a contig join statement<br>
> #using NC_016894 as 'id' gives same behavior<br>
><br>
> #GenBank accession for Acetobacterium woodii DSM 1030, complete genome<br>
> #CP002987 / 375300680<br>
> ncbi_handle =<br>
> Entrez.efetch(db='nuccore',id=<wbr>'375300680',retmode='<wbr>gbwithparts',\<br>
>                             rettype='gb')<br>
> ncbi_record = ncbi_handle.read()<br>
> print 'End of RefSeq retrieved record: '<br>
> print ncbi_record[-77:]<br>
> #this gives me:<br>
> #--> End of RefSeq retrieved record:<br>
> #-->   4044721 ttttacctgg taatgttttt ttatattatc aacatttatt cttataaatt<br>
> acttgat<br>
> #--> //<br>
> #showing that the record ends with the complete sequence<br>
> #using CP002987 as 'id' gives same behavior<br>
> #*****************************<wbr>******************************<wbr>*******************<br>
><br>
><br>
> Any insights will be greatly appreciated. Thanks,<br>
><br>
> Ivan<br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> Biopython mailing list  -  <a href="mailto:Biopython@mailman.open-bio.org">Biopython@mailman.open-bio.org</a><br>
> <a href="http://mailman.open-bio.org/mailman/listinfo/biopython" rel="noreferrer" target="_blank">http://mailman.open-bio.org/<wbr>mailman/listinfo/biopython</a><br>
</blockquote></div><br></div>