Package ffx.potential

Class MolecularAssembly

All Implemented Interfaces:
ROLS, Serializable, Cloneable, MutableTreeNode, TreeNode
Direct Known Subclasses:
FFXSystem

public class MolecularAssembly extends MSGroup
The MolecularAssembly class is a collection of Polymers, Hetero Molecules, Ions and Water
Since:
1.0
Author:
Michael J. Schnieders
See Also:
  • Field Details

  • Constructor Details

    • MolecularAssembly

      public MolecularAssembly(String name)
      Constructor for MolecularAssembly.
      Parameters:
      name - a String object.
    • MolecularAssembly

      public MolecularAssembly(String name, MSNode Polymers)
      Constructor for MolecularAssembly.
      Parameters:
      name - a String object.
      Polymers - a MSNode object.
    • MolecularAssembly

      public MolecularAssembly(String name, MSNode Polymers, org.apache.commons.configuration2.CompositeConfiguration properties)
      Constructor for MolecularAssembly.
      Parameters:
      name - a String object.
      Polymers - a MSNode object.
      properties - a CompositeConfiguration object.
  • Method Details

    • setAlternateLocation

      public void setAlternateLocation(Character alternateLocation)
      Set the alternate location.
      Parameters:
      alternateLocation - The alternate location.
    • getAlternateLocation

      public Character getAlternateLocation()
      Get the alternate location.
      Returns:
      The alternate location.
    • addHeaderLine

      public void addHeaderLine(String line)
      Adds a header line to this MolecularAssembly (particularly for PDB formats)
      Parameters:
      line - Line to add.
    • addMSNode

      public MSNode addMSNode(MSNode o)
      Abstract method that should specify how to add various MSNodes subclasses (such as Atoms, Residues and Polymers) to the MSGroup
      Specified by:
      addMSNode in class MSGroup
      Parameters:
      o - a MSNode object.
      Returns:
      a MSNode object.
    • applyRandomDensity

      public void applyRandomDensity(double ucDensity)
      Applies a randomly drawn density to a molecular system's crystal.
      Parameters:
      ucDensity - Target density.
    • applyRandomSymOp

      public void applyRandomSymOp(double x)
      Randomizes position in the unit cell of each molecule by applying a Cartesian SymOp with a random translation.
      Parameters:
      x - SymOp with translation range -x/2 .. x/2 (0 for random placement in the unit cell, negative for no SymOp)
    • center

      public void center()
      center
    • centerAt

      public void centerAt(double[] d)
      centerAt
      Parameters:
      d - an array of double.
    • centerView

      public void centerView(boolean rot, boolean trans)
      centerView
      Parameters:
      rot - a boolean.
      trans - a boolean.
    • computeFractionalCoordinates

      public void computeFractionalCoordinates()
      Compute fractional coordinates.
    • createBox

      public void createBox()
      createBox
    • deleteMolecule

      public void deleteMolecule(Molecule molecule)
      deleteMolecule
      Parameters:
      molecule - a Molecule object.
    • destroy

      public boolean destroy()
      destroy
      Overrides:
      destroy in class MSNode
      Returns:
      a boolean.
    • detach

      public void detach()
      detach
    • finalize

      public void finalize(boolean finalizeGroups, ForceField forceField)
      Abstract method that should specify how to finalize a MSGroup
      Specified by:
      finalize in class MSGroup
      Parameters:
      finalizeGroups - a boolean.
      forceField - the ForceField parameters to use when finalizing the MSGroup.
    • findAtom

      public Atom findAtom(Atom atom)
      findAtom
      Parameters:
      atom - a Atom object.
      Returns:
      a Atom object.
    • fractionalCount

      public int fractionalCount()
      Count the number of fractional coordinate entities in the system. If fractionalMode is MOLECULE, then the count is equal to the number of molecules. If fractionalMode is ATOM, then the count is the number of atoms. Otherwise the count is zero.
      Returns:
      The number of fractional coordinate entities.
    • getActiveAtomArray

      public Atom[] getActiveAtomArray()
      getActiveAtomArray
      Returns:
      an array of active Atom objects.
    • getAllBondedEntities

      public List<MSNode> getAllBondedEntities()
      Gets all bonded entities in this MolecularAssembly, where an entity can be a polymer, molecule, monoatomic ion, or monoatomic gas (i.e. noble gas atoms).
      Returns:
      All bonded groups of atoms and all singleton atoms.
    • getAtomArray

      public Atom[] getAtomArray()
      Return an Array of all atoms in the System.
      Returns:
      an array of Atom objects.
    • getAtomFromWireVertex

      public Atom getAtomFromWireVertex(int i)
      getAtomFromWireVertex
      Parameters:
      i - a int.
      Returns:
      a Atom object.
    • getBackBoneAtoms

      public List<Atom> getBackBoneAtoms()
      getBackBoneAtoms
      Returns:
      a List object.
    • getBranchGroup

      public org.jogamp.java3d.BranchGroup getBranchGroup()
      Getter for the field branchGroup.
      Returns:
      a BranchGroup object.
    • getChain

      public Polymer getChain(String name)
      getChain
      Parameters:
      name - a String object.
      Returns:
      a Polymer object.
    • getChainNames

      public String[] getChainNames()
      getChainNames
      Returns:
      an array of String objects.
    • getChains

      public Polymer[] getChains()
      getChains
      Returns:
      an array of Polymer objects.
    • getCharge

      public double getCharge(boolean alwaysLog)
      Sums up charge of the system, checking nonstandard residues for non-unitary charges.
      Parameters:
      alwaysLog - Log non-unitary charge warnings for all nodes
      Returns:
      System charge
    • getCrystal

      public Crystal getCrystal()
      getCrystal
      Returns:
      a Crystal object.
    • setCrystal

      public void setCrystal(Crystal crystal)
      Set the Crystal for the Potential of this MolecularAssembly.
      Parameters:
      crystal - Crystal instance.
    • getCurrentCycle

      public int getCurrentCycle()
      Getter for the field currentCycle.
      Returns:
      a int.
    • setCurrentCycle

      public void setCurrentCycle(int c)
      Setter for the field currentCycle.
      Parameters:
      c - a int.
    • getCycles

      public int getCycles()
      Getter for the field cycles.
      Returns:
      a int.
    • setCycles

      public void setCycles(int c)
      Setter for the field cycles.
      Parameters:
      c - a int.
    • getExtent

      public double getExtent()
      getExtent
      Overrides:
      getExtent in class MSNode
      Returns:
      a double.
    • getFile

      public File getFile()
      Getter for the field file.
      Returns:
      a File object.
    • setFile

      public void setFile(File file)
      Setter for the field file.
      Parameters:
      file - a File object.
    • getArchiveFile

      public File getArchiveFile()
      Getter for the field archiveFile.
      Returns:
      a File object.
    • setArchiveFile

      public void setArchiveFile(File archiveFile)
      Set the File for writing out an archive.
      Parameters:
      archiveFile - The archive file.
    • getForceField

      public ForceField getForceField()
      Getter for the field forceField.
      Returns:
      a ForceField object.
    • setForceField

      public void setForceField(ForceField forceField)
      Setter for the field forceField.
      Parameters:
      forceField - a ForceField object.
    • getFractionalMode

      public MolecularAssembly.FractionalMode getFractionalMode()
      Getter for the field fractionalMode.
      Returns:
      a MolecularAssembly.FractionalMode object.
    • setFractionalMode

      public void setFractionalMode(MolecularAssembly.FractionalMode mode)
      Setter for the field fractionalMode.
      Parameters:
      mode - a MolecularAssembly.FractionalMode object.
    • getHeaderLines

      public String[] getHeaderLines()
      Gets the header lines associated with this MolecularAssembly (particularly for PDB)
      Returns:
      Header lines.
    • getIons

      public List<MSNode> getIons()
      Getter for the field ions.
      Returns:
      a List object.
    • getMass

      public double getMass()
      getMass.
      Returns:
      a double.
    • getNeuralNetworkIdentity

      public boolean[] getNeuralNetworkIdentity()
      Construct a boolean orray of flags to indicate atoms treated by a neural network.
      Returns:
      The boolean orray of flags to indicate atoms treated by a neural network.
    • getMoleculeNumbers

      public int[] getMoleculeNumbers()
      This method assigns a unique integer to every molecule in the MolecularAssembly beginning at 0. An integer array with these values for each atom is returned.
      Returns:
      an array of molecule numbers for each atom.
    • getMolecules

      public List<MSNode> getMolecules()
      Getter for the field molecules.
      Returns:
      a List object.
    • getMoleculeArray

      public Molecule[] getMoleculeArray()
    • setChainIDAndRenumberMolecules

      public void setChainIDAndRenumberMolecules(Character chainID)
      This method sets all HETATM molecules, including water and ions, to use the given chainID and then renumbers the molecules.

      If there is a polymer with the given chainID, then numbering begins after the final ResID. Otherwise numbering begins at 1.

      This is useful for producing consistent PDB file output.

      Parameters:
      chainID - The Character chainID to use for all HETATM molecules.
    • getNodeList

      public List<MSNode> getNodeList()
      getNodeList
      Returns:
      a List object.
    • getOffset

      public org.jogamp.vecmath.Vector3d getOffset()
      Getter for the field offset.
      Returns:
      a Vector3d object.
    • setOffset

      public void setOffset(org.jogamp.vecmath.Vector3d o)
      Setter for the field offset.
      Parameters:
      o - a Vector3d object.
    • getOriginToRot

      public org.jogamp.java3d.TransformGroup getOriginToRot()
      Getter for the field originToRot.
      Returns:
      a TransformGroup object.
    • getParallelTeam

      public ParallelTeam getParallelTeam()
      getParallelTeam.
      Returns:
      a ParallelTeam object.
    • getPolymer

      public Polymer getPolymer(Character chainID, String segID, boolean create)
      getPolymer
      Parameters:
      chainID - a Character object.
      segID - a String object.
      create - a boolean.
      Returns:
      a Polymer object.
    • getPotentialEnergy

      public ForceFieldEnergy getPotentialEnergy()
      Getter for the field potentialEnergy.
      Returns:
      a ForceFieldEnergy object.
    • getProperties

      public org.apache.commons.configuration2.CompositeConfiguration getProperties()
      Getter for the field properties.
      Returns:
      a CompositeConfiguration object.
    • getResidueList

      public List<Residue> getResidueList()
      getResidueList
      Returns:
      a List object.
    • getTransformGroup

      public org.jogamp.java3d.TransformGroup getTransformGroup()
      getTransformGroup
      Returns:
      a TransformGroup object.
    • getWater

      public List<MSNode> getWater()
      getWater
      Returns:
      a List object.
    • getWireFrame

      public org.jogamp.java3d.Node getWireFrame()
      getWireFrame
      Returns:
      a Node object.
    • isVisible

      public boolean isVisible()
      isVisible
      Returns:
      a boolean.
    • loadVRML

      public org.jogamp.java3d.BranchGroup loadVRML()
      loadVRML
      Returns:
      a BranchGroup object.
    • moveAllIntoUnitCell

      public void moveAllIntoUnitCell()
      Moves the center of all chemical entities into the primary unit cell. Somewhat experimental feature; use with caution.
    • moveCenter

      public void moveCenter(double[] d)
      moveCenter
      Parameters:
      d - an array of double.
    • moveToFractionalCoordinates

      public void moveToFractionalCoordinates()
      Move to fractional coordinates.
    • rotateAbout

      public void rotateAbout(org.jogamp.vecmath.Vector3d v)
      Rotate about a point in given in the System's Local Coordinates
      Parameters:
      v - Vector3d
    • sceneGraphChange

      public void sceneGraphChange(List<org.jogamp.java3d.BranchGroup> newShapes)
      sceneGraphChange
      Parameters:
      newShapes - a List object.
    • setColor

      public void setColor(RendererCache.ColorModel newColorModel, org.jogamp.vecmath.Color3f color, org.jogamp.java3d.Material mat)
      setColor
      Specified by:
      setColor in interface ROLS
      Overrides:
      setColor in class MSGroup
      Parameters:
      newColorModel - a RendererCache.ColorModel object.
      color - a Color3f object.
      mat - a Material object.
    • setPotential

      public void setPotential(ForceFieldEnergy potentialEnergy)
      setPotential
      Parameters:
      potentialEnergy - a ForceFieldEnergy object.
    • setView

      public void setView(RendererCache.ViewModel newViewModel, List<org.jogamp.java3d.BranchGroup> newShapes)
      setView
      Specified by:
      setView in interface ROLS
      Overrides:
      setView in class MSGroup
      Parameters:
      newViewModel - a RendererCache.ViewModel object.
      newShapes - a List object.
    • setWireWidth

      public void setWireWidth(float f)
      setWireWidth
      Parameters:
      f - a float.
    • removeLeaves

      protected void removeLeaves()
      removeLeaves
      Overrides:
      removeLeaves in class MSGroup