Skip to content

Commit 276e5cc

Browse files
committed
A fix for biojava#708
1 parent b2555f6 commit 276e5cc

File tree

6 files changed

+9
-31
lines changed

6 files changed

+9
-31
lines changed

biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/symmetry/TestQuatSymmetryDetectorExamples.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,13 @@ public void testDihedral() throws IOException, StructureException {
8787
// D3 symmetry non pseudosymmetric
8888
assertEquals("D3", symmetry.getSymmetry());
8989
assertEquals("A6B6", symmetry.getStoichiometry());
90+
assertFalse(symmetry.isPseudoStoichiometric());
91+
9092

9193
}
9294

9395
/**
9496
* Hemoglobin has both symmetry and pseudosymmetry: 4HHB
95-
* TODO pseudosymmetry in hemoglobin fails
9697
*
9798
* @throws StructureException
9899
* @throws IOException
@@ -121,6 +122,7 @@ public void testPseudosymmetry() throws IOException, StructureException {
121122
// D2 pseudo-symmetry
122123
assertEquals("D2", symmetry.getSymmetry());
123124
assertEquals("A4", symmetry.getStoichiometry());
125+
assertTrue(symmetry.isPseudoStoichiometric());
124126
}
125127

126128
/**

biojava-structure-gui/src/main/java/demo/DemoQuatSymmetryJmol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private static void showResults(Structure s, String name,
9494
String title = name + ": " + results.getStoichiometry()
9595
+ ", " + results.getSymmetry();
9696

97-
if (results.isPseudosymmetric())
97+
if (results.isPseudoStoichiometric())
9898
title += ", pseudosymmetric";
9999

100100
if (results.isLocal())

biojava-structure/src/main/java/demo/DemoSymmetry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private static void findQuatSym(Structure bioAssembly) throws StructureException
4545

4646

4747

48-
System.out.println(globalResults.getSymmetry() + (globalResults.isPseudosymmetric()?"(pseudo)":""));
48+
System.out.println(globalResults.getSymmetry() + (globalResults.isPseudoStoichiometric()?"(pseudo)":""));
4949

5050
System.out.println("There are "+globalResults.getSubunitClusters().size()+" subunit clusters");
5151
int i = 1;
@@ -68,7 +68,7 @@ private static void findQuatSym(Structure bioAssembly) throws StructureException
6868

6969

7070

71-
System.out.println(globalResults.getSymmetry() + (globalResults.isPseudosymmetric()?"(pseudo)":""));
71+
System.out.println(globalResults.getSymmetry() + (globalResults.isPseudoStoichiometric()?"(pseudo)":""));
7272

7373
System.out.println("There are "+globalResults.getSubunitClusters().size()+" subunit clusters");
7474
i = 1;

biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitClusterUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static String getStoichiometryString(List<SubunitCluster> clusters) {
5656

5757
/**
5858
* A pseudostoichiometric {@link SubunitCluster} was obtained using the
59-
* {@link SubunitClustererMethod#STRUCTURE} similarity.
59+
* {@link SubunitClustererMethod#STRUCTURE} or {@link SubunitClustererMethod#SEQUENCE} similarity.
6060
*
6161
* @param clusters
6262
* @return true if any of the clusters is pseudostoichiometric, false
@@ -65,7 +65,8 @@ public static String getStoichiometryString(List<SubunitCluster> clusters) {
6565
public static boolean isPseudoStoichiometric(List<SubunitCluster> clusters) {
6666

6767
for (SubunitCluster c : clusters) {
68-
if (c.getClustererMethod() == SubunitClustererMethod.STRUCTURE)
68+
if (c.getClustererMethod() == SubunitClustererMethod.STRUCTURE ||
69+
c.getClustererMethod() == SubunitClustererMethod.SEQUENCE)
6970
return true;
7071
}
7172
return false;

biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryDetector.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,6 @@ private static QuatSymmetryResults calcQuatSymmetry(
282282

283283
String symmetry = results.getSymmetry();
284284

285-
// asymmetric structures cannot be pseudosymmetric
286-
if (symmetry.equals("C1"))
287-
results.setPseudosymmetric(false);
288-
289285
// Check structures with Cn symmetry (n = 1, ...) for helical symmetry
290286
if (symmetry.startsWith("C")) {
291287
HelixSolver hc = new HelixSolver(subunits,

biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryResults.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public class QuatSymmetryResults {
5656
private SymmetryPerceptionMethod method;
5757
private RotationGroup rotationGroup;
5858
private HelixLayers helixLayers;
59-
private boolean pseudosymmetric = false;
6059

6160
// TODO we should unify rotational and roto-translational results
6261

@@ -210,26 +209,6 @@ void setLocal(boolean local) {
210209
this.local = local;
211210
}
212211

213-
/**
214-
* A symmetry result is pseudosymmetric when using pseudostoichiometry
215-
* extended the symmetry over the
216-
*
217-
* @return true is pseudosymmetric, false otherwise
218-
*/
219-
public boolean isPseudosymmetric() {
220-
return pseudosymmetric;
221-
}
222-
223-
/**
224-
* A symmetry result is pseudosymmetric when using pseudostoichiometry
225-
* extended the symmetry over the
226-
*
227-
* @param pseudosymmetric true if pseudosymmetric, false otherwise
228-
*/
229-
public void setPseudosymmetric(boolean pseudosymmetric) {
230-
this.pseudosymmetric = pseudosymmetric;
231-
}
232-
233212
public Structure getStructure() {
234213
return structure;
235214
}

0 commit comments

Comments
 (0)