<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Jocelyn, </p>
<p>This is the example given in the Biopython tutorial, with just the id changed. If it is not returning the correct output (a seq_record with a sequence and sufficient features (around 1403)) then it is a Biopython issue.</p>
<p><br>
</p>
<p>Downloading the entry as Genbank (full) allows it to be opened properly. It is therefore a tutorial issue as the commands given are not retrieving the record properly.</p>
<p><br>
</p>
<p>..d</p>
<p><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">Dr David Martin<br>
Senior Lecturer in Bioinformatics<br>
College of Life Sciences<br>
University of Dundee<br>
<br>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Jocelyne <jocelyne@gmail.com><br>
<b>Sent:</b> 03 October 2017 19:57<br>
<b>To:</b> David Martin (Staff)<br>
<b>Cc:</b> biopython@lists.open-bio.org<br>
<b>Subject:</b> Re: [Biopython] Issues parsing genbank files</font>
<div> </div>
</div>
<div>
<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/" id="LPlnk737534" previewremoved="true">https://www.ncbi.nlm.nih.gov/Class/MLACourse/Original8Hour/Entrez/</a>
<div id="LPBorder_GT_15070576914640.1838438589664444" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15070576914550.053310673897936756" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15070576914580.09755779277147059" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15070576914580.15545283086603967"></div>
<div id="LPTitle_15070576914580.8663943326018941" style="top: 0px; color: rgb(0, 120, 215); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15070576914600.06702893043400326" href="https://www.ncbi.nlm.nih.gov/Class/MLACourse/Original8Hour/Entrez/" target="_blank" style="text-decoration: none;">MLA CE Course Manual: Molecular Biology Information ...</a></div>
<div id="LPMetadata_15070576914610.5497960635125787" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
www.ncbi.nlm.nih.gov</div>
<div id="LPDescription_15070576914620.6448948297495474" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
insert the description to be displayed by the search engine. Also searched by the search engine.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
<a href="https://www.ncbi.nlm.nih.gov/books/NBK25501/" id="LPlnk640417" previewremoved="true">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 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" alt="Email signature" width="1" height="2" border="0" style="user-select: none;" src="https://www.dundee.ac.uk/media/dundeewebsite/emailsignature/tiny.png"></span></a><span style="font-size:12.0pt; font-family:"Times New Roman",serif"><u></u><u></u></span></p>
<table class="m_3041449790183323555MsoNormalTable" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse">
<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" alt="University of Dundee shield logo" width="73" height="73" border="0" style="user-select: none;" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/university-of-dundee-email-favicon.png"></span></a><span style="font-size:7.5pt; font-family:"Times New Roman",serif"><u></u><u></u></span></p>
</td>
<td width="12" style="width:9.0pt; padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt; font-family:"Times New Roman",serif"> <u></u><u></u></span></p>
</td>
<td width="11" style="width:8.25pt; border:none; border-left:solid #4365e2 1.0pt; padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt; font-family:"Times New Roman",serif"> <u></u><u></u></span></p>
</td>
<td width="430" style="width:322.5pt; padding:0cm 0cm 0cm 0cm">
<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" alt="University of Dundee Facebook" width="32" height="32" border="0" style="user-select: none;" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-facebook.png"></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" alt="University of Dundee Twitter" width="32" height="32" border="0" style="user-select: none;" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-twitter.png"></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" alt="University of Dundee LinkedIn" width="32" height="32" border="0" style="user-select: none;" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-linkedin.png"></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" alt="University of Dundee YouTube" width="32" height="32" border="0" style="user-select: none;" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-youtube.png"></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" alt="University of Dundee Instagram" width="32" height="32" border="0" style="user-select: none;" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-instagram.png"></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" alt="University of Dundee Snapchat" width="32" height="32" border="0" style="user-select: none;" src="https://www.dundee.ac.uk/media/dundeewebsite/themes/brandnewhope/img/baxter-blue-snapchat.png"></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>
</div>
</div>
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>