Class SymmetryTools


  • public class SymmetryTools
    extends Object
    Utility methods for symmetry (quaternary and internal) detection and result manipulation.
    Author:
    Spencer Bliven, Aleix Lafita, Peter Rose
    • Method Detail

      • grayOutCEOrig

        public static Matrix grayOutCEOrig​(Atom[] ca2,
                                           int rows,
                                           int cols,
                                           CECalculator calculator,
                                           Matrix origM,
                                           int blankWindowSize,
                                           double[] gradientPolyCoeff,
                                           double gradientExpCoeff)
        Grays out the main diagonal of a duplicated distance matrix.
        Parameters:
        ca2 -
        rows - Number of rows
        cols - Number of original columns
        calculator - Used to get the matrix if origM is null
        origM - starting matrix. If null, uses CECalculator.getMatMatrix()
        blankWindowSize - Width of section to gray out
        gradientPolyCoeff -
        gradientExpCoeff -
        Returns:
      • getDkMatrix

        public Matrix getDkMatrix​(Atom[] ca1,
                                  Atom[] ca2,
                                  int fragmentLength,
                                  double[] dist1,
                                  double[] dist2,
                                  int rows,
                                  int cols)
      • getAngle

        public static double getAngle​(AFPChain afpChain,
                                      Atom[] ca1,
                                      Atom[] ca2)
        Returns the magnitude of the angle between the first and second blocks of afpChain, measured in degrees. This is always a positive value (unsigned).
        Parameters:
        afpChain -
        ca1 -
        ca2 -
        Returns:
      • buildSymmetryGraph

        public static List<List<Integer>> buildSymmetryGraph​(List<AFPChain> afps,
                                                             Atom[] atoms,
                                                             boolean undirected)
        Converts a set of AFP alignments into a Graph of aligned residues, where each vertex is a residue and each edge means the connection between the two residues in one of the alignments.
        Parameters:
        afps - List of AFPChains
        atoms - Atom array of the symmetric structure
        undirected - if true, the graph is undirected
        Returns:
        adjacency List of aligned residues
      • buildSymmetryGraph

        public static org.jgrapht.Graph<Integer,​org.jgrapht.graph.DefaultEdge> buildSymmetryGraph​(AFPChain selfAlignment)
        Converts a self alignment into a directed jGraphT of aligned residues, where each vertex is a residue and each edge means the equivalence between the two residues in the self-alignment.
        Parameters:
        selfAlignment - AFPChain
        Returns:
        alignment Graph
      • toFullAlignment

        public static MultipleAlignment toFullAlignment​(CeSymmResult symm)
        Method that converts a repeats symmetric alignment into an alignment of whole structures.

        Example: if the structure has repeats A,B and C, the original alignment is A-B-C, and the returned alignment is ABC-BCA-CAB.

        Parameters:
        symm - CeSymmResult
        Returns:
        MultipleAlignment of the full structure superpositions
      • toRepeatsAlignment

        public static MultipleAlignment toRepeatsAlignment​(CeSymmResult result)
                                                    throws StructureException
        Method that converts a symmetry alignment into an alignment of the repeats only, as new independent structures.

        This method changes the structure identifiers, the Atom arrays and re-scles the aligned residues in the Blocks corresponding to those changes.

        Application: display superimposed repeats in Jmol.

        Parameters:
        result - CeSymmResult of symmetry
        Returns:
        MultipleAlignment of the repeats
        Throws:
        StructureException
      • fromAFP

        public static MultipleAlignment fromAFP​(AFPChain symm,
                                                Atom[] atoms)
                                         throws StructureException
        Converts a refined symmetry AFPChain alignment into the standard representation of symmetry in a MultipleAlignment, that contains the entire Atom array of the strcuture and the symmetric repeats are orgaized in different rows in a single Block.
        Parameters:
        symm - AFPChain created with a symmetry algorithm and refined
        atoms - Atom array of the entire structure
        Returns:
        MultipleAlignment format of the symmetry
        Throws:
        StructureException
      • getGroups

        public static List<GroupgetGroups​(Atom[] rAtoms)
        Returns the List of Groups of the corresponding representative Atom array. The representative Atom array needs to fulfill: no two Atoms are from the same Group and Groups are sequential (connected in the original Structure), except if they are from different Chains.
        Parameters:
        rAtoms - array of representative Atoms (CA, P, etc).
        Returns:
        List of Groups
      • updateSymmetryTransformation

        public static void updateSymmetryTransformation​(SymmetryAxes axes,
                                                        MultipleAlignment msa)
                                                 throws StructureException
        Calculates the set of symmetry operation Matrices (transformations) of the new alignment, based on the symmetry relations in the SymmetryAxes object. It sets the transformations to the input MultipleAlignment and SymmetryAxes objects. If the SymmetryAxes object is null, the superposition of the repeats is done without symmetry constraints.

        This method also sets the scores (RMSD and TM-score) after the new superposition has been updated.

        Parameters:
        axes - SymmetryAxes object. It will be modified.
        msa - MultipleAlignment. It will be modified.
        Throws:
        StructureException
      • getRepresentativeAtoms

        public static Atom[] getRepresentativeAtoms​(Structure structure)
        Returns the representative Atom Array of the first model, if the structure is NMR, or the Array for each model, if it is a biological assembly with multiple models.
        Parameters:
        structure -
        Returns:
        representative Atom[]
      • getValidFolds

        public static List<IntegergetValidFolds​(List<Integer> stoichiometry)
        Find valid symmetry orders for a given stoichiometry. For instance, an A6B4 protein would give [1,2] because (A6B4)1 and (A3B2)2 are valid decompositions.
        Parameters:
        stoichiometry - List giving the number of copies in each Subunit cluster
        Returns:
        The common factors of the stoichiometry