## org.biojava.bio.structure.align.helper
Class AlignTools

    java.lang.Object
      org.biojava.bio.structure.align.helper.AlignTools

    public class AlignTools

extends Object

Constructor Summary
`AlignTools()`

Method Summary
`static Atom` `getCenter(Atom[] ca, int pos, int fragmentLength)` get the centroid for the set of atoms starting fromposition pos, length fragmentLenght
`static double[]` `getDiagonalAtK(Atom[] atoms, int k)`
`static Matrix` `getDistanceMatrix(Atom[] ca1, Atom[] ca2)` matrix of all distances between two sets of 3d coords"
`static Atom[]` `getFragment(Atom[] caall, int pos, int fragmentLength)` get a continue subset of Atoms based by the starting position and the length
`static Atom[]` `getFragmentFromIdxList(Atom[] caall, int[] idx)` get a subset of Atoms based by their positions
`static Atom[]` `getFragmentNoClone(Atom[] caall, int pos, int fragmentLength)` get a continue subset of Atoms based by the starting position and the length does not clone the original atoms.
`static double` `rms_dk_diag(double[] dk1, double[] dk2, int i, int j, int l, int k)` Given distance matrix diagonals dk1, dk2, get the rmsd of a fpair.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AlignTools

    public AlignTools()

Method Detail

### getFragmentFromIdxList

    public static Atom[] getFragmentFromIdxList(Atom[] caall,
                                                int[] idx)

  get a subset of Atoms based by their positions

  Parameters:
    `caall` -
    `idx` - an array where each element is a position of all the Atoms to return
  Returns:
    at Atom[] array

### getFragment

    public static Atom[] getFragment(Atom[] caall,
                                     int pos,
                                     int fragmentLength)

  get a continue subset of Atoms based by the starting position and the length

  Parameters:
    `caall` -
    `pos` - ... the start position
    `fragmentLength` - .. the length of the subset to extract.
  Returns:
    an Atom[] array

### getFragmentNoClone

    public static Atom[] getFragmentNoClone(Atom[] caall,
                                            int pos,
                                            int fragmentLength)

  get a continue subset of Atoms based by the starting position and the length does not clone the original atoms.

  Parameters:
    `caall` -
    `pos` - ... the start position
    `fragmentLength` - .. the length of the subset to extract.
  Returns:
    an Atom[] array

### getCenter

    public static Atom getCenter(Atom[] ca,
                                 int pos,
                                 int fragmentLength)

  get the centroid for the set of atoms starting fromposition pos, length fragmentLenght

  Parameters:
    `ca` -
    `pos` -
    `fragmentLength` -
  Returns:
    an Atom

### getDiagonalAtK

    public static double[] getDiagonalAtK(Atom[] atoms,
                                          int k)

### rms_dk_diag

    public static double rms_dk_diag(double[] dk1,
                                     double[] dk2,
                                     int i,
                                     int j,
                                     int l,
                                     int k)

  Given distance matrix diagonals dk1, dk2, get the rmsd of a fpair. i,j is the fpair start in mol1 and mol2, l is the length of the fragment

  Parameters:
    `dk1` - distances of structure 1
    `dk2` - distance of structure 2
    `i` - position in structure 1
    `j` - position in structure 2
    `l` - length of the fragments
    `k` - diagonal used
  Returns:
    a double

### getDistanceMatrix

    public static Matrix getDistanceMatrix(Atom[] ca1,
                                           Atom[] ca2)

  matrix of all distances between two sets of 3d coords"

  Parameters:
    `ca1` -
    `ca2` -
  Returns:
    a Matrixd