<div dir="ltr"><div><div><div>Hi David:<br></div>I think if you are searching by id, you should only get 1 record. <br></div>The questions you are asking sound to me like Entrez / NCBI databases questions, not necessarily Biopython questions. Unless someone else has time to dive into your specific example, I suggest you look at this documentation:<br><a href="https://www.ncbi.nlm.nih.gov/Class/MLACourse/Original8Hour/Entrez/">https://www.ncbi.nlm.nih.gov/Class/MLACourse/Original8Hour/Entrez/</a><br><a href="https://www.ncbi.nlm.nih.gov/books/NBK25501/">https://www.ncbi.nlm.nih.gov/books/NBK25501/</a><br></div>Jocelyne<br><div><div><div> <br><br><br><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 3, 2017 at 2:39 AM, David Martin (Staff) <span dir="ltr"><<a href="mailto:d.m.a.martin@dundee.ac.uk" target="_blank">d.m.a.martin@dundee.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="#0563C1" vlink="#954F72" lang="EN-GB">
<div class="m_3041449790183323555WordSection1">
<p class="MsoNormal">Hi folks,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m trying to parse some bacterial genomes. I’ve lifted the following code from the biopython tutorial but it seems to be giving issues.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-family:Consolas">from Bio import Entrez<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">from Bio import SeqIO<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Entrez.email = "<a href="mailto:A.N.Other@example.com" target="_blank">A.N.Other@example.com</a>"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">with Entrez.efetch(db="nucleotide", rettype="gb", retmode="text", id="nc_003197") as handle:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> seq_record = SeqIO.read(handle, "gb") #using "gb" as an alias for "genbank"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">print("%s with %i features" % (<a href="http://seq_record.id" target="_blank">seq_record.id</a>, len(seq_record.features)))<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I get one feature instead of the thousands expected.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Trying to extract a single gene I get a run of NN instead of sequence.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thoughts: This is initially retrieved as a set of annotations but no sequence. Is there a way to ensure entrez retrieves the full data?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">..d<u></u><u></u></p>
<p class="MsoNormal"><a href="//sig/" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;text-decoration:none"><img id="m_3041449790183323555_x0000_i1032" src="https://www.dundee.ac.uk/media/dundeewebsite/emailsignature/tiny.png" alt="Email signature" width="1" height="2" border="0"></span></a><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><u></u><u></u></span></p>
<table class="m_3041449790183323555MsoNormalTable" style="border-collapse:collapse" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr style="height:7.5pt">
<td colspan="4" style="padding:0cm 0cm 0cm 0cm;height:7.5pt">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"> <u></u><u></u></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><a href="http://uod.ac.uk/sig-home" target="_blank"><span style="font-size:7.5pt;font-family:"Times New Roman",serif;color:blue;text-decoration:none"><img id="m_3041449790183323555_x0000_i1031" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/university-of-dundee-email-favicon.png" alt="University of Dundee shield logo" width="73" height="73" border="0"></span></a><span style="font-size:7.5pt;font-family:"Times New Roman",serif"><u></u><u></u></span></p>
</td>
<td style="width:9.0pt;padding:0cm 0cm 0cm 0cm" width="12">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"> <u></u><u></u></span></p>
</td>
<td style="width:8.25pt;border:none;border-left:solid #4365e2 1.0pt;padding:0cm 0cm 0cm 0cm" width="11">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"> <u></u><u></u></span></p>
</td>
<td style="width:322.5pt;padding:0cm 0cm 0cm 0cm" width="430">
<p class="MsoNormal" style="line-height:15.0pt">
<b><span style="font-size:10.5pt;color:#4365e2;letter-spacing:.9pt">Dr David M A Martin PhD FRSB</span></b><span style="font-size:10.0pt;color:#4365e2"><br>
Senior Lecturer in Bioinformatics<br>
School of Life Sciences, University of Dundee<br>
<a href="tel:+44%201382%20388704" value="+441382388704" target="_blank">+44(0)1382 388704</a> | <a href="mailto:d.m.a.martin@dundee.ac.uk@dundee.ac.uk" target="_blank"><span style="color:#4365e2;text-decoration:none">d.m.a.martin@dundee.ac.uk</span></a><u></u><u></u></span></p>
</td>
</tr>
<tr style="height:7.5pt">
<td colspan="4" style="padding:0cm 0cm 0cm 0cm;height:7.5pt"></td>
</tr>
<tr>
<td colspan="4" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><a href="http://uod.ac.uk/sig-fb" target="_blank"><span style="font-size:9.0pt;color:blue;text-decoration:none"><img id="m_3041449790183323555_x0000_i1030" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-facebook.png" alt="University of Dundee Facebook" width="32" height="32" border="0"></span></a><a href="http://uod.ac.uk/sig-tw" target="_blank"><span style="font-size:9.0pt;color:blue;text-decoration:none"><img id="m_3041449790183323555_x0000_i1029" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-twitter.png" alt="University of Dundee Twitter" width="32" height="32" border="0"></span></a><a href="http://uod.ac.uk/sig-li" target="_blank"><span style="font-size:9.0pt;color:blue;text-decoration:none"><img id="m_3041449790183323555_x0000_i1028" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-linkedin.png" alt="University of Dundee LinkedIn" width="32" height="32" border="0"></span></a><a href="http://uod.ac.uk/sig-yt" target="_blank"><span style="font-size:9.0pt;color:blue;text-decoration:none"><img id="m_3041449790183323555_x0000_i1027" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-youtube.png" alt="University of Dundee YouTube" width="32" height="32" border="0"></span></a><a href="http://uod.ac.uk/sig-ig" target="_blank"><span style="font-size:9.0pt;color:blue;text-decoration:none"><img id="m_3041449790183323555_x0000_i1026" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-instagram.png" alt="University of Dundee Instagram" width="32" height="32" border="0"></span></a><a href="http://uod.ac.uk/sig-sc" target="_blank"><span style="font-size:9.0pt;color:blue;text-decoration:none"><img id="m_3041449790183323555_x0000_i1025" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-snapchat.png" alt="University of Dundee Snapchat" width="32" height="32" border="0"></span></a><span style="font-size:9.0pt;color:#4365e2"> </span><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><u></u><u></u></span></p>
</td>
</tr>
<tr>
<td colspan="4" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:8.5pt;color:#888888"><a href="http://uod.ac.uk/sig-strapline" target="_blank"><b><span style="color:#4365e2;text-decoration:none">We're Scottish University of the Year again!</span></b></a><br>
The Times / Sunday Times Good University Guide 2016 and 2017</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><u></u><u></u></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<br>
<span style="font-size:10pt">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</div>
<br>______________________________<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>