org.proteinshader.structure
Class Helix

java.lang.Object
  extended by org.proteinshader.structure.Region
      extended by org.proteinshader.structure.Helix
All Implemented Interfaces:
IDTest, Visitable

public class Helix
extends Region

This concrete subclass of Region holds information specific to a protein Helix.

PDB HELIX records are usually generated automatically with the Kabsch and Sander algoritnm (Kabsch and Sander, 1983, Biopolymers 22: 2577-2637), but they may be specified by the depositor of the structure entry.


Field Summary
static HelixShapeEnum DEFAULT_SHAPE
          The default Helix shape is ALPHA_RIBBON.
static HelixEnum DEFAULT_TYPE
          The default Helix type is RH_ALPHA.
 
Constructor Summary
Helix(String helixID, String serialNo, String startResidueID, String endResidueID, Chain chain, HelixEnum type, HelixShapeEnum shape)
          Constructs a Helix.
 
Method Summary
 void accept(Visitor visitor)
          Accepts a Visitor and does a callback.
 String getHelixID()
          Returns the Helix ID.
 String getSerialNo()
          Returns the serial number of the Helix.
 HelixShapeEnum getShape()
          Returns the shape that should be used to represent the Helix.
 HelixEnum getType()
          Returns the type of Helix.
 void setShape(HelixShapeEnum shape)
          Sets the shape that should be used to represent the Helix.
 void setShapeToDefault()
          Sets the shape the default value, DEFAULT_SHAPE.
 void setType(HelixEnum type)
          Sets the type of Helix.
 String toString()
          Returns the Helix ID.
 
Methods inherited from class org.proteinshader.structure.Region
createSegments, getAminoAcidAfterRegion, getAminoAcidBeforeRegion, getChainID, getEndResidueID, getModelID, getSegment, getStartResidueID, getStructureID, iteratorAminoAcids, iteratorSegments, markAminoAcids, numberOfAminoAcids, numberOfSegments, processID, setSegmentAlpha, setSegmentAlphaToDefault, setSegmentRGB, setSegmentRGBToDefault, setSegmentsToAminoAcidColors, setSegmentsToRegionColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_TYPE

public static final HelixEnum DEFAULT_TYPE
The default Helix type is RH_ALPHA.


DEFAULT_SHAPE

public static final HelixShapeEnum DEFAULT_SHAPE
The default Helix shape is ALPHA_RIBBON.

Constructor Detail

Helix

public Helix(String helixID,
             String serialNo,
             String startResidueID,
             String endResidueID,
             Chain chain,
             HelixEnum type,
             HelixShapeEnum shape)
      throws InvalidRegionException,
             InvalidIDException
Constructs a Helix.

Region (the superclass of Helix) will cache the Residues from startResidueID to endResidueID (or throw an exception) so that an iterator to the Region's sequence can be easily obtained. If the Region is constructed successfully, each AminoAcid in the Region will be marked with the helixID.

If null is given as a type or shape argument, the constructor will use DEFAULT_TYPE or DEFAULT_SHAPE, respectively.

Any leading or trailing whitespace will be trimmed from the helixID, serialNo, startResidueID, and the endResidueID. The ancestor IDs (Chain, Model, and Structure) will be stored after they are obtained from the Chain given as an argument.

Parameters:
helixID - Helix identifier from a PDB HELIX record.
serialNo - serial number of the Helix.
startResidueID - ID of the first AminoAcid in the sequence.
endResidueID - ID of the last AminoAcid in the sequence.
chain - Chain the Helix belongs to.
type - type of Helix as a HelixEnum
shape - shape to use to represent the Helix.
Throws:
InvalidRegionException - if the sequence of AminoAcids (with at least two Residues) cannot be found on the Chain.
InvalidIDException - if the helixID, serialNo, startResidueID, or endResidueID is null or does not have at least one non-whitespace character.
Method Detail

accept

public void accept(Visitor visitor)
            throws VisitorException
Accepts a Visitor and does a callback.

Specified by:
accept in interface Visitable
Specified by:
accept in class Region
Parameters:
visitor - the Visitor to do a callback with.
Throws:
VisitorException - if an error occurs while an object is being visited.

getHelixID

public String getHelixID()
Returns the Helix ID. The String returned cannot be null or empty, because the constructor checks that this read-only attribute has at least one character.

Returns:
The Helix ID as a String.

getSerialNo

public String getSerialNo()
Returns the serial number of the Helix.

Returns:
The serial number as a String.

getType

public HelixEnum getType()
Returns the type of Helix.

Returns:
The type as a HelixEnum.

setType

public void setType(HelixEnum type)
Sets the type of Helix. If null is given as an argument, the type is set to DEFAULT_TYPE.

Parameters:
type - the type as a HelixEnum.

getShape

public HelixShapeEnum getShape()
Returns the shape that should be used to represent the Helix.

Returns:
The shape as a HelixShapeEnum.

setShape

public void setShape(HelixShapeEnum shape)
Sets the shape that should be used to represent the Helix. If null is given as an argument, the shape is set to DEFAULT_SHAPE.

Parameters:
shape - the shape as a HelixShapeEnum.

setShapeToDefault

public void setShapeToDefault()
Sets the shape the default value, DEFAULT_SHAPE.


toString

public String toString()
Returns the Helix ID. The String returned cannot be null or empty, because the constructor checks that this read-only attribute has at least one character.

Overrides:
toString in class Object
Returns:
The Helix ID as a String.


Copyright © 2007-2008