Skip to content

Commit 5b600eb

Browse files
committed
Test and fix for biojava#767
1 parent b821226 commit 5b600eb

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ private static TreeMap<String,EntityInfo> findEntitiesFromAlignment(List<List<Ch
375375
EntityInfo ent = new EntityInfo();
376376
ent.addChain(c);
377377
ent.setMolId(molId++);
378+
ent.setType(EntityType.POLYMER);
378379
c.setEntityInfo(ent);
379380

380381
chainIds2entities.put(c.getId(),ent);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,11 @@ public void test2M7Y() throws IOException {
180180
// single-model NMR entry, thus:
181181
//assertTrue(s.isNmr()); // we can't detect it properly, because it's single model!
182182
assertFalse(s.isCrystallographic()); // at least this we can detect from the unreasonable crystal cell
183-
assertTrue(s.nrModels()==1);
183+
assertEquals(1, s.nrModels());
184184
assertNull(s.getPDBHeader().getExperimentalTechniques());
185+
186+
// testing that on single chain pdb files we assign an entity type, issue #767
187+
assertEquals(EntityType.POLYMER, s.getEntityById(1).getType());
185188
}
186189

187190
private void checkChains(Structure s) {
@@ -427,7 +430,6 @@ public void testCryst1Parsing() throws IOException {
427430
assertEquals("P 1", s.getPDBHeader().getCrystallographicInfo().getSpaceGroup().getShortSymbol());
428431
}
429432

430-
431433
private static int[] countEntityTypes(List<EntityInfo> entities) {
432434
int countPoly = 0;
433435
int countNonPoly = 0;

0 commit comments

Comments
 (0)