Class ManyBodyCell

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

public class ManyBodyCell extends Object
A cell used for optimization of a subdomain, its residues, its extent in fractional coordinates, its overall (linear) index, and its indices along the a, b, and c axes.
  • Constructor Details

    • ManyBodyCell

      public ManyBodyCell(double[] fractionalCoordinates, int[] indices, int cellIndex)
      Constructs a ManyBodyCell instance, 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 - Extent in fractional coordinates (0-2 are min a,b,c and 3-5 are max).
      indices - Index of the cell along a, b, and c axes.
      cellIndex - Index of the cell in linear array.
  • Method Details

    • toString

      public String toString()
      Returns a string representation of this BoxOptCell.
      Overrides:
      toString in class Object
      Returns:
      String representation.
    • 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.
    • getCellIndex

      public int getCellIndex()
      Returns the linear index of this Box.
      Returns:
      Linear index.
    • getResiduesAsList

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

      public int[] getABCIndices()
      Returns the a, b, and c axis indices of this cell.
      Returns:
      Cell 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.
    • sortCellResidues

      public void sortCellResidues()
      Sorts residues in the box.