Skip to content

Commit 89ac11a

Browse files
committed
Better rules for Quaternary symm self-alignments
Don't allow subunits to be aligned to themselves (except for the identity alignment).
1 parent feb9852 commit 89ac11a

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private void solve() {
9595

9696
List<Double> angles = getAngles();
9797

98-
for (int i = 0; i < sphereCount; i++) {
98+
for (int i = 0; i < sphereCount; i++) {
9999
SphereSampler.getAxisAngle(i, sphereAngle);
100100

101101
for (double angle : angles) {
@@ -225,25 +225,21 @@ private boolean isValidPermutation(List<Integer> permutation) {
225225
return false;
226226
}
227227

228-
// get fold and make sure there is only one E (fold=1) permutation
229-
int fold = PermutationGroup.getOrder(permutation);
230-
if (rotations.getOrder() > 1 && fold == 1) {
231-
return false;
232-
}
233-
234-
if (fold == 0 || subunits.getSubunitCount() % fold != 0) {
235-
return false;
236-
}
237-
238228
// if this permutation is a duplicate, returns false
239229
return hashCodes.add(permutation);
240230
}
241231

232+
/**
233+
* The permutation must map all subunits onto an equivalent subunit
234+
* and no subunit onto itself
235+
* @param permutation
236+
* @return
237+
*/
242238
private boolean isAllowedPermutation(List<Integer> permutation) {
243239
List<Integer> seqClusterId = subunits.getSequenceClusterIds();
244240
for (int i = 0; i < permutation.size(); i++) {
245241
int j = permutation.get(i);
246-
if (seqClusterId.get(i) != seqClusterId.get(j)) {
242+
if (i == j || seqClusterId.get(i) != seqClusterId.get(j)) {
247243
return false;
248244
}
249245
}

0 commit comments

Comments
 (0)