edu.sdsc.mbt
Class Chain

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

public class Chain
extends StructureComponent
implements java.lang.Cloneable

Implements a StructureComponent container for chain information. This may be an amino acid chain (eg: protein), a nucleic acid chain (eg: RNA/DNA), or a ligand chain. This class contains a list of Residue records.

Author:
John L. Moreland
See Also:
Residue, StructureComponent, Structure, StructureMap, Serialized Form

Field Summary
 java.lang.String id
           
 short quality
           
 short render
           
 boolean visible
           
 
Fields inherited from class edu.sdsc.mbt.StructureComponent
structure
 
Constructor Summary
Chain()
          Construct a Chain.
 
Method Summary
 void addResidue(Residue residue)
          Add a Residue record to this Chain.
 void addResidue(Residue residue, int position)
          Add a Residue record to this Chain at the specified position.
 java.lang.Object clone()
          Clone this object.
 void copy(StructureComponent structureComponent)
          Copy all of the field values from the parameter object into "this".
 void generateFragments()
          Regenerate the vector of Fragment objects from the fragments RangeMap.
 int getAtomCount()
          Get the number of Atoms contained in the Residues of this Chain.
 java.lang.String getChainId()
          Return the chain ID by asking the first Atom of the first Residue.
 java.lang.String getClassification()
          Return the chain classification by asking the first residue.
static java.lang.String getClassName()
          This method returns the fully qualified name of this class.
 Fragment getFragment(int fragmentIndex)
          Get the specified Fragment object.
 int getFragmentCount()
          Get the number of fragments (residue ranges) currently assigned to this chain.
 int getFragmentEndResidue(int fragmentIndex)
          Get the end residue index for the given fragment.
 java.util.Vector getFragments()
          Get the fragments for this chain.
 int getFragmentStartResidue(int fragmentIndex)
          Get the start residue index for the given fragment.
 java.lang.String getFragmentType(int fragmentIndex)
          Get the conformation type currently assigned to the given fragment.
 Residue getResidue(int index)
          Return the specified Residue record contained in this Chain.
 int getResidueCount()
          Return the number of Residue records contained in this Chain.
 int getResidueIndex(Residue residue)
          Return the specified Residue index in this Chain.
 java.lang.String getStructureComponentType()
          This method returns the fully qualified name of this class.
 boolean isVisible()
           
 void removeAllResidues()
          Remove all Residue records from this Chain.
 void removeResidue(int index)
          Remove the specified Residue record from this Chain.
 void removeResidue(Residue residue)
           
 void setFragment(int startResidue, int endResidue, java.lang.String type)
          Set a range of residues in this chain's fragment map to the specified Conformation type.
 
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

id

public java.lang.String id

render

public short render

quality

public short quality

visible

public boolean visible
Constructor Detail

Chain

public Chain()
Construct a Chain.

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 chain classification by asking the first residue. (eg: amino acid, nucleic acid, ligand). If there are no residues in this chain, this method will return null.


getChainId

public java.lang.String getChainId()
Return the chain ID by asking the first Atom of the first Residue. If there are no residues or atoms, "A" is returned.


getAtomCount

public int getAtomCount()
Get the number of Atoms contained in the Residues of this Chain.


getResidueCount

public int getResidueCount()
Return the number of Residue records contained in this Chain.


getResidue

public Residue getResidue(int index)
Return the specified Residue record contained in this Chain.


getResidueIndex

public int getResidueIndex(Residue residue)
Return the specified Residue index in this Chain.


addResidue

public void addResidue(Residue residue)
Add a Residue record to this Chain.


addResidue

public void addResidue(Residue residue,
                       int position)
Add a Residue record to this Chain at the specified position.


removeAllResidues

public void removeAllResidues()
Remove all Residue records from this Chain.


removeResidue

public void removeResidue(int index)
Remove the specified Residue record from this Chain.


removeResidue

public void removeResidue(Residue residue)

setFragment

public void setFragment(int startResidue,
                        int endResidue,
                        java.lang.String type)
Set a range of residues in this chain's fragment map to the specified Conformation type.


getFragmentCount

public int getFragmentCount()
Get the number of fragments (residue ranges) currently assigned to this chain.


getFragmentType

public java.lang.String getFragmentType(int fragmentIndex)
Get the conformation type currently assigned to the given fragment.


getFragmentStartResidue

public int getFragmentStartResidue(int fragmentIndex)
Get the start residue index for the given fragment.


getFragmentEndResidue

public int getFragmentEndResidue(int fragmentIndex)
Get the end residue index for the given fragment.


generateFragments

public void generateFragments()
Regenerate the vector of Fragment objects from the fragments RangeMap.


getFragment

public Fragment getFragment(int fragmentIndex)
Get the specified Fragment object.


getFragments

public java.util.Vector getFragments()
Get the fragments for this chain.


isVisible

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