[Biojava-l] PDBFileParser Error for PDB files without ATOM part for some chains defined in the header
Guoying Qi
gqi at ebi.ac.uk
Wed Sep 16 09:59:48 UTC 2015
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 <mailto: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-l/attachments/20150916/2d9fd6ea/attachment-0001.html>
More information about the Biojava-l
mailing list