Skip to content

Commit 2bb0857

Browse files
authored
Merge pull request #794 from biocryst/stoichiometry
Biological assembly builder, transformation ordering fix
2 parents c7e12e1 + 82ca5fe commit 2bb0857

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/io/TestBioassemblies.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,11 @@ public void test4OPJ() throws IOException, StructureException {
145145
assertEquals(3, multiModelBioAssemblies.get(0).getPolyChains(0).size() + multiModelBioAssemblies.get(0).getPolyChains(1).size());
146146
// 3 chains in flattened structure in bioassembly 1
147147
assertEquals(3, flattenedBioAssemblies.get(0).getPolyChains().size());
148-
148+
149149
// 3 chains divided into 2 models in bioassembly 2
150-
assertEquals(3, multiModelBioAssemblies.get(1).getPolyChains(0).size() + multiModelBioAssemblies.get(0).getPolyChains(1).size());
150+
assertEquals(3, multiModelBioAssemblies.get(1).getPolyChains(0).size() + multiModelBioAssemblies.get(1).getPolyChains(1).size());
151151
// 3 chains in flattened structure in bioassembly 2
152152
assertEquals(3, flattenedBioAssemblies.get(1).getPolyChains().size());
153-
154153

155154
// chain ids and names don't contain underscores in multimodel
156155
for (int modelIdx = 0; modelIdx<multiModelBioAssemblies.get(0).nrModels(); modelIdx++) {

biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ public int compare(BiologicalAssemblyTransformation t1, BiologicalAssemblyTransf
144144
// set sort order only if the two ids are identical
145145
if (t1.getId().equals(t2.getId())) {
146146
return chainIds.indexOf(t1.getChainId()) - chainIds.indexOf(t2.getChainId());
147+
} else {
148+
return t1.getId().compareTo(t2.getId());
147149
}
148-
return 0;
149150
}
150151
});
151152
}

0 commit comments

Comments
 (0)