Skip to content

Commit 065624c

Browse files
committed
Final CeSymm display options before release
1 parent 3386f6b commit 065624c

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/gui/SymmetryDisplay.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ public static MultipleAlignmentJmol displayFull(CeSymmResult symm)
102102
public static AbstractAlignmentJmol display(CeSymmResult symmResult)
103103
throws StructureException {
104104

105-
if (symmResult.isRefined()) {
105+
if (symmResult.isSignificant() && symmResult.isRefined()) {
106+
// Show the structure colored by repeat
106107
MultipleAlignment msa = symmResult.getMultipleAlignment();
107108
List<Atom[]> atoms = msa.getAtomArrays();
108109
MultipleAlignmentJmol jmol = new MultipleAlignmentJmol(msa, atoms);
@@ -113,14 +114,16 @@ public static AbstractAlignmentJmol display(CeSymmResult symmResult)
113114
jmol.setTitle(getSymmTitle(symmResult));
114115
return jmol;
115116
} else {
116-
// Show the optimal alignment only if it was not refined
117+
// Show the optimal self-alignment
117118
Logger.info("Showing optimal self-alignment");
118119
Atom[] cloned = StructureTools
119120
.cloneAtomArray(symmResult.getAtoms());
120121
AbstractAlignmentJmol jmol = StructureAlignmentDisplay.display(
121122
symmResult.getSelfAlignment(), symmResult.getAtoms(),
122123
cloned);
123-
jmol.setTitle(jmol.getTitle() + " Optimal Self-Alignment");
124+
RotationAxis axis = new RotationAxis(symmResult.getSelfAlignment());
125+
jmol.evalString(axis.getJmolScript(symmResult.getAtoms()));
126+
jmol.setTitle(getSymmTitle(symmResult));
124127
return jmol;
125128
}
126129
}

biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/gui/SymmetryListener.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.biojava.nbio.structure.align.gui.StructureAlignmentDisplay;
2929
import org.biojava.nbio.structure.align.gui.jmol.AbstractAlignmentJmol;
3030
import org.biojava.nbio.structure.align.gui.jmol.MultipleAlignmentJmol;
31+
import org.biojava.nbio.structure.align.util.RotationAxis;
3132
import org.biojava.nbio.structure.symmetry.internal.CeSymmResult;
3233
import org.slf4j.Logger;
3334
import org.slf4j.LoggerFactory;
@@ -77,7 +78,9 @@ public void actionPerformed(ActionEvent ae) {
7778
Atom[] cloned = StructureTools.cloneAtomArray(symm.getAtoms());
7879
AbstractAlignmentJmol jmol = StructureAlignmentDisplay.display(
7980
symm.getSelfAlignment(), symm.getAtoms(), cloned);
80-
jmol.setTitle(jmol.getTitle() + " Optimal Self-Alignment");
81+
RotationAxis axis = new RotationAxis(symm.getSelfAlignment());
82+
jmol.evalString(axis.getJmolScript(symm.getAtoms()));
83+
jmol.setTitle(SymmetryDisplay.getSymmTitle(symm));
8184

8285
} else if (cmd.equals("Show Symmetry Group")) {
8386
String script = SymmetryDisplay.printSymmetryGroup(symm);

biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymm.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,6 @@ protected static CeSymmResult align(Atom[] atoms, CESymmParameters params)
248248
// Store the optimal self-alignment
249249
result.setSelfAlignment(optimalAFP);
250250
result.setStructureId(id);
251-
252-
// Do not try the refinement if the self-alignment is not significant
253-
if (optimalAFP.getTMScore() < params.getScoreThreshold()){
254-
result.setSymmOrder(1);
255-
return result;
256-
}
257251

258252
// Determine the symmetry Type or get the one in params
259253
if (params.getSymmType() == SymmetryType.AUTO) {
@@ -266,6 +260,12 @@ protected static CeSymmResult align(Atom[] atoms, CESymmParameters params)
266260
}
267261
} else
268262
result.setType(params.getSymmType());
263+
264+
// Do not try the refinement if the self-alignment is not significant
265+
if (optimalAFP.getTMScore() < params.getScoreThreshold()){
266+
result.setSymmOrder(1);
267+
return result;
268+
}
269269

270270
// STEP 3: order detection & symmetry refinement, apply consistency
271271
try {
@@ -416,19 +416,14 @@ public static CeSymmResult analyze(Atom[] atoms, CESymmParameters params)
416416
if (result.isRefined()) {
417417
// Optimize the global alignment freely once more (final step)
418418
if (params.getOptimization() && result.getSymmLevels() > 1) {
419-
// Remove the axes to do free superposition optimization TODO
420-
SymmetryAxes axes = result.getAxes();
421-
result.setAxes(null);
422419
try {
423420
SymmOptimizer optimizer = new SymmOptimizer(result);
424421
MultipleAlignment optimized = optimizer.optimize();
425422
// Set the optimized MultipleAlignment and the axes
426423
result.setMultipleAlignment(optimized);
427-
result.setAxes(axes);
428424
} catch (RefinerFailedException e) {
429425
logger.info("Final optimization failed:" + e.getMessage());
430426
}
431-
result.setAxes(axes);
432427
}
433428
result.getMultipleAlignment().getEnsemble()
434429
.setStructureIdentifiers(result.getRepeatsID());

0 commit comments

Comments
 (0)