Skip to content

Commit d0d8d86

Browse files
committed
Fixing tests after PDB v5 remediation
1 parent 700beba commit d0d8d86

6 files changed

Lines changed: 25 additions & 27 deletions

File tree

biojava-structure/src/test/java/org/biojava/nbio/structure/TestBond.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static void setUp() {
5757
public void testStructConnModels() throws IOException, StructureException {
5858
Structure s = StructureIO.getStructure("1cdr");
5959
Group groupOne = s.getPolyChain("A",1).getGroupByPDB(new ResidueNumber("A", 18, ' '));
60-
Group groupTwo = s.getPolyChain("B",1).getGroupByPDB(new ResidueNumber("A", 78, ' '));
60+
Group groupTwo = s.getNonPolyChain("B",1).getGroupByPDB(new ResidueNumber("A", 78, ' '));
6161
Atom atomOne = groupOne.getAtom("ND2");
6262
Atom atomTwo = groupTwo.getAtom("C1");
6363
assertTrue(areBonded(atomOne, atomTwo));

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ public void test2BI6() throws IOException, StructureException {
117117

118118
assertTrue(sCif.isNmr());
119119

120-
assertTrue(sCif.getPDBHeader().getRevisionRecords().size() > 1);
120+
// no more revision records since v5 - JD 2017-07-13
121+
//assertTrue(sCif.getPDBHeader().getRevisionRecords().size() > 1);
121122

122123

123124
}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ public void test5LDH() throws IOException, StructureException{
5555
// thus we can't test here the comparison between the 2
5656
//testID("5LDH",2, 2);
5757

58-
// in 5ldh there's also PAU and XAU but those are ignored, see github issue #230
59-
58+
// since v5 remediation there's 4 bioassemblies with numerical ids for 5ldh, no more PAU and XAU
6059
boolean gotException = false;
6160
try {
6261
AtomCache cache = new AtomCache();
@@ -67,7 +66,7 @@ public void test5LDH() throws IOException, StructureException{
6766
gotException = true;
6867
}
6968

70-
assertTrue("Bioassembly 3 for PDB id 5LDH should fail with a StructureException!", gotException);
69+
assertTrue("Bioassembly 3 for PDB id 5LDH should fail with a StructureException!", !gotException);
7170

7271
// bioassembly 2 does exist in mmcif file, let's check that
7372
gotException = false;
@@ -102,7 +101,7 @@ public void test1EI7() throws IOException, StructureException {
102101

103102
@Test
104103
public void testGetNrBioAssemblies5LDH() throws IOException, StructureException {
105-
assertEquals("There should be only 2 bioassemblies for 5LDH, see github issue #230", 2, StructureIO.getBiologicalAssemblies("5LDH").size());
104+
assertEquals("There should be 4 bioassemblies for 5LDH, see github issue #230", 4, StructureIO.getBiologicalAssemblies("5LDH").size());
106105
}
107106

108107

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void test2W6E() throws IOException, StructureException {
5555

5656

5757
// we can only compare titles by first forcing lower case, since the cases don't coincide cif vs pdb
58-
assertEquals(sPdb.getPDBHeader().getTitle().toLowerCase(),sCif.getPDBHeader().getTitle().toLowerCase());
58+
assertEquals(sPdb.getPDBHeader().getTitle().toLowerCase().replace(" ", ""), sCif.getPDBHeader().getTitle().toLowerCase().replace(" ", ""));
5959

6060
assertEquals(1, sPdb.getPDBHeader().getExperimentalTechniques().size());
6161
assertEquals(1, sCif.getPDBHeader().getExperimentalTechniques().size());

biojava-structure/src/test/java/org/biojava/nbio/structure/io/mmcif/TestEntityNameAndType.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
*/
2020
public class TestEntityNameAndType {
2121

22-
@Test
23-
/**
24-
*
25-
*/
22+
@Test
2623
public void testEntityId() throws IOException, StructureException {
2724

2825
// Set up the atom cache to parse on Internal chain id
@@ -37,7 +34,7 @@ public void testEntityId() throws IOException, StructureException {
3734
StructureIO.setAtomCache(cache);
3835
// This is hte information we want to test against
3936
String[] typeInformation = new String[] {"POLYMER", "NONPOLYMER", "NONPOLYMER", "NONPOLYMER", "NONPOLYMER", "WATER"};
40-
String[] descriptionInformation = new String[] {"BROMODOMAIN ADJACENT TO ZINC FINGER DOMAIN PROTEIN 2B","4-FLUOROBENZAMIDOXIME", "METHANOL", "METHANOL", "METHANOL", "water"};
37+
String[] descriptionInformation = new String[] {"BROMODOMAIN ADJACENT TO ZINC FINGER DOMAIN PROTEIN 2B","4-Fluorobenzamidoxime", "METHANOL", "METHANOL", "METHANOL", "water"};
4138

4239
// Now some other information fields to test this data is collated correctly
4340
String[] geneSourceSciName = new String[] {"HOMO SAPIENS", null, null, null, null, null};
@@ -74,8 +71,8 @@ public void testEntityId() throws IOException, StructureException {
7471
chainCounter++;
7572
}
7673
// Now check they're both the same
77-
assertArrayEquals(testDescInfo, descriptionInformation);
78-
assertArrayEquals(testTypeInfo, typeInformation);
74+
assertArrayEquals(descriptionInformation, testDescInfo);
75+
assertArrayEquals(typeInformation, testTypeInfo);
7976
// Now check these work too
8077
assertArrayEquals(geneSourceSciName, testGeneSourceSciName);
8178
assertArrayEquals(geneSourceTaxId, testGeneSourceTaxId);

biojava-structure/src/test/java/org/biojava/nbio/structure/io/mmcif/TestParseInternalChainId.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,27 @@ public void test2I13() throws IOException, StructureException {
5555
}
5656

5757

58-
assertTrue(asymA.getId().equals("A"));
59-
assertTrue(asymA.getName().equals("C"));
58+
assertEquals("A", asymA.getId());
59+
assertEquals("C", asymA.getName());
6060

61-
assertTrue(asymB.getId().equals("B"));
62-
assertTrue(asymB.getName().equals("D"));
61+
assertEquals("B", asymB.getId());
62+
assertEquals("D", asymB.getName());
6363

64-
assertTrue(asymC.getId().equals("C"));
65-
assertTrue(asymC.getName().equals("E"));
64+
assertEquals("C", asymC.getId());
65+
assertEquals("E", asymC.getName());
6666

67-
assertTrue(asymD.getId().equals("D"));
68-
assertTrue(asymD.getName().equals("F"));
67+
assertEquals("D", asymD.getId());
68+
assertEquals("F", asymD.getName());
6969

70-
assertTrue(asymE.getId().equals("E"));
71-
assertTrue(asymE.getName().equals("A"));
70+
assertEquals("E", asymE.getId());
71+
assertEquals("A", asymE.getName());
7272

73-
assertTrue(asymF.getId().equals("F"));
74-
assertTrue(asymF.getName().equals("B"));
73+
assertEquals("F", asymF.getId());
74+
assertEquals("B", asymF.getName());
7575

7676
Chain chainG = s.getNonPolyChain("G");
77-
assertTrue(chainG.getName().equals("A"));
77+
// before mmcif v5, this used to be "A", now it's "C" - JD 2017-07-13
78+
assertEquals("C", chainG.getName());
7879

7980
}
8081

0 commit comments

Comments
 (0)