edu.sdsc.mbt
Class Residue

java.lang.Object
  extended byedu.sdsc.mbt.StructureComponent
      extended byedu.sdsc.mbt.Residue
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Residue
extends StructureComponent
implements java.lang.Cloneable, java.io.Serializable

Implements a StructureComponent container for residue information. This may be an amino acid residue, a nucleic acid residue, or a ligand. This class generally contains a list of Atom records, though it is perfectly fine to be empty when it is used only for sequence information.

See the "PROGRAMMING NOTE" section of the StructureComponent class.

Author:
John L. Moreland
See Also:
StructureComponent, Structure, StructureComponentIterator,

, Serialized Form


Field Summary
 Atom centerAtom
           
static java.lang.String COMPOUND_AMINO_ACID
          Residue compound classification is an amino acid.
static java.lang.String[] COMPOUND_CLASSIFICATIONS
           
static java.lang.String COMPOUND_DELETION
          Residue compound classification as a deletion.
static java.lang.String COMPOUND_LIGAND
          Residue compound classification is a ligand.
static java.lang.String COMPOUND_NUCLEIC_ACID
          Residue compound is a nucleic acid.
 short quality
           
 short render
           
 boolean ribbon
           
 boolean visible
           
 
Fields inherited from class edu.sdsc.mbt.StructureComponent
structure
 
Constructor Summary
Residue()
          Constructor variant used when there will likely be an atom list.
Residue(java.lang.String compoundCode)
          Constructor variant used when there will likely be no atom list (eg: when only sequence data is loaded).
 
Method Summary
 void addAtom(Atom atom)
          Add an Atom record to this Residue.
 java.lang.Object clone()
          Clone this object.
 boolean containsAtom(Atom atom)
          Tests whether the Residue contains a particular Atom.
 void copy(StructureComponent structureComponent)
          Copy all of the field values from the parameter object into "this".
 Atom getAlphaAtom()
          Get the alpha (backbone) Atom (eg: "CA" or "P") for this amino acid or nucleic acid residue (or -1 for ligands).
 int getAlphaAtomIndex()
          Get the alpha (backbone) Atom (eg: "CA" or "P") index for this amino acid or nucleic acid residue (or -1 for ligands).
 Atom getAtom(int index)
          Return the specified Atom record contained in this Residue.
 int getAtomCount()
          Return the number of Atom records contained in this Residue.
 int getAtomIndex(Atom atom)
           
 java.util.Vector getAtoms()
          Return Vector of Atoms that are contained in this Residue.
 java.lang.String getChainId()
          Get the chain id (as it is assigned in the first Atom record).
 java.lang.String getClassification()
          Return the compound classification for this residue.
static java.lang.String getClassName()
          This method returns the fully qualified name of this class.
 java.lang.String getCompoundCode()
          Get the 3-letter compound code for this residue.
 java.lang.String getConformationType()
          Get the secondary structure conformation type that is assigned to this residue.
 Fragment getFragment()
          Get the parent fragment (if any) for this residue.
 float getHydrophobicity()
          Return the Hydrophobicity of the amino acid residue as a normalized value from 0.0 to 1.0 inclusive.
 int getNumber()
           
 Atom getPolymerHeadAtom()
          Get the polymer "head" atom for this amino acid or nucleic acid residue (or null for ligands).
 Atom getPolymerTailAtom()
          Get the polymer "tail" atom for this amino acid or nucleic acid residue (or null for ligands).
 int getPosition()
           
 int getResidueId()
          Get the residue id (as it is assigned in the first Atom record).
 java.lang.String getStructureComponentType()
          This method returns the fully qualified name of this class.
 boolean isVisible()
           
 void removeAllAtoms()
          Remove all Atom records from this Residue.
 void removeAtom(Atom atom)
           
 void removeAtom(int index)
          Remove the specified Atom record from this Residue.
 void setAlphaAtom(Atom atom)
           
 void setAlphaAtomIndex(int index)
          Set the alpha (backbone) Atom index for this amino acid or nucleic acid residue.
 void setChainId(java.lang.String id)
           
 void setClassification(java.lang.String classification)
           
 void setCompoundCode(java.lang.String compoundCode)
          Set the 3-letter compound code for this residue.
 void setConformationType(java.lang.String type)
          Set the secondary structure conformation type that should be assigned to this residue.
 void setNumber(int n)
           
 void setPosition(int i)
           
 void setResidueId(int id)
           
 
Methods inherited from class edu.sdsc.mbt.StructureComponent
getStructure, setStructure
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPOUND_AMINO_ACID

public static final java.lang.String COMPOUND_AMINO_ACID
Residue compound classification is an amino acid.

See Also:
Constant Field Values

COMPOUND_NUCLEIC_ACID

public static final java.lang.String COMPOUND_NUCLEIC_ACID
Residue compound is a nucleic acid.

See Also:
Constant Field Values

COMPOUND_LIGAND

public static final java.lang.String COMPOUND_LIGAND
Residue compound classification is a ligand.

See Also:
Constant Field Values

COMPOUND_DELETION

public static final java.lang.String COMPOUND_DELETION
Residue compound classification as a deletion.

See Also:
Constant Field Values

COMPOUND_CLASSIFICATIONS

public static final java.lang.String[] COMPOUND_CLASSIFICATIONS

centerAtom

public Atom centerAtom

render

public short render

quality

public short quality

visible

public boolean visible

ribbon

public boolean ribbon
Constructor Detail

Residue

public Residue(java.lang.String compoundCode)
Constructor variant used when there will likely be no atom list (eg: when only sequence data is loaded).


Residue

public Residue()
Constructor variant used when there will likely be an atom list.

Method Detail

copy

public void copy(StructureComponent structureComponent)
Copy all of the field values from the parameter object into "this".

Specified by:
copy in class StructureComponent

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone this object.

Overrides:
clone in class StructureComponent
Throws:
java.lang.CloneNotSupportedException

getClassName

public static java.lang.String getClassName()
This method returns the fully qualified name of this class.

This name is used by the StructureComponentRegistry class to enable dynamic registration and discovery of new StructureComponent sub-classes/types. The name is also used to create a unique integer indentifier for each type in order to make run-time type comparisons fast.


getStructureComponentType

public java.lang.String getStructureComponentType()
This method returns the fully qualified name of this class.

Specified by:
getStructureComponentType in class StructureComponent

getClassification

public java.lang.String getClassification()
Return the compound classification for this residue. (eg: amino acid, nucleic acid, ligand, unknown).


setCompoundCode

public void setCompoundCode(java.lang.String compoundCode)
Set the 3-letter compound code for this residue.


getCompoundCode

public java.lang.String getCompoundCode()
Get the 3-letter compound code for this residue.


getAtomCount

public int getAtomCount()
Return the number of Atom records contained in this Residue.


getAtom

public Atom getAtom(int index)
Return the specified Atom record contained in this Residue.


getAtomIndex

public int getAtomIndex(Atom atom)

getAtoms

public java.util.Vector getAtoms()
Return Vector of Atoms that are contained in this Residue.


containsAtom

public boolean containsAtom(Atom atom)
Tests whether the Residue contains a particular Atom.


addAtom

public void addAtom(Atom atom)
Add an Atom record to this Residue.


removeAllAtoms

public void removeAllAtoms()
Remove all Atom records from this Residue.


removeAtom

public void removeAtom(Atom atom)

removeAtom

public void removeAtom(int index)
Remove the specified Atom record from this Residue.


getAlphaAtomIndex

public int getAlphaAtomIndex()
Get the alpha (backbone) Atom (eg: "CA" or "P") index for this amino acid or nucleic acid residue (or -1 for ligands).


getAlphaAtom

public Atom getAlphaAtom()
Get the alpha (backbone) Atom (eg: "CA" or "P") for this amino acid or nucleic acid residue (or -1 for ligands).


setAlphaAtom

public void setAlphaAtom(Atom atom)

getHydrophobicity

public float getHydrophobicity()
Return the Hydrophobicity of the amino acid residue as a normalized value from 0.0 to 1.0 inclusive. See the AminoAcid class for a description of what method is used to produce the hydrophobicity scale.


setConformationType

public void setConformationType(java.lang.String type)
Set the secondary structure conformation type that should be assigned to this residue.


getConformationType

public java.lang.String getConformationType()
Get the secondary structure conformation type that is assigned to this residue.


getChainId

public java.lang.String getChainId()
Get the chain id (as it is assigned in the first Atom record). Return null if there are no atom records.


setChainId

public void setChainId(java.lang.String id)

getResidueId

public int getResidueId()
Get the residue id (as it is assigned in the first Atom record). Return -1 if there are no atom records.


setResidueId

public void setResidueId(int id)

setNumber

public void setNumber(int n)

getNumber

public int getNumber()

setPosition

public void setPosition(int i)

getPosition

public int getPosition()

getFragment

public Fragment getFragment()
Get the parent fragment (if any) for this residue.


getPolymerHeadAtom

public Atom getPolymerHeadAtom()
Get the polymer "head" atom for this amino acid or nucleic acid residue (or null for ligands). This can be used to form polypeptide bonds between adjacent amino acids, or nucleic acid bonds between adjacent nucleic acids.


getPolymerTailAtom

public Atom getPolymerTailAtom()
Get the polymer "tail" atom for this amino acid or nucleic acid residue (or null for ligands). This can be used to form polypeptide bonds between adjacent amino acids, or nucleic acid bonds between adjacent nucleic acids.


setAlphaAtomIndex

public void setAlphaAtomIndex(int index)
Set the alpha (backbone) Atom index for this amino acid or nucleic acid residue. For for ligands this will be set to -1 (ie: no valid alpha atom). For disordered residues (that have no alpha atom) it may be set to an alternate index so that applicatons may still draw backbone traces through the residue.


setClassification

public void setClassification(java.lang.String classification)

isVisible

public boolean isVisible()
Specified by:
isVisible in class StructureComponent