<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 #2626 has been updated by Lenna Peterson.
<ul>
<li><strong>Description</strong> updated (<a title="View differences" href="https://redmine.open-bio.org/journals/diff/15366?detail_id=1666">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>Still failing. Migrated to github:</p>
<p><a class="external" href="https://github.com/biopython/biopython/issues/990">https://github.com/biopython/biopython/issues/990</a></p>
<hr />
<h1><a href="https://redmine.open-bio.org/issues/2626#change-15366">Bug #2626: Bio.PDB mmCIFParser parse exceptions</a></h1>
<ul><li>Author: Chris Oldfield</li>
<li>Status: Resolved</li>
<li>Priority: Normal</li>
<li>Assignee: Biopython Dev Mailing List</li>
<li>Category: Other</li>
<li>Target version: 1.48</li>
<li>URL: </li></ul>
<p>I recently ran the mmCIFParser object over all of PDB's mmCIF files and found a large number of files failed to parse correctly (a short script at the end to demonstrate). Of ~50k mmCIF files, 3891 files failed to parse and another 1980 were missing fields in the mmCIF dictionary.</p>
<p>A few examples of files that failed to parse: <br /><a class="external" href="http://www.rcsb.org/pdb/files/1alw.cif.gz">http://www.rcsb.org/pdb/files/1alw.cif.gz</a><br /><a class="external" href="http://www.rcsb.org/pdb/files/1det.cif.gz">http://www.rcsb.org/pdb/files/1det.cif.gz</a><br /><a class="external" href="http://www.rcsb.org/pdb/files/1tmy.cif.gz">http://www.rcsb.org/pdb/files/1tmy.cif.gz</a></p>
<p>A few with missing fields:<br /><a class="external" href="http://www.rcsb.org/pdb/files/1mfl.cif.gz">http://www.rcsb.org/pdb/files/1mfl.cif.gz</a><br /><a class="external" href="http://www.rcsb.org/pdb/files/1tfj.cif.gz">http://www.rcsb.org/pdb/files/1tfj.cif.gz</a><br /><a class="external" href="http://www.rcsb.org/pdb/files/1zn8.cif.gz">http://www.rcsb.org/pdb/files/1zn8.cif.gz</a></p>
<p>The problem seems to be that an error in one mmCIF table, like an extra field, seems to propogate through the rest of the parse.</p>
<p>x86_64 gentoo linux 2008, src BioPython install</p>
<p><i>CODE</i><br />import sys<br />from Bio.PDB import *</p>
<p>if len(sys.argv) != 2:<br /> print "usage: mmCifParseCheck.py <structFile>" <br /> sys.exit(0)<br />structFile = sys.argv<sup><a href="#fn1">1</a></sup></p>
<p>resultString = "";</p>
<p>#parse to structure object<br />numRes = 0<br />parser=MMCIFParser()<br />try:<br /> structure=parser.get_structure('test',structFile)<br /> for model in structure:<br /> for chain in model:<br /> for residue in chain:<br /> if(residue.id<sup><a href="#fn0">0</a></sup>[:2] != "H_"):<br /> numRes += 1<br />except:<br /> resultString += "parse to structure object failed\n";<br />else:<br /> resultString += "parse to structure object succeeded\n";</p>
<p>#parse whole mmCIF file to dict<br />try:<br /> mmcif_dict=MMCIF2Dict.MMCIF2Dict(structFile)<br />except:<br /> resultString += "parse to dict failed\n";<br />else:<br /> resultString += "parse to dict succeeded\n";</p>
<p>#get a required entry<br />try:<br /> id = mmcif_dict['_entry.id']<br />except:<br /> resultString += "key lookup failed\n";<br />else:<br /> resultString += "key lookup succeeded\n";</p>
<p>print resultString<br />print "number of non-het residues " + str(numRes)</p>
<fieldset class="attachments"><legend>Files</legend>
<a href="https://redmine.open-bio.org/attachments/download/1708/mmCifParseCheck.py">mmCifParseCheck.py</a>
(1021 Bytes)<br />
</fieldset>
<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>