[Biojava-dev] PDBFileParser Error for PDB files without ATOM part for some chains defined in the header
Andreas Prlic
andreas at sdsc.edu
Thu Sep 17 00:38:05 UTC 2015
Thanks Guoying, I could reproduce this now. I committed a junit test for
this and a fix to the latest code base
https://github.com/biojava/biojava/issues/326
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's the data...
Andreas
On Wed, Sep 16, 2015 at 2:59 AM, Guoying Qi <gqi at ebi.ac.uk> wrote:
> HI Andreas,
>
> I am trying to read a local copy of PDB file.
>
> Here is the code.
>
> Thanks.
>
> Guoying
>
> String pdbFileName = "testdata/test/pdb/pdb2ja5.ent";
>
> FileParsingParameters fileParsingParameters = new
> FileParsingParameters();
> fileParsingParameters.setStoreEmptySeqRes(true);
> fileParsingParameters.setLoadChemCompInfo(false);
> fileParsingParameters.setHeaderOnly(true);
>
> PDBFileParser parser = new PDBFileParser();
> parser.setFileParsingParameters(fileParsingParameters);
>
>
> BufferedReader pdbFileReader = new BufferedReader(new FileReader(
> pdbFileName));
> Structure structure1 = parser.parsePDBFile(pdbFileReader);
>
>
> System.out.println("***\n" + structure1 + "****\n");
>
> PDBFileReader pdbreader = new PDBFileReader();
> pdbreader.setFileParsingParameters(fileParsingParameters);
> Structure structure2 = pdbreader.getStructure(pdbFileName);
>
> System.out.println("***\n" + structure2 + "****\n");
>
>
> On 16 Sep 2015, at 01:52, Andreas Prlic <andreas at sdsc.edu> wrote:
>
> Hi Guoying,
>
> Can you share the code and the exact FileParsingParameters that you are
> using to parse your file?
>
> 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.
>
> Having said that, your exception is a NullpointerException and at least
> with the code below I don't get that...
>
> FileParsingParameters params = new FileParsingParameters();
> params.setStoreEmptySeqRes(true);
>
> AtomCache cache = new AtomCache();
> cache.setUseMmCif(false);
> cache.setFileParsingParams(params);
>
> StructureIO.setAtomCache(cache);
>
> Structure bioAssembly = StructureIO.getBiologicalAssembly("2ja5",1);
>
>
> Andreas
>
>
>
>
> On Tue, Sep 15, 2015 at 3:21 AM, Guoying Qi <gqi at ebi.ac.uk> wrote:
>
>> Hi there,
>> 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 StoreEmptySeqRes is on.
>>
>> I am sure the parser should cope with this kind of issues.
>>
>> Could somebody have a look?
>>
>> Thanks.
>>
>> Guoying
>>
>>
>> Exception in thread "main" java.lang.NullPointerException
>>
>> at org.biojava.nbio.structure.io.PDBFileParser.storeUnAlignedSeqRes(
>> PDBFileParser.java:3026)
>>
>> at org.biojava.nbio.structure.io.PDBFileParser.triggerEndFileChecks(
>> PDBFileParser.java:2973)
>>
>> at org.biojava.nbio.structure.io.PDBFileParser.parsePDBFile(
>> PDBFileParser.java:2769)
>>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biojava-dev/attachments/20150916/da2a5b7c/attachment.html>
More information about the biojava-dev
mailing list