Skip to content

Commit 0fd9898

Browse files
committed
Updated test becuase we now consider non-polymeric compounds
1 parent 07e1b1c commit 0fd9898

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

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

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
import java.io.IOException;
3636

37+
import static org.junit.Assert.assertEquals;
3738
import static org.junit.Assert.assertNotNull;
3839
import static org.junit.Assert.assertTrue;
3940

@@ -54,46 +55,56 @@ public static void setUp() throws Exception {
5455
public void test1STP() throws IOException, StructureException{
5556
String pdbId = "1stp";
5657

57-
checkPDB(pdbId);
58+
checkPDB(pdbId, "1895");
5859

5960
}
6061

6162
// removed this test, since entity 3 of 1a4w has no organism tax_id
6263
public void test1a4w() throws IOException, StructureException{
6364
String pdbId = "1a4w";
6465

65-
checkPDB(pdbId);
66+
checkPDB(pdbId, "9606");
6667

6768
}
6869

6970
@Test
7071
public void test4hhb() throws IOException, StructureException{
7172
String pdbId = "4hhb";
7273

73-
checkPDB(pdbId);
74+
checkPDB(pdbId, "9606");
7475

7576
}
7677

7778
@Test
7879
public void test3ZD6() throws IOException, StructureException {
7980
// a PDB ID that contains a synthetic entity
80-
String pdbId = "3ZD6";
81+
String pdbId = "3zd6";
8182

82-
checkPDB(pdbId);
83+
checkPDB(pdbId, "9606");
8384

8485
}
8586

8687

8788

8889

89-
private void checkPDB(String pdbId) throws IOException, StructureException {
90+
private void checkPDB(String pdbId, String organismTaxId) throws IOException, StructureException {
9091
Structure s = StructureIO.getStructure(pdbId);
9192

9293
assertNotNull(s.getEntityInformation());
9394
assertTrue(s.getEntityInformation().size() > 0);
9495

9596
for ( EntityInfo c : s.getEntityInformation()) {
96-
assertNotNull(c.getOrganismTaxId());
97+
if(c.getType().equals("polymer")) {
98+
assertNotNull(c.getOrganismTaxId());
99+
if(pdbId.equals("3zd6")){
100+
if(c.getMolId()==2) {
101+
assertEquals(c.getOrganismTaxId(), "32630");
102+
continue;
103+
}
104+
}
105+
assertEquals(c.getOrganismTaxId(), organismTaxId);
106+
107+
}
97108
}
98109

99110
}

0 commit comments

Comments
 (0)