Class BoxOptCell

java.lang.Object
ffx.algorithms.optimize.manybody.BoxOptCell

public class BoxOptCell extends Object
Contains a cell used for box optimization, its residues, the fractional coordinates within a crystal it takes up, its overall (linear) index, and its indices along the a, b, and c crystal axes.
  • Constructor Details

    • BoxOptCell

      public BoxOptCell(double[] fractionalCoordinates, int[] indices, int linearIndex)
      Constructs a BoxOptCell object, which takes up a set of fractional coordinates within the Crystal, the Residues contained within, and the index of the cell along the crystal's a, b, and c axes.
      Parameters:
      fractionalCoordinates - Fractional coordinates contained, indexed by 1-3 min x,y,z, 4-6 max x,y,z
      indices - Index of cell along a, b, and c (x, y, and z).
      linearIndex - Index of box in linear box array.
  • Method Details

    • addResidue

      public void addResidue(Residue residue)
      Add a residue to the box.
      Parameters:
      residue - Residue to be added.
    • anyRotamerInsideCell

      public boolean anyRotamerInsideCell(Residue residue, Crystal crystal, SymOp symOp, boolean variableOnly)
      Checks if any rotamer of a Residue is inside this BoxOptCell.
      Parameters:
      residue - Residue to check.
      crystal - A Crystal.
      symOp - A symmetry operator to apply.
      variableOnly - If using only variable (protein side-chain, nucleic acid backbone) atoms.
      Returns:
      If contained inside this BoxOptCell.
    • atomInsideCell

      public boolean atomInsideCell(Atom atom, Crystal crystal, SymOp symOp)
      Checks if an Atom would be contained inside this cell.
      Parameters:
      atom - Atom to check.
      crystal - A Crystal.
      symOp - A symmetry operator to apply.
      Returns:
      If contained.
    • moveValuesBetweenZeroAndOne

      public static void moveValuesBetweenZeroAndOne(double[] valuesToMove)
      Moves an array of doubles to be within 0.0 and 1.0 by addition or subtraction of a multiple of 1.0. Typical use is moving an atom placed outside crystal boundaries from the symmetry mate back into the crystal.
      Parameters:
      valuesToMove - Doubles to be moved between 0 and 1.
    • getLinearIndex

      public int getLinearIndex()
      Returns the linear index of this Box.
      Returns:
      Linear index.
    • getResidues

      public Residue[] getResidues()
      Returns an array of the Residues contained within the cell.
      Returns:
      Array of Residues.
    • getResiduesAsList

      public ArrayList<Residue> getResiduesAsList()
      Returns a copy of the ArrayList of residues.
      Returns:
      ArrayList of Residues in the cell.
    • getXYZIndex

      public int[] getXYZIndex()
      Returns the x, y, and z indices of this box.
      Returns:
      Box indices.
    • residueInsideCell

      public boolean residueInsideCell(Residue residue, Crystal crystal, SymOp symOp, boolean variableOnly)
      Checks if a Residue is inside this BoxOptCell.
      Parameters:
      residue - Residue to check.
      crystal - A Crystal.
      symOp - A symmetry operator to apply.
      variableOnly - If using only variable (protein side-chain, nucleic acid backbone) atoms.
      Returns:
      If contained inside this BoxOptCell.
    • sortBoxResidues

      public void sortBoxResidues()
      Sorts residues in the box.