<div dir="ltr">Thanks Guoying, I could reproduce this now. I committed a junit test for this and a fix to the latest code base <div><br></div><div><a href="https://github.com/biojava/biojava/issues/326">https://github.com/biojava/biojava/issues/326</a><br></div><div><br></div><div>If you update your checkout (assuming you are on the latest snapshot version), you should be able to parse this file using your parameters. You will still see some logging about chain N missing, but that&#39;s the data...</div><div><br></div><div>Andreas</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 16, 2015 at 2:59 AM, Guoying Qi <span dir="ltr">&lt;<a href="mailto:gqi@ebi.ac.uk" target="_blank">gqi@ebi.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>HI Andreas,</div><div><br></div><div>I am trying to read a local copy of PDB file.</div><div><br></div><div>Here is the code.</div><div><br></div><div>Thanks.</div><div><br></div><div>Guoying</div><div><br></div><div><div style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(57,51,255)"><span style="color:rgb(0,0,0)">        String </span><span style="color:rgb(126,80,79)">pdbFileName</span><span style="color:rgb(0,0,0)"> = </span>&quot;testdata/test/pdb/pdb2ja5.ent&quot;<span style="color:rgb(0,0,0)">;</span></div><div style="margin:0px;font-size:11px;font-family:Monaco;min-height:15px"><br></div><div style="margin:0px;font-size:11px;font-family:Monaco">        FileParsingParameters <span style="color:rgb(126,80,79)">fileParsingParameters</span> = <span style="color:rgb(147,26,104)">new</span> FileParsingParameters();</div><div style="margin:0px;font-size:11px;font-family:Monaco">        <span style="color:rgb(126,80,79)">fileParsingParameters</span>.setStoreEmptySeqRes(<span style="color:rgb(147,26,104)">true</span>);</div><div style="margin:0px;font-size:11px;font-family:Monaco">        <span style="color:rgb(126,80,79)">fileParsingParameters</span>.setLoadChemCompInfo(<span style="color:rgb(147,26,104)">false</span>);</div><div style="margin:0px;font-size:11px;font-family:Monaco">        <span style="color:rgb(126,80,79)">fileParsingParameters</span>.setHeaderOnly(<span style="color:rgb(147,26,104)">true</span>);</div><div style="margin:0px;font-size:11px;font-family:Monaco;min-height:15px"><br></div><div style="margin:0px;font-size:11px;font-family:Monaco">        PDBFileParser <span style="color:rgb(126,80,79)">parser</span> = <span style="color:rgb(147,26,104)">new</span> PDBFileParser();</div><div style="margin:0px;font-size:11px;font-family:Monaco">        <span style="color:rgb(126,80,79)">parser</span>.setFileParsingParameters(<span style="color:rgb(126,80,79)">fileParsingParameters</span>);</div><p style="margin:0px;font-size:11px;font-family:Monaco;min-height:15px">        <br></p><div style="margin:0px;font-size:11px;font-family:Monaco">        BufferedReader <span style="color:rgb(126,80,79)">pdbFileReader</span> = <span style="color:rgb(147,26,104)">new</span> BufferedReader(<span style="color:rgb(147,26,104)">new</span> FileReader(<span style="color:rgb(126,80,79)">pdbFileName</span>));</div><div style="margin:0px;font-size:11px;font-family:Monaco">        Structure <span style="color:rgb(126,80,79)">structure1</span> = <span style="color:rgb(126,80,79)">parser</span>.parsePDBFile(<span style="color:rgb(126,80,79)">pdbFileReader</span>);</div><p style="margin:0px;font-size:11px;font-family:Monaco;min-height:15px">        <br></p><div style="margin:0px;font-size:11px;font-family:Monaco">        System.<span style="color:rgb(3,38,204)">out</span>.println(<span style="color:rgb(57,51,255)">&quot;***\n&quot;</span> + <span style="color:rgb(126,80,79)">structure1</span> + <span style="color:rgb(57,51,255)">&quot;****\n&quot;</span>);</div><div style="margin:0px;font-size:11px;font-family:Monaco;min-height:15px"><br></div><div style="margin:0px;font-size:11px;font-family:Monaco">        PDBFileReader <span style="color:rgb(126,80,79)">pdbreader</span> = <span style="color:rgb(147,26,104)">new</span> PDBFileReader();</div><div style="margin:0px;font-size:11px;font-family:Monaco">        <span style="color:rgb(126,80,79)">pdbreader</span>.setFileParsingParameters(<span style="color:rgb(126,80,79)">fileParsingParameters</span>);</div><div style="margin:0px;font-size:11px;font-family:Monaco">        Structure <span style="color:rgb(126,80,79)">structure2</span> = <span style="color:rgb(126,80,79)">pdbreader</span>.getStructure(<span style="color:rgb(126,80,79)">pdbFileName</span>);</div><div style="margin:0px;font-size:11px;font-family:Monaco;min-height:15px"><br></div><div style="margin:0px;font-size:11px;font-family:Monaco">        System.<span style="color:rgb(3,38,204)">out</span>.println(<span style="color:rgb(57,51,255)">&quot;***\n&quot;</span> + <span style="color:rgb(126,80,79)">structure2</span> + <span style="color:rgb(57,51,255)">&quot;****\n&quot;</span>);</div></div><div><div class="h5"><div><br></div><br><div><blockquote type="cite"><div>On 16 Sep 2015, at 01:52, Andreas Prlic &lt;<a href="mailto:andreas@sdsc.edu" target="_blank">andreas@sdsc.edu</a>&gt; wrote:</div><br><div><div dir="ltr">Hi Guoying,<div><br></div><div>Can you share the code and the exact FileParsingParameters that you are using to parse your file? </div><div><br></div><div>2JA5 does not have coordinates for chain N. The following code still can parse out a structure object. BioJava complains, but with a different error message than you reported. The error message that I get seems like over-reporting from BioJava and it probably should be a warning, rather than an error. </div><div><br></div><div>Having said that, your exception is a NullpointerException and at least with the code below I don&#39;t get that...</div><div><br></div><div><pre style="font-family:Menlo;font-size:12pt">FileParsingParameters params = <span style="color:rgb(0,0,128);font-weight:bold">new </span>FileParsingParameters();<br>params.setStoreEmptySeqRes(<span style="color:rgb(0,0,128);font-weight:bold">true</span>);<br><br>AtomCache cache = <span style="color:rgb(0,0,128);font-weight:bold">new </span>AtomCache();<br>cache.setUseMmCif(<span style="color:rgb(0,0,128);font-weight:bold">false</span>);<br>cache.setFileParsingParams(params);<br><br>StructureIO.<span style="font-style:italic">setAtomCache</span>(cache);<br><br>Structure bioAssembly = StructureIO.<span style="font-style:italic">getBiologicalAssembly</span>(<span style="color:rgb(0,128,0);font-weight:bold">&quot;2ja5&quot;</span>,<span style="color:rgb(0,0,255)">1</span>);</pre></div><div><br></div><div>Andreas</div><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 15, 2015 at 3:21 AM, Guoying Qi <span dir="ltr">&lt;<a href="mailto:gqi@ebi.ac.uk" target="_blank">gqi@ebi.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small">Hi there,</p><div>I am using BioJava 4.1.0 and got the following error message for PDB 2ja5 when no ATOM for chain N, P and T when <span style="font-family:Monaco;font-size:11px">StoreEmptySeqRes is on.</span></div><div><span style="font-family:Monaco;font-size:11px"><br></span></div><div>I am sure the parser should cope with this kind of issues.</div><div><br></div><div>Could somebody have a look?</div><div><br></div><div>Thanks.</div><div><br></div><div>Guoying</div><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small"><span><br></span></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small"><span>Exception in thread &quot;main&quot; </span><span>java.lang.NullPointerException</span></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small"><span></span>at org.biojava.nbio.structure.io.PDBFileParser.storeUnAlignedSeqRes(<span>PDBFileParser.java:3026</span>)</p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small"><span></span>at org.biojava.nbio.structure.io.PDBFileParser.triggerEndFileChecks(<span>PDBFileParser.java:2973</span>)</p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small"><span></span>at org.biojava.nbio.structure.io.PDBFileParser.parsePDBFile(<span>PDBFileParser.java:2769</span>)</p></div></blockquote></div><br><br clear="all"><div><br></div>
</div></div>
</div></blockquote></div><br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>
</div></div>