<html>
<head>
<style>
body {
font-family: Verdana, sans-serif;
font-size: 0.8em;
color:#484848;
}
h1, h2, h3 { font-family: "Trebuchet MS", Verdana, sans-serif; margin: 0px; }
h1 { font-size: 1.2em; }
h2, h3 { font-size: 1.1em; }
a, a:link, a:visited { color: #2A5685;}
a:hover, a:active { color: #c61a1a; }
a.wiki-anchor { display: none; }
fieldset.attachments {border-width: 1px 0 0 0;}
hr {
width: 100%;
height: 1px;
background: #ccc;
border: 0;
}
span.footer {
font-size: 0.8em;
font-style: italic;
}
</style>
</head>
<body>
Issue #2825 has been updated by Peter Cock.
<ul>
<li><strong>Description</strong> updated (<a title="View differences" href="https://redmine.open-bio.org/journals/diff/15391?detail_id=1724">diff</a>)</li>
<li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li>
<li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li>
</ul>
<p>I think this was fixed a while back with this commit:</p>
<p><a class="external" href="https://github.com/biopython/biopython/commit/82a410fedccc67c4ab01eb76b0d91e6d14edd29b">https://github.com/biopython/biopython/commit/82a410fedccc67c4ab01eb76b0d91e6d14edd29b</a></p>
<hr />
<h1><a href="https://redmine.open-bio.org/issues/2825#change-15391">Bug #2825: Parsing whole genome sequencing (WGS) Genbank records</a></h1>
<ul><li>Author: David Wyllie</li>
<li>Status: Resolved</li>
<li>Priority: Normal</li>
<li>Assignee: Biopython Dev Mailing List</li>
<li>Category: Main Distribution</li>
<li>Target version: 1.49</li>
<li>URL: </li></ul>
<p>Hi</p>
<p>I'm using the BioPython distribution 1.49 obtained as a Package using the Ubuntu 9 synaptic package manager. The below describes the problem:</p>
<p>NCBI has a record type which describes the contents of whole-genome sequencing projects. The record doesn't itself contain sequence, by constrast to most genbank records.</p>
<p>this URL gives an example<br /><a class="external" href="http://www.ncbi.nlm.nih.gov/nuccore/162285818">http://www.ncbi.nlm.nih.gov/nuccore/162285818</a><br />should the SeqIO parser be able to read this? it cannot. Here is an example:</p>
<ol>
<li>import modules<br />from Bio import Entrez<br />from Bio import SeqIO</li>
</ol>
<ol>
<li>read the record from NCBI, print out the contents.<br />handle = Entrez.efetch(db="nucleotide", rettype="gb", id="162285818")<br />masterrecord=handle.readlines()<br />for line in masterrecord:<br /> print line<br />handle.close()</li>
</ol>
<ol>
<li>let's read it again, and try to parse with with SeqIO.<br />handle = Entrez.efetch(db="nucleotide", rettype="gb", id="162285818")</li>
</ol>
<ol>
<li>this line causes the crash<br />seq_record = SeqIO.read(handle, "genbank")</li>
</ol>
<p>handle.close()</p>
<ol>
<li>fails. the traceback reads<br />""" <br />Traceback (most recent call last):<br /> File "bugreport.py", line 25, in <module><br /> seq_record = SeqIO.read(handle, "genbank")<br /> File "/var/lib/python-support/python2.6/Bio/SeqIO/__init__.py", line 435, in read<br /> first = iterator.next()<br /> File "/var/lib/python-support/python2.6/Bio/GenBank/Scanner.py", line 410, in parse_records<br /> record = self.parse(handle)<br /> File "/var/lib/python-support/python2.6/Bio/GenBank/Scanner.py", line 393, in parse<br /> if self.feed(handle, consumer) :<br /> File "/var/lib/python-support/python2.6/Bio/GenBank/Scanner.py", line 360, in feed<br /> self._feed_first_line(consumer, self.line)<br /> File "/var/lib/python-support/python2.6/Bio/GenBank/Scanner.py", line 907, in _feed_first_line<br /> raise ValueError('Did not recognise the LOCUS line layout:\n' + line)<br />ValueError: Did not recognise the LOCUS line layout:<br />LOCUS ABIN010000!
00 353 rc DNA linear BCT 10-DEC-2007<br />"""</li>
</ol>
<ol>
<li>by contrast, reading one of the constituent genbank records, like this one</li>
<li><a class="external" href="http://www.ncbi.nlm.nih.gov/nuccore/162285817">http://www.ncbi.nlm.nih.gov/nuccore/162285817</a></li>
<li>works correctly;</li>
</ol>
<p>handle = Entrez.efetch(db="nucleotide", rettype="gb", id="162285817")<br />seq_record = SeqIO.read(handle, "genbank")<br />handle.close()<br />print "Successfully loaded record GI=162285817" <br />print seq_record.description</p>
<hr />
<span class="footer"><p>You have received this notification because you have either subscribed to it, or are involved in it.<br />To change your notification preferences, please click here and login: <a class="external" href="http://redmine.open-bio.org">http://redmine.open-bio.org</a></p></span>
</body>
</html>