Class SymmetryAxes


  • public class SymmetryAxes
    extends java.lang.Object
    Data Structure that stores all the symmetry axis that describe the symmetry of a structure. Generalizes to all types of symmetry, the classic ones (Cn, Dn) and any hierarchical or local symmetries.

    Hierarchical symmetry can be visualized as a tree, where each level has a fixed branching factor. Each level of the tree is associated with a transformation operator, whose order determines the degree of nodes at that level of the tree. Leaves of the tree implicitly represent aligned repeats (indexed 0 to n-1), so care must be taken to keep external references to the repeats (e.g. rows of a MultipleAlignment in the same order implied by the tree.

    Each node of the tree specifies an alignment between those repeats below each of its children. It is also associated with a symmetry axis, which is calculated based on the associated operator as well as any parent operators. It also stores the parts of the structure (symmetric units) involved in each axis, in addition to the way to calculate them.

    This is intended to provide a general axis support for the multiple repeat alignment optimization and the axis display in Jmol. This object is related to a MultipleAlignment object that defines the symmetric units.

    Since:
    4.2.0
    Author:
    Aleix Lafita
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SymmetryAxes.Axis
      Represents an axis of symmetry
    • Constructor Summary

      Constructors 
      Constructor Description
      SymmetryAxes()
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addAxis​(javax.vecmath.Matrix4d axis, int order, CESymmParameters.SymmetryType type)
      Adds a new axis of symmetry to the bottom level of the tree
      void addAxis​(javax.vecmath.Matrix4d axis, java.util.List<java.util.List<java.lang.Integer>> superposition, java.util.List<java.lang.Integer> repeats, java.lang.Integer division)
      Deprecated.
      java.util.List<javax.vecmath.Matrix4d> getElementaryAxes()
      Return the operator for all elementary axes of symmetry of the structure, that is, the axes stored in the List as unique and from which all the symmetry axes are constructed.
      java.util.List<SymmetryAxes.Axis> getElementaryAxesObjects()
      Return all elementary axes of symmetry of the structure, that is, the axes stored in the List as unique and from which all the symmetry axes are constructed.
      SymmetryAxes.Axis getElementaryAxis​(int level)  
      java.util.List<java.lang.Integer> getFirstRepeats​(int level)
      Get the first repeat index of each axis of a specified level.
      int getNumLevels()  
      int getNumRepeats()
      Get the number of repeats.
      java.util.List<java.util.List<java.lang.Integer>> getRepeatRelation​(int level)
      Get the indices of participating repeats in Cauchy two-line form.
      java.util.List<java.util.List<java.lang.Integer>> getRepeatRelation​(int level, int firstRepeat)  
      java.util.List<java.util.List<java.lang.Integer>> getRepeatRelation​(SymmetryAxes.Axis axis)  
      java.util.List<java.util.List<java.lang.Integer>> getRepeatsCyclicForm​(int level)  
      java.util.List<java.util.List<java.lang.Integer>> getRepeatsCyclicForm​(int level, int firstRepeat)
      Get the indices of participating repeats in cyclic form.
      static java.lang.String getRepeatsCyclicForm​(java.util.List<java.util.List<java.lang.Integer>> cycleForm, java.util.List<?> repeats)  
      java.util.List<java.util.List<java.lang.Integer>> getRepeatsCyclicForm​(SymmetryAxes.Axis axis)  
      java.lang.String getRepeatsCyclicForm​(SymmetryAxes.Axis axis, java.util.List<?> repeats)  
      javax.vecmath.Matrix4d getRepeatTransform​(int repeat)
      Return the transformation that needs to be applied to a repeat in order to superimpose onto repeat 0.
      javax.vecmath.Matrix4d getRepeatTransform​(int x, int y)
      Return the transformation that needs to be applied to repeat x in order to superimpose onto repeat y.
      java.util.List<SymmetryAxes.Axis> getSymmetryAxes()
      Return all symmetry axes of of the structure: the set of axes that describe all parts of the structure.
      void updateAxis​(java.lang.Integer index, javax.vecmath.Matrix4d newAxis)
      Updates an axis of symmetry, after the superposition changed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SymmetryAxes

        public SymmetryAxes()
        Constructor. Initializes variables only.
    • Method Detail

      • addAxis

        @Deprecated
        public void addAxis​(javax.vecmath.Matrix4d axis,
                            java.util.List<java.util.List<java.lang.Integer>> superposition,
                            java.util.List<java.lang.Integer> repeats,
                            java.lang.Integer division)
        Deprecated.
        Use addAxis(Matrix4d, int, SymmetryType) instead. Repeats and Superposition are now inferred automatically.
        Adds a new axis of symmetry. The repeats that participate in this axis and their superposition relation should also be indicated.
        Parameters:
        axis - the new axis of symmetry found
        superposition - repeats participating and superposition relation
        repeats - number of times the transformation is applied to every repeat. index1=repeat, index2=times.
        division - number of parts that this axis divides the structure in
        Throws:
        java.lang.IllegalArgumentException - if the repeat relation is in the wrong format: should be double List of equal sizes.
      • addAxis

        public void addAxis​(javax.vecmath.Matrix4d axis,
                            int order,
                            CESymmParameters.SymmetryType type)
        Adds a new axis of symmetry to the bottom level of the tree
        Parameters:
        axis - the new axis of symmetry found
        order - number of parts that this axis divides the structure in
        type - indicates whether the axis has OPEN or CLOSED symmetry
      • updateAxis

        public void updateAxis​(java.lang.Integer index,
                               javax.vecmath.Matrix4d newAxis)
        Updates an axis of symmetry, after the superposition changed.
        Parameters:
        index - old axis index
        newAxis -
      • getElementaryAxes

        public java.util.List<javax.vecmath.Matrix4d> getElementaryAxes()
        Return the operator for all elementary axes of symmetry of the structure, that is, the axes stored in the List as unique and from which all the symmetry axes are constructed.
        Returns:
        axes elementary axes of symmetry.
      • getElementaryAxesObjects

        public java.util.List<SymmetryAxes.Axis> getElementaryAxesObjects()
        Return all elementary axes of symmetry of the structure, that is, the axes stored in the List as unique and from which all the symmetry axes are constructed.
        Returns:
        axes elementary axes of symmetry.
      • getRepeatRelation

        public java.util.List<java.util.List<java.lang.Integer>> getRepeatRelation​(int level)
        Get the indices of participating repeats in Cauchy two-line form.

        Returns two lists of the same length. The first gives a list of all repeat indices which are aligned at the specified level of symmetry (e.g. 0 through the degree of this level). The second list gives the corresponding repeats after applying the operator once.

        Parameters:
        level - the axis index
        Returns:
        the double List of repeat relations, or null if the level is invalid
        See Also:
        for an equivalent specification with half the memory
      • getRepeatRelation

        public java.util.List<java.util.List<java.lang.Integer>> getRepeatRelation​(SymmetryAxes.Axis axis)
      • getRepeatRelation

        public java.util.List<java.util.List<java.lang.Integer>> getRepeatRelation​(int level,
                                                                                   int firstRepeat)
      • getRepeatsCyclicForm

        public java.util.List<java.util.List<java.lang.Integer>> getRepeatsCyclicForm​(int level,
                                                                                      int firstRepeat)
        Get the indices of participating repeats in cyclic form.

        Each inner list gives a set of equivalent repeats and should have length equal to the order of the axis' operator.

        Parameters:
        level -
        firstRepeat -
        Returns:
      • getRepeatsCyclicForm

        public java.util.List<java.util.List<java.lang.Integer>> getRepeatsCyclicForm​(SymmetryAxes.Axis axis)
      • getRepeatsCyclicForm

        public java.util.List<java.util.List<java.lang.Integer>> getRepeatsCyclicForm​(int level)
      • getRepeatsCyclicForm

        public java.lang.String getRepeatsCyclicForm​(SymmetryAxes.Axis axis,
                                                     java.util.List<?> repeats)
      • getRepeatsCyclicForm

        public static java.lang.String getRepeatsCyclicForm​(java.util.List<java.util.List<java.lang.Integer>> cycleForm,
                                                            java.util.List<?> repeats)
      • getRepeatTransform

        public javax.vecmath.Matrix4d getRepeatTransform​(int repeat)
        Return the transformation that needs to be applied to a repeat in order to superimpose onto repeat 0.
        Parameters:
        repeat - the repeat index
        Returns:
        transformation matrix for the repeat
      • getRepeatTransform

        public javax.vecmath.Matrix4d getRepeatTransform​(int x,
                                                         int y)
        Return the transformation that needs to be applied to repeat x in order to superimpose onto repeat y.
        Parameters:
        x - the first repeat index (transformed)
        y - the second repeat index (fixed)
        Returns:
        transformation matrix for the repeat x
      • getSymmetryAxes

        public java.util.List<SymmetryAxes.Axis> getSymmetryAxes()
        Return all symmetry axes of of the structure: the set of axes that describe all parts of the structure. This combines the elementary axes to generate all possible axes. The axes are returned in the repeat degrees.
        Returns:
        axes all symmetry axes of the structure.
      • getNumRepeats

        public int getNumRepeats()
        Get the number of repeats. This is equal to the product of all degrees.
        Returns:
        Number of repeats (leaves of the tree).
      • getFirstRepeats

        public java.util.List<java.lang.Integer> getFirstRepeats​(int level)
        Get the first repeat index of each axis of a specified level.
        Parameters:
        level - level of the tree to cut at
        Returns:
        List of first Repeats of each index, sorted in ascending order
      • getNumLevels

        public int getNumLevels()