<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">HI Andreas,</div><div class=""><br class=""></div><div class="">I am trying to read a local copy of PDB file.</div><div class=""><br class=""></div><div class="">Here is the code.</div><div class=""><br class=""></div><div class="">Thanks.</div><div class=""><br class=""></div><div class="">Guoying</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(57, 51, 255);" class=""><span style="color: #000000" class=""> String </span><span style="color: #7e504f" class="">pdbFileName</span><span style="color: #000000" class=""> = </span>"testdata/test/pdb/pdb2ja5.ent"<span style="color: #000000" class="">;</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> FileParsingParameters <span style="color: #7e504f" class="">fileParsingParameters</span> = <span style="color: #931a68" class="">new</span> FileParsingParameters();</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> <span style="color: #7e504f" class="">fileParsingParameters</span>.setStoreEmptySeqRes(<span style="color: #931a68" class="">true</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> <span style="color: #7e504f" class="">fileParsingParameters</span>.setLoadChemCompInfo(<span style="color: #931a68" class="">false</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> <span style="color: #7e504f" class="">fileParsingParameters</span>.setHeaderOnly(<span style="color: #931a68" class="">true</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> PDBFileParser <span style="color: #7e504f" class="">parser</span> = <span style="color: #931a68" class="">new</span> PDBFileParser();</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> <span style="color: #7e504f" class="">parser</span>.setFileParsingParameters(<span style="color: #7e504f" class="">fileParsingParameters</span>);</div><p style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> BufferedReader <span style="color: #7e504f" class="">pdbFileReader</span> = <span style="color: #931a68" class="">new</span> BufferedReader(<span style="color: #931a68" class="">new</span> FileReader(<span style="color: #7e504f" class="">pdbFileName</span>));</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> Structure <span style="color: #7e504f" class="">structure1</span> = <span style="color: #7e504f" class="">parser</span>.parsePDBFile(<span style="color: #7e504f" class="">pdbFileReader</span>);</div><p style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> System.<span style="color: #0326cc" class="">out</span>.println(<span style="color: #3933ff" class="">"***\n"</span> + <span style="color: #7e504f" class="">structure1</span> + <span style="color: #3933ff" class="">"****\n"</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> PDBFileReader <span style="color: #7e504f" class="">pdbreader</span> = <span style="color: #931a68" class="">new</span> PDBFileReader();</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> <span style="color: #7e504f" class="">pdbreader</span>.setFileParsingParameters(<span style="color: #7e504f" class="">fileParsingParameters</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> Structure <span style="color: #7e504f" class="">structure2</span> = <span style="color: #7e504f" class="">pdbreader</span>.getStructure(<span style="color: #7e504f" class="">pdbFileName</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;" class=""> System.<span style="color: #0326cc" class="">out</span>.println(<span style="color: #3933ff" class="">"***\n"</span> + <span style="color: #7e504f" class="">structure2</span> + <span style="color: #3933ff" class="">"****\n"</span>);</div></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 16 Sep 2015, at 01:52, Andreas Prlic <<a href="mailto:andreas@sdsc.edu" class="">andreas@sdsc.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Guoying,<div class=""><br class=""></div><div class="">Can you share the code and the exact FileParsingParameters that you are using to parse your file? </div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Having said that, your exception is a NullpointerException and at least with the code below I don't get that...</div><div class=""><br class=""></div><div class=""><pre style="font-family: Menlo; font-size: 12pt;" class="">FileParsingParameters params = <span style="color:rgb(0,0,128);font-weight:bold" class="">new </span>FileParsingParameters();<br class="">params.setStoreEmptySeqRes(<span style="color:rgb(0,0,128);font-weight:bold" class="">true</span>);<br class=""><br class="">AtomCache cache = <span style="color:rgb(0,0,128);font-weight:bold" class="">new </span>AtomCache();<br class="">cache.setUseMmCif(<span style="color:rgb(0,0,128);font-weight:bold" class="">false</span>);<br class="">cache.setFileParsingParams(params);<br class=""><br class="">StructureIO.<span style="font-style:italic" class="">setAtomCache</span>(cache);<br class=""><br class="">Structure bioAssembly = StructureIO.<span style="font-style:italic" class="">getBiologicalAssembly</span>(<span style="color:rgb(0,128,0);font-weight:bold" class="">"2ja5"</span>,<span style="color:rgb(0,0,255)" class="">1</span>);</pre></div><div class=""><br class=""></div><div class="">Andreas</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Sep 15, 2015 at 3:21 AM, Guoying Qi <span dir="ltr" class=""><<a href="mailto:gqi@ebi.ac.uk" target="_blank" class="">gqi@ebi.ac.uk</a>></span> wrote:<br class=""><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" class=""><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small" class="">Hi there,</p><div class="">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" class="">StoreEmptySeqRes is on.</span></div><div class=""><span style="font-family:Monaco;font-size:11px" class=""><br class=""></span></div><div class="">I am sure the parser should cope with this kind of issues.</div><div class=""><br class=""></div><div class="">Could somebody have a look?</div><div class=""><br class=""></div><div class="">Thanks.</div><div class=""><br class=""></div><div class="">Guoying</div><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small" class=""><span class=""><br class=""></span></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small" class=""><span class="">Exception in thread "main" </span><span class="">java.lang.NullPointerException</span></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small" class=""><span class=""></span>at org.biojava.nbio.structure.io.PDBFileParser.storeUnAlignedSeqRes(<span class="">PDBFileParser.java:3026</span>)</p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small" class=""><span class=""></span>at org.biojava.nbio.structure.io.PDBFileParser.triggerEndFileChecks(<span class="">PDBFileParser.java:2973</span>)</p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small" class=""><span class=""></span>at org.biojava.nbio.structure.io.PDBFileParser.parsePDBFile(<span class="">PDBFileParser.java:2769</span>)</p></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>
</div></div>
</div></blockquote></div><br class=""></body></html>