Skip to content

Commit 9c761c3

Browse files
committed
Update symmetry chapter
1 parent d46c3f2 commit 9c761c3

1 file changed

Lines changed: 24 additions & 14 deletions

File tree

structure/symmetry.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,18 @@ Structure s;
3939
QuatSymmetryParameters parameters = new QuatSymmetryParameters();
4040
parameters.setVerbose(true); //print information
4141

42-
//Instantiate the detector and calculate symmetry
43-
CalcBioAssemblySymmetry calc = new CalcBioAssemblySymmetry(s, parameters);
44-
QuatSymmetryDetector detector = calc.orient();
42+
//Instantiate the detector
43+
QuatSymmetryDetector detector = QuatSymmetryDetector(structure, parameters);
4544

46-
//Calculate and return global and local results
45+
//The getters calculate the quaternary symmetry automatically
4746
List<QuatSymmetryResults> globalResults = detector.getGlobalSymmetry();
4847
List<List<QuatSymmetryResults>> localResults = detector.getLocalSymmetries();
4948

5049
```
50+
The return type are `List` because there can be multiple valid options for the
51+
quaternary symmetry. The local results `List` is empty if there exist no local
52+
symmetry in the structure, and the global results `List` has always size bigger
53+
than 1, returning a C1 point group in the case of asymmetric structure.
5154

5255
The `QuatSymmetryResults` object contains all the information of the symmetry.
5356
This object will be used later to obtain axes of symmetry, point group name,
@@ -116,33 +119,40 @@ create a multiple alignment of the subunits, respecting the symmetry axes.
116119

117120
The **internal symmetry** detection algorithm is implemented in the biojava class
118121
[CeSymm](http://www.biojava.org/docs/api/org/biojava/nbio/structure/symmetry/internal/CeSymm).
119-
It implements both [Structural Alignment](alignment.md) interfaces, so it works programatically
120-
like any of the structural alignment algorithms, and returns one of the structure alignment
121-
[Data Models](alignment-data-model.md).
122+
It returns a MultipleAlignment, see the explanation of the model in [Data Models](alignment-data-model.md),
123+
that describes the internal subunits multiple alignment. In case of no symmetry detected, the
124+
returned alignment represents the optimal self-alignment produced by the first step of the **CE-Symm**
125+
algorithm.
122126

123127
```java
124-
//Prepare the atom input, in a List with a single array
125-
Atom[] array = StructureTools.getRepresentativeAtomArray(structure);
126-
List<Atom[]> atoms = new ArrayList<Atom[]>();
127-
atoms.add(array);
128+
//Input the atoms in a chain as an array
129+
Atom[] atoms = StructureTools.getRepresentativeAtomArray(chain);
128130

129131
//Initialize the algorithm
130132
CeSymm ceSymm = new CeSymm();
131133

132134
//Choose some parameters
133-
CESymmParameters params = (CESymmParameters) ceSymm.getParameters();
135+
CESymmParameters params = ceSymm.getParameters();
134136
params.setRefineMethod(RefineMethod.SINGLE);
135137
params.setOptimization(true);
136138
params.setMultipleAxes(true);
137139

138140
//Run the symmetry analysis - alignment as an output
139-
MultipleAlignment symmetry = ceSymm.align(atoms, params);
141+
MultipleAlignment symmetry = ceSymm.analyze(atoms, params);
142+
143+
//Test if the alignment returned was refined with
144+
boolean refined = SymmetryTools.isRefined(symmetry);
140145

141146
//Get the axes of symmetry from the aligner
142147
SymmetryAxes axes = ceSymm.getSymmetryAxes();
143148

144-
//Display the results in jmol with the Symmetry GUI
149+
//Display the results in jmol with the SymmetryDisplay
145150
SymmetryDisplay.display(symmetry, axes);
151+
152+
//Show the point group, if any of the internal symmetry
153+
QuatSymmetryResults pg = SymmetryTools.getQuaternarySymmetry(symmetry);
154+
System.out.println(pg.getSymmetry());
155+
146156
```
147157

148158
To enable some extra features in the display, a `SymmetryDisplay`

0 commit comments

Comments
 (0)