Skip to content

Commit 2927b32

Browse files
committed
Fix StructureToolsTest to pass according to changes
1 parent edb9e73 commit 2927b32

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/StructureToolsTest.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,7 @@ protected void setUp() throws IOException
4444
InputStream inStream = this.getClass().getResourceAsStream("/5pti.pdb");
4545
assertNotNull(inStream);
4646

47-
4847
PDBFileParser pdbpars = new PDBFileParser();
49-
FileParsingParameters params = new FileParsingParameters();
50-
params.setAlignSeqRes(false);
51-
params.setLoadChemCompInfo(false);
52-
53-
pdbpars.setFileParsingParameters(params);
5448

5549
structure = pdbpars.parsePDBFile(inStream) ;
5650

@@ -96,6 +90,10 @@ public void testGetCAAtoms(){
9690

9791
public void testGetAtomsConsistency() throws IOException, StructureException{
9892
AtomCache cache = new AtomCache();
93+
FileParsingParameters params = new FileParsingParameters();
94+
params.setLoadChemCompInfo(true);
95+
cache.setFileParsingParams(params);
96+
9997
Structure hivA = cache.getStructure("1hiv.A");
10098
Atom[] caSa = StructureTools.getRepresentativeAtomArray(hivA);
10199
Atom[] caCa = StructureTools.getRepresentativeAtomArray(hivA.getChain(0));
@@ -110,6 +108,7 @@ public void testGetAtomsConsistency() throws IOException, StructureException{
110108
assertEquals(caSa.length,99);
111109
assertEquals("did not find the same number of Atoms in both chains...",
112110
caSa.length,caCb.length);
111+
assertEquals(caSa.length, 99);
113112
}
114113

115114
public void testGetNrAtoms(){
@@ -430,8 +429,16 @@ public void testCAmmCIF() throws StructureException {
430429
//mmCIF files left justify their atom names (eg "CA "), so can have different behavior
431430
AtomCache pdbCache = new AtomCache();
432431
pdbCache.setUseMmCif(false);
432+
FileParsingParameters params = new FileParsingParameters();
433+
params.setLoadChemCompInfo(true);
434+
pdbCache.setFileParsingParams(params);
435+
433436
AtomCache mmcifCache = new AtomCache();
434437
mmcifCache.setUseMmCif(true);
438+
FileParsingParameters params2 = new FileParsingParameters();
439+
params2.setLoadChemCompInfo(true);
440+
mmcifCache.setFileParsingParams(params2);
441+
435442

436443
Structure pdb=null, mmcif=null;
437444

biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,7 @@ public static final Atom[] getRepresentativeAtomArray(Chain c) {
613613
}
614614
}
615615
else {
616-
if (ResidueType.lPeptideLinking.equals(cc.getResidueType()) ||
617-
PolymerType.PROTEIN_ONLY.contains(cc.getPolymerType())){
616+
if (PolymerType.PROTEIN_ONLY.contains(cc.getPolymerType())){
618617

619618
if (g.hasAtom(CA_ATOM_NAME) && g.getAtom(CA_ATOM_NAME).getElement()==Element.C) {
620619
atoms.add(g.getAtom(CA_ATOM_NAME));

0 commit comments

Comments
 (0)