Skip to content

Commit 782e2f7

Browse files
committed
Adding some more non-deposited files tests, #305.
Also reverting mmcif parser to not remove purely non-poly chains. Like that it matches what the pdb parser does.
1 parent bec7990 commit 782e2f7

File tree

5 files changed

+69
-6
lines changed

5 files changed

+69
-6
lines changed

biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -753,11 +753,6 @@ public void documentEnd() {
753753
logger.warn("Chain with chain id {} (asym id {}) and {} residues, contains only waters. Will ignore the chain because it doesn't fit into the BioJava structure data model.",
754754
chain.getChainID(),chain.getInternalChainID(),chain.getAtomGroups().size());
755755
}
756-
else if (StructureTools.isChainPureNonPolymer(chain) ) {
757-
logger.warn("Chain with chain id {} (asym id {}) and {} residues, does not seem to be polymeric. Will ignore the chain because it doesn't fit into the BioJava structure data model.",
758-
chain.getChainID(),chain.getInternalChainID(),chain.getAtomGroups().size());
759-
it.remove();
760-
}
761756
}
762757
}
763758
}

biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestNonDepositedFiles.java

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private void checkChains(Structure s) {
195195
* @throws IOException
196196
*/
197197
@Test
198-
public void testPhenixFile() throws IOException {
198+
public void testPhenixCifFile() throws IOException {
199199
InputStream inStream = new GZIPInputStream(this.getClass().getResourceAsStream("/org/biojava/nbio/structure/io/4lup_phenix_output.cif.gz"));
200200
MMcifParser parser = new SimpleMMcifParser();
201201

@@ -215,6 +215,74 @@ public void testPhenixFile() throws IOException {
215215
assertNotNull(s);
216216

217217
assertTrue(s.isCrystallographic());
218+
219+
// all ligands are into their own chains, so we have 2 proteins, 2 nucleotide chains and 1 ligand chain
220+
assertEquals(5, s.getChains().size());
221+
222+
assertEquals(2, s.getCompounds().size());
223+
224+
}
225+
226+
@Test
227+
public void testPhenixPdbFile() throws IOException {
228+
InputStream inStream = new GZIPInputStream(this.getClass().getResourceAsStream("/org/biojava/nbio/structure/io/4lup_phenix_output.pdb.gz"));
229+
230+
PDBFileParser pdbpars = new PDBFileParser();
231+
FileParsingParameters params = new FileParsingParameters();
232+
params.setAlignSeqRes(true);
233+
pdbpars.setFileParsingParameters(params);
234+
235+
Structure s = pdbpars.parsePDBFile(inStream) ;
236+
237+
assertNotNull(s);
238+
239+
assertTrue(s.isCrystallographic());
240+
241+
// all ligands are into their own chains, so we have 2 proteins, 2 nucleotide chains and 1 ligand chain
242+
assertEquals(5, s.getChains().size());
243+
244+
assertEquals(2, s.getCompounds().size());
245+
}
246+
247+
@Test
248+
public void testPhaserPdbFile() throws IOException {
249+
InputStream inStream = new GZIPInputStream(this.getClass().getResourceAsStream("/org/biojava/nbio/structure/io/4lup_phaser_output.pdb.gz"));
250+
251+
PDBFileParser pdbpars = new PDBFileParser();
252+
FileParsingParameters params = new FileParsingParameters();
253+
params.setAlignSeqRes(true);
254+
pdbpars.setFileParsingParameters(params);
255+
256+
Structure s = pdbpars.parsePDBFile(inStream) ;
257+
258+
assertNotNull(s);
259+
260+
assertTrue(s.isCrystallographic());
261+
262+
assertEquals(2, s.getChains().size());
263+
264+
assertEquals(1, s.getCompounds().size());
265+
}
266+
267+
268+
@Test
269+
public void testRefmacPdbFile() throws IOException {
270+
InputStream inStream = new GZIPInputStream(this.getClass().getResourceAsStream("/org/biojava/nbio/structure/io/rnase_refmac_output.pdb.gz"));
271+
272+
PDBFileParser pdbpars = new PDBFileParser();
273+
FileParsingParameters params = new FileParsingParameters();
274+
params.setAlignSeqRes(true);
275+
pdbpars.setFileParsingParameters(params);
276+
277+
Structure s = pdbpars.parsePDBFile(inStream) ;
278+
279+
assertNotNull(s);
280+
281+
assertTrue(s.isCrystallographic());
282+
283+
assertEquals(2, s.getChains().size());
284+
285+
assertEquals(1, s.getCompounds().size());
218286
}
219287

220288
}
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)