Class Residue

All Implemented Interfaces:
ROLS, Serializable, Cloneable, Comparable<Residue>, MutableTreeNode, TreeNode
Direct Known Subclasses:
MultiResidue

public class Residue extends MSGroup implements Comparable<Residue>
The Residue class represents individual amino acids or nucleic acid bases.
Since:
1.0
Author:
Michael J. Schnieders, Jacob M. Litman
See Also:
  • Field Details

    • Ramachandran

      public static String[] Ramachandran
      Constant Ramachandran="new String[17]"
  • Constructor Details

    • Residue

      public Residue(int num, Residue.ResidueType residueType)
      Default Constructor where num is this Residue's position in the Polymer.
      Parameters:
      num - The residue number.
      residueType - The residue type.
    • Residue

      public Residue(String name, Residue.ResidueType residueType)
      Constructor for Residue.
      Parameters:
      name - The residue name.
      residueType - The residue type.
    • Residue

      public Residue(String name, int num, Residue.ResidueType residueType)
      Name is the residue's 3 letter abbreviation and num is its position in the Polymer.
      Parameters:
      name - The residue name.
      num - The residue number.
      residueType - The residue type.
    • Residue

      public Residue(String name, int resNumber, Residue.ResidueType residueType, Character chainID, String segID)
      Name is the residue's 3 letter abbreviation and num is its position in the Polymer.
      Parameters:
      name - The residue name.
      resNumber - The residue number.
      residueType - The residue type.
      chainID - The chain ID.
      segID - The segment ID.
    • Residue

      public Residue(String name, int resNumber, MSNode atoms, Residue.ResidueType residueType, ForceField forceField)
      As above, with atoms being a MSNode with this Residue's atoms as child nodes
      Parameters:
      name - The residue name.
      resNumber - The residue number.
      atoms - a MSNode object.
      residueType - The residue type.
      forceField - the ForceField to use when created bonded terms.
  • Method Details

    • setName

      public void setName(String name)
      Description copied from class: MSNode
      Sets the name of this NodeObject to n.
      Overrides:
      setName in class MSNode
      Parameters:
      name - a String object.
    • 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.

      Specified by:
      addMSNode in class MSGroup
      Parameters:
      o - a MSNode object.
      Returns:
      a MSNode object.
    • compareTo

      public int compareTo(Residue o)
      Specified by:
      compareTo in interface Comparable<Residue>
    • drawLabel

      public void drawLabel(org.jogamp.java3d.Canvas3D canvas, org.jogamp.java3d.J3DGraphics2D g2d, org.jogamp.java3d.Node node)
      drawLabel
      Specified by:
      drawLabel in interface ROLS
      Overrides:
      drawLabel in class MSNode
      Parameters:
      canvas - a Canvas3D object.
      g2d - a J3DGraphics2D object.
      node - a Node 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.

      Overrides:
      equals in class MSNode
    • 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.

      Specified by:
      finalize in class MSGroup
      Parameters:
      finalizeGeometry - a boolean.
      forceField - the ForceField parameters to use when finalizing the MSGroup.
    • setTitrationUtils

      public void setTitrationUtils(TitrationUtils titrationUtils)
    • getTitrationUtils

      public TitrationUtils getTitrationUtils()
    • getAminoAcid3

      public AminoAcidUtils.AminoAcid3 getAminoAcid3()
      getAminoAcid3.
      Returns:
      a AminoAcidUtils.AminoAcid3 object.
    • getBackboneAtoms

      public List<Atom> getBackboneAtoms()
      Returns a list of backbone atoms; for our purposes, nucleic acid backbone atoms are those of the nucleobase.
      Returns:
      List of backbone (or nucleobase) atoms.
    • getChainID

      public Character getChainID()
      Returns this Residues Parent Polymer name.
      Returns:
      a Character object.
    • setChainID

      public void setChainID(Character c)
      Setter for the field chainID.
      Parameters:
      c - a Character object.
    • setSegID

      public void setSegID(String segID)
      Setter for the field segID.
      Parameters:
      segID - The segID to use.
    • getNextResidue

      public Residue getNextResidue()
      Returns the Residue bonded to this Residue at this Residue's 3' or C-terminal end. Any use of this method to add Residues to a sliding window or similar MUST not add that residue if that residue has no Rotamers, as several algorithms (such as the distance matrix) assume that all Residues being optimized have Rotamers.
      Returns:
      The next Residue.
    • getNucleicAcid3

      public NucleicAcidUtils.NucleicAcid3 getNucleicAcid3()
      getNucleicAcid3.
      Returns:
      a NucleicAcidUtils.NucleicAcid3 object.
    • getNucleicAcid3

      public NucleicAcidUtils.NucleicAcid3 getNucleicAcid3(boolean matchShortName)
      Returns the NucleicAcid3 corresponding to this Residue, with additional robust checking for 1- or 2-letter names.
      Parameters:
      matchShortName - Try to match 1- or 2-letter names (e.g. A to ADE).
      Returns:
      a NucleicAcidUtils.NucleicAcid3 object.
    • getPreviousResidue

      public Residue getPreviousResidue()
      Returns the Residue bonded to this Residue at this Residue's 5' or N-terminal end. Any use of this method to add Residues to a sliding window or similar MUST not add that residue if that residue has no Rotamers, as several algorithms (such as the distance matrix) assume that all Residues being optimized have Rotamers.
      Returns:
      The previous Residue.
    • getReferenceAtom

      public Atom getReferenceAtom()
      Returns a reference Atom for a Residue, primarily intended for rough distance calculations. This atom should be roughly centrally located within the residue, and be invariant.
      Returns:
      A reference Atom.
    • getResidueNumber

      public int getResidueNumber()
      Returns this Residue's sequence number.
      Returns:
      The sequence number.
    • getResidueType

      public Residue.ResidueType getResidueType()
      Getter for the field residueType.
      Returns:
      a Residue.ResidueType object.
    • getRotamer

      public Rotamer getRotamer()
      Get the current rotamer.
      Returns:
      a Rotamer object.
    • setRotamer

      public void setRotamer(Rotamer rotamer)
      Set the current rotamer.
      Parameters:
      rotamer - a Rotamer object.
    • getRotamers

      public Rotamer[] getRotamers()
      Return all currently set rotamers.
      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.

      Parameters:
      library - Rotamer library to use
      Returns:
      An array of Rotamer.
    • setRotamers

      public Rotamer[] setRotamers()
      Sets the original coordinate rotamers for titratable residues RotamerLibrary's original coordinates rotamer flag has been set.

      Any rotamers that were set previously are deleted.

      Returns:
      An array of Rotamer.
    • getSegID

      public String getSegID()
      Getter for the field segID.
      Returns:
      a String object.
    • 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.
      Returns:
      List of side chain (or nucleic backbone) atoms.
    • 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:
      Atoms changeable during DEE.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class MSNode
    • initializeDefaultAtomicCoordinates

      public void initializeDefaultAtomicCoordinates()
      Initializes this (presumably nucleic acid) Residue's C1s, O4s, C4s, O3sNorth, and O3sSouth default coordinates based on default PDB atom locations; to preserve rotamer independence, this must be called before any NA rotamers are applied.
    • print

      public void print()
      Prints the MSNode's name

      Prints the MultiScaleGroup's Atoms and Bonds.

      Prints "Residue Number: x" to stdout.

      Overrides:
      print in class MSGroup
    • revertState

      public void revertState(ResidueState state)
      revertState.
      Parameters:
      state - a ResidueState 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.
    • setNumber

      public void setNumber(int n)
      setNumber
      Parameters:
      n - The residue number.
    • storeCoordinateArray

      public double[][] storeCoordinateArray()
      storeCoordinateArray.
      Returns:
      an array of
      invalid reference
      double
      objects.
    • storeState

      public ResidueState storeState()
      storeState.
      Returns:
      a ResidueState object.
    • toFormattedString

      public String toFormattedString(boolean addResType, boolean addChainID)
      Formats this residue with some optional inclusions.

      [residue type]-[chain ID]ResNumber-Name.

      Parameters:
      addResType - Include the residue type
      addChainID - Include the chain ID.
      Returns:
      A descriptive string.
    • toString

      public String toString(Rotamer rotamer)
      A descriptive string based on a given rotamer.

      [chain ID]ResNumber-RotamerName.

      Parameters:
      rotamer - The rotamer to use.
      Returns:
      A descriptive string.
    • toString

      public String toString()

      Overridden toString method returns the MSNode's name

      Returns the MSGroup's name.

      Overrides:
      toString in class MSGroup