Class Superpose

java.lang.Object
ffx.potential.utils.Superpose

public class Superpose extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Superpose(SystemFilter baseFilter, SystemFilter targetFilter, boolean isSymmetric)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    applyRotation(double[] x2, double[][] rot)
    Apply a rotation matrix to a set of coordinates.
    static void
    applyTranslation(double[] x, double[] translation)
    Apply a translation matrix [dx,dy,dz] to a molecular system.
    static double
    calcDRMSD(double[] xUsed, double[] x2Used, int nUsed)
    Calculates the dRMSD between to sets of coordinates.
    void
    calculateRMSDs(int[] usedIndices, boolean dRMSD, boolean verbose, boolean restart, boolean write, boolean saveSnapshots, boolean printSym)
    This method calculates the all versus all RMSD of a multiple model pdb/arc file.
    static double[][]
    calculateRotation(double[] x1, double[] x2, double[] mass)
    Calculate a rotation to minimize RMS distance between two sets of atoms using quaternions, overlapping x2 on x1.
    static double[]
    calculateTranslation(double[] x, double[] mass)
    Calculate a translation vector [dx,dy,dz] to move the center of mass to the origin.
    static void
    extractCoordinates(int[] usedIndices, double[] x, double[] xUsed)
    Extract used coordinate subset from the entire system.
    static double
    rmsd(double[] x1, double[] x2, double[] mass)
    Compute the RMSD for superimposed atom pairs.
    static void
    rotate(double[] x1, double[] x2, double[] mass)
    Minimize the RMS distance between two sets of atoms using quaternions.
    static double
    superpose(double[] x1, double[] x2, double[] mass)
    This method completes the following superposition operations and returns an RMSD: 1) translates the x1 coordinates to the origin.
    static void
    translate(double[] x, double[] mass)
    Move the center of mass for a set of atoms to the origin.
    static void
    translate(double[] x1, double[] mass1, double[] x2, double[] mass2)
    Move the center of mass for both sets of atoms to the origin.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • calculateRMSDs

      public void calculateRMSDs(int[] usedIndices, boolean dRMSD, boolean verbose, boolean restart, boolean write, boolean saveSnapshots, boolean printSym)
      This method calculates the all versus all RMSD of a multiple model pdb/arc file.
      Parameters:
      usedIndices - List of atom indices in use.
      dRMSD - Compute dRMSDs in addition to RMSD.
      verbose - Verbose logging.
      restart - Attempt to restart from an RMSD matrix.
      write - Write out an RMSD file.
      saveSnapshots - Save superposed snapshots.
    • extractCoordinates

      public static void extractCoordinates(int[] usedIndices, double[] x, double[] xUsed)
      Extract used coordinate subset from the entire system.
      Parameters:
      usedIndices - Mapping from the xUsed array to its source in x.
      x - All atomic coordinates.
      xUsed - The used subset of coordinates.
    • calcDRMSD

      public static double calcDRMSD(double[] xUsed, double[] x2Used, int nUsed)
      Calculates the dRMSD between to sets of coordinates.
      Parameters:
      xUsed - A double array containing the xyz coordinates for multiple atoms.
      x2Used - A double array containing the xyz coordinates for multiple atoms.
      nUsed - The number of atoms that dRMSD is calculated on.
      Returns:
      A double containing the dRMSD value.
    • applyRotation

      public static void applyRotation(double[] x2, double[][] rot)
      Apply a rotation matrix to a set of coordinates.
      Parameters:
      x2 - Cartesian coordinates of the second system. Modified in-place.
      rot - A pre-calculated rotation matrix.
    • applyTranslation

      public static void applyTranslation(double[] x, double[] translation)
      Apply a translation matrix [dx,dy,dz] to a molecular system.
      Parameters:
      x - Coordinates to move; modified in-place.
      translation - Translation matrix.
    • calculateRotation

      public static double[][] calculateRotation(double[] x1, double[] x2, double[] mass)
      Calculate a rotation to minimize RMS distance between two sets of atoms using quaternions, overlapping x2 on x1.
      Parameters:
      x1 - Cartesian coordinates of the first system.
      x2 - Cartesian coordinates of the second system.
      mass - The mass of each particle in the system.
      Returns:
      A rotation matrix.
    • calculateTranslation

      public static double[] calculateTranslation(double[] x, double[] mass)
      Calculate a translation vector [dx,dy,dz] to move the center of mass to the origin.
      Parameters:
      x - Coordinates of the system.
      mass - Mass of each atom.
      Returns:
      Translation to the origin.
    • rmsd

      public static double rmsd(double[] x1, double[] x2, double[] mass)
      Compute the RMSD for superimposed atom pairs.
      Parameters:
      x1 - Cartesian coordinates of the first system.
      x2 - Cartesian coordinates of the second system.
      mass - The mass of each particle in the system.
      Returns:
      The RMSD.
    • rotate

      public static void rotate(double[] x1, double[] x2, double[] mass)
      Minimize the RMS distance between two sets of atoms using quaternions.
      Parameters:
      x1 - Cartesian coordinates of the first system. Unmodified.
      x2 - Cartesian coordinates of the second system. Modified in-place.
      mass - The mass of each particle in the system.
    • translate

      public static void translate(double[] x1, double[] mass1, double[] x2, double[] mass2)
      Move the center of mass for both sets of atoms to the origin.
      Parameters:
      x1 - Cartesian coordinates of the first system.
      mass1 - The mass of each particle in the first system.
      x2 - Cartesian coordinates of the second system.
      mass2 - The mass of each particle in the second system.
    • translate

      public static void translate(double[] x, double[] mass)
      Move the center of mass for a set of atoms to the origin.
      Parameters:
      x - Cartesian coordinates of the system; modified in-place.
      mass - The mass of each particle in the system.
    • superpose

      public static double superpose(double[] x1, double[] x2, double[] mass)
      This method completes the following superposition operations and returns an RMSD: 1) translates the x1 coordinates to the origin. 2) translates the x2 coordinates to the origin. 3) rotates x2 onto x1. 4) computes and return the RMSD.
      Parameters:
      x1 - Coordinates of system 1.
      x2 - Coordinates of system 2.
      mass - Mass of each atom.
      Returns:
      The mass-weighted RMSD following superposition.