Class MultiResidue

All Implemented Interfaces:
ROLS, Serializable, Cloneable, Comparable<Residue>, MutableTreeNode, TreeNode

public class MultiResidue extends Residue
The MultiResidue class allows switching between residues for uses such as sequence optimization.
Since:
1.0
Author:
Will Tollefson, Michael J. Schnieders
See Also:
  • Constructor Details

    • MultiResidue

      public MultiResidue(Residue residue, ForceField forceField)
      Constructor for MultiResidue.
      Parameters:
      residue - a Residue object.
      forceField - a ForceField object.
  • Method Details

    • 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

      Allows adding Atoms to the Residue.

      Overrides:
      addMSNode in class Residue
      Parameters:
      o - a MSNode object.
      Returns:
      a MSNode object.
    • addResidue

      public void addResidue(Residue newResidue)
      addResidue.
      Parameters:
      newResidue - a Residue object.
    • assignBondedTerms

      public void assignBondedTerms(ForceField forceField)
      assignBondedTerms
      Overrides:
      assignBondedTerms in class MSGroup
      Parameters:
      forceField - the ForceField to use when creating bonded terms.
    • createJoint

      public Joint createJoint(Bond bond, MSGroup group1, MSGroup group2, ForceField forceField)
      Create a joint between two chemical groups.
      Overrides:
      createJoint in class MSGroup
      Parameters:
      bond - Bond
      group1 - a MSGroup object.
      group2 - a MSGroup object.
      forceField - the ForceField parameters to use when creating the joint.
      Returns:
      Joint the created Joint.
    • createJoint

      public Joint createJoint(MSGroup group1, MSGroup group2, ForceField forceField)
      Joiner joins Moieties m1 and m2 and returns the Geometry objects formed in a Joint.
      Overrides:
      createJoint in class MSGroup
      Parameters:
      group1 - a MSGroup object.
      group2 - a MSGroup object.
      forceField - the ForceField parameters to use when creating the joint.
      Returns:
      a Joint object.
    • equals

      public boolean equals(Object o)

      MSNode equality := same class and same name. Consider replacing with a Comparator<MSNode> for cases where non-reference equality is desired.

      Overridden equals method that return true if object is not equals to this, is of the same class, has the same parent Polymer, the same sequence number, the same ResidueType, and the same AA3/NA3.

      Overrides:
      equals in class Residue
    • finalize

      public void finalize(boolean finalizeGeometry, ForceField forceField)
      Abstract method that should specify how to finalize a MSGroup

      The Finalize method should be called once all atoms have been added to the Residue. Geometry objects (Bonds, Angles, etc) are then formed, followed by a determination of under-constrained (Dangling) atoms.

      Overrides:
      finalize in class Residue
      Parameters:
      finalizeGeometry - a boolean.
      forceField - the ForceField parameters to use when finalizing the MSGroup.
    • findDangelingAtoms

      public void findDangelingAtoms()
      This method constructs a List of atoms which are under-constrained. (i.e. They can except more bonds)
      Overrides:
      findDangelingAtoms in class MSGroup
    • getActive

      public Residue getActive()
      getActive.
      Returns:
      a Residue object.
    • getAminoAcid3

      public AminoAcidUtils.AminoAcid3 getAminoAcid3()
      getAminoAcid3.

      Returns the AminoAcid3 of the active residue.

      Overrides:
      getAminoAcid3 in class Residue
      Returns:
      a AminoAcidUtils.AminoAcid3 object.
    • getAngles

      public MSNode getAngles()
      Returns the MultiScaleGroup's angles FNode.
      Overrides:
      getAngles in class MSGroup
      Returns:
      a MSNode object.
    • setAngles

      public void setAngles(MSNode t)
      Sets the Angles node to t.
      Overrides:
      setAngles in class MSGroup
      Parameters:
      t - a MSNode object.
    • getAtomNode

      public MSNode getAtomNode()
      Returns the AtomNode.
      Overrides:
      getAtomNode in class MSGroup
      Returns:
      a MSNode object.
    • setAtomNode

      public void setAtomNode(MSNode t)
      Sets the Moieties node to t.
      Overrides:
      setAtomNode in class MSGroup
      Parameters:
      t - a MSNode object.
    • getAtomNode

      public MSNode getAtomNode(int index)
      Returns the MSNode at the given index.
      Overrides:
      getAtomNode in class MSGroup
      Parameters:
      index - The index of the AtomNode to return.
      Returns:
      a MSNode object.
    • getAtomNode

      public MSNode getAtomNode(String n)
      Returns the AtomNode specified by the String n.
      Overrides:
      getAtomNode in class MSGroup
      Parameters:
      n - a String object.
      Returns:
      a MSNode object.
    • getAtomNodeList

      public List<MSNode> getAtomNodeList()
      Returns a List of the AtomNode's children.
      Overrides:
      getAtomNodeList in class MSGroup
      Returns:
      a List object.
    • getBond

      public Bond getBond(String id)
      Returns the Bond with the given id.
      Overrides:
      getBond in class MSGroup
      Parameters:
      id - a String object.
      Returns:
      a Bond object.
    • getBond

      public Bond getBond(int index)
      Returns the Bond at the supplied index.
      Overrides:
      getBond in class MSGroup
      Parameters:
      index - The index of the Bond to return.
      Returns:
      a Bond object.
    • getBonds

      public MSNode getBonds()
      Returns the MultiScaleGroup's bonds FNode.
      Overrides:
      getBonds in class MSGroup
      Returns:
      a MSNode object.
    • setBonds

      public void setBonds(MSNode t)
      Sets the Bonds node to t.
      Overrides:
      setBonds in class MSGroup
      Parameters:
      t - a MSNode object.
    • getCenter

      public double[] getCenter()
      Returns the MultiScaleGroup's center as a double[3].
      Overrides:
      getCenter in class MSGroup
      Returns:
      an array of double.
    • setCenter

      public void setCenter(double[] d)
      Set the value of Center to d.
      Overrides:
      setCenter in class MSGroup
      Parameters:
      d - an array of double.
    • getConsideredResidues

      public List<Residue> getConsideredResidues()
      Returns a copy of this MultiResidue's consideredResidues array.
      Returns:
      a new List of the considered residues.
    • getDanglingAtoms

      public List<Atom> getDanglingAtoms()
      Returns the MultiScaleGroup's dangling Atoms list.
      Overrides:
      getDanglingAtoms in class MSGroup
      Returns:
      a List object.
    • setDanglingAtoms

      public void setDanglingAtoms(List<Atom> a)
      Sets the MultiScaleGroup's danglingAtoms member to a.
      Overrides:
      setDanglingAtoms in class MSGroup
      Parameters:
      a - a List object.
    • getInactive

      public List<Residue> getInactive()
      Returns a list of this MultiResidue's inactive residues. Adding/removing from the returned list does nothing.
      Returns:
      a new List of inactive residues.
    • getMultiScaleCenter

      public double[] getMultiScaleCenter(boolean w)
      This method finds the Geometrical center of this MultiScaleGroup, or the atomicWeight-weighted center if w is set to true, and returns it as a double[3].
      Overrides:
      getMultiScaleCenter in class MSGroup
      Parameters:
      w - a boolean.
      Returns:
      an array of double.
    • getName

      public String getName()
      Returns the name of this MSNode.
      Overrides:
      getName in class MSNode
      Returns:
      a String object.
    • getResidueCount

      public int getResidueCount()
      getResidueCount.
      Returns:
      The number of residues in this MultiResidue.
    • getRotamers

      public Rotamer[] getRotamers()
      Return all currently set rotamers.
      Overrides:
      getRotamers in class Residue
      Returns:
      All current rotamers for this residue.
    • setRotamers

      public Rotamer[] setRotamers(RotamerLibrary library)
      Resets the rotamers for this residue, potentially incorporating the original coordinates if RotamerLibrary's original coordinates rotamer flag has been set.

      Any rotamers that were set previously are deleted.

      Overrides:
      setRotamers in class Residue
      Parameters:
      library - Rotamer library to use
      Returns:
      An array of Rotamer.
    • getSideChainAtoms

      public List<Atom> getSideChainAtoms()
      Returns a list of side chain atoms; for our purposes, nucleic acid side chain atoms are the sugar and the phosphate.
      Overrides:
      getSideChainAtoms in class Residue
      Returns:
      List of side chain (or nucleic backbone) atoms.
    • getTermNode

      public MSNode getTermNode()
      Returns the MultiScaleGroup's terms FNode.
      Overrides:
      getTermNode in class MSGroup
      Returns:
      a MSNode object.
    • getTorsions

      public MSNode getTorsions()
      Returns the MultiScaleGroup's Torsion MSNode.
      Overrides:
      getTorsions in class MSGroup
      Returns:
      a MSNode object.
    • setTorsions

      public void setTorsions(MSNode t)
      Sets the MultiScaleGroup's torsion node to t.
      Overrides:
      setTorsions in class MSGroup
      Parameters:
      t - a MSNode object.
    • getVariableAtoms

      public List<Atom> getVariableAtoms()
      Returns a list of atoms liable to change during dead-end elimination repacking. For ordinary amino acids: side chain atoms. For ordinary nucleic acids: sugar/phosphate backbone atoms. MultiResidue over-rides this to return all atoms (as backbone atom types are non-constant).

      Returns all atoms (all atoms are variable during DEE).

      Overrides:
      getVariableAtoms in class Residue
      Returns:
      Atoms changeable during DEE.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Residue
    • isFinalized

      public boolean isFinalized()
      Returns true if the MultiScaleGroup is finalized.
      Overrides:
      isFinalized in class MSGroup
      Returns:
      a boolean.
    • setFinalized

      public void setFinalized(boolean t)
      Specifies whether the MultiScaleGroup has been finalized.
      Overrides:
      setFinalized in class MSGroup
      Parameters:
      t - a boolean.
    • reOrderAtoms

      public void reOrderAtoms()
      reOrderAtoms
      Overrides:
      reOrderAtoms in class MSGroup
    • setActiveResidue

      public boolean setActiveResidue(int i)
      Request the ith residue be set active.
      Parameters:
      i - The index of the residue to set active.
      Returns:
      true if the ith residue was set active, false otherwise.
    • setActiveResidue

      public boolean setActiveResidue(Residue residue)
      Setter for the field activeResidue.
      Parameters:
      residue - a Residue object.
      Returns:
      a boolean.
    • setActiveResidue

      public boolean setActiveResidue(AminoAcidUtils.AminoAcid3 aa)
      Method may be redundant with requestSetActiveResidue. Will not function correctly if there is more than one residue of type UNK (unknown).
      Parameters:
      aa - a AminoAcidUtils.AminoAcid3 object.
      Returns:
      True if successful
    • 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 Residue
      Parameters:
      newColorModel - a RendererCache.ColorModel object.
      color - a Color3f object.
      mat - a Material object.
    • setOutOfPlaneBends

      public void setOutOfPlaneBends(MSNode t)
      Sets the Out-of-Plane Bend node to t.
      Overrides:
      setOutOfPlaneBends in class MSGroup
      Parameters:
      t - a MSNode object.
    • setPiOrbitalTorsions

      public void setPiOrbitalTorsions(MSNode t)
      Sets the MultiScaleGroup's Pi-Orbital Torsion node to t.
      Overrides:
      setPiOrbitalTorsions in class MSGroup
      Parameters:
      t - a MSNode object.
    • setStretchBends

      public void setStretchBends(MSNode t)
      Sets the Stretch-Bends node to t.
      Overrides:
      setStretchBends in class MSGroup
      Parameters:
      t - a MSNode object.
    • setTerms

      public void setTerms(MSNode t)
      Sets the MultiScaleGroup's terms node to t.
      Overrides:
      setTerms in class MSGroup
      Parameters:
      t - a MSNode object.
    • setTorsionTorsions

      public void setTorsionTorsions(MSNode t)
      Sets the MultiScaleGroup's Torsion-Torsion node to t.
      Overrides:
      setTorsionTorsions in class MSGroup
      Parameters:
      t - a MSNode object.
    • setUreyBradleys

      public void setUreyBradleys(MSNode t)
      Sets the Urey-Bradley node to t.
      Overrides:
      setUreyBradleys in class MSGroup
      Parameters:
      t - a MSNode 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.
    • storeState

      public ResidueState storeState()
      storeState.

      Publicly accessible method for storing a MultiResidue state.

      Overrides:
      storeState in class Residue
      Returns:
      a ResidueState object.
    • toString

      public String toString()

      Overridden toString method returns the MSNode's name

      Returns the MSGroup's name.

      Overrides:
      toString in class Residue
    • update

      public void update()
      update
      Specified by:
      update in interface ROLS
      Overrides:
      update in class MSGroup
    • updateAtoms

      public void updateAtoms()
      updateAtoms
      Overrides:
      updateAtoms in class MSGroup
    • updateBonds

      public void updateBonds()
      updateBonds
      Overrides:
      updateBonds in class MSGroup
    • revertState

      public void revertState(ResidueState state)
      Description copied from class: Residue
      revertState.
      Overrides:
      revertState in class Residue
      Parameters:
      state - a ResidueState object.