|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.structure.Chain
public class Chain
A Chain serves as a container for Residues (AminoAcid, Heterogen, and Water) and Regions (Loop, Helix, and BetaStrand).
Constructor Summary | |
---|---|
Chain(String chainID,
String modelID,
String structureID)
Constructs a Chain with the requested chainID, modelID, and structureID. |
Method Summary | |
---|---|
void |
accept(Visitor visitor)
Accepts a Visitor and does a callback. |
AminoAcid |
addNewAminoAcid(AminoAcidEnum type,
String residueID)
Creates a new AminoAcid with the type and Residue ID given as arguments, adds the AminoAcid to the Chain's collection of AminoAcids, and returns a reference to the new AminoAcid. |
BetaStrand |
addNewBetaStrand(String betaStrandID,
String betaStrandNumber,
String sheetID,
String startResidueID,
String endResidueID,
int sense,
int strandsInSheet)
Creates a new BetaStrand with the BetaStrand ID given as an argument, adds the BetaStrand to the Chain's collection of BetaStrands, and returns a reference to the new BetaStrand. |
Helix |
addNewHelix(String helixID,
String serialNo,
String startResidueID,
String endResidueID,
HelixEnum type)
Creates a new Helix with the Helix ID given as an argument, adds the Helix to the Chain's collection of Helices, and returns a reference to the new Helix. |
Heterogen |
addNewHeterogen(String name,
String residueID)
Creates a new Heterogen with the name and Residue ID given as arguments, adds the Heterogen to the Chain's collection of Heterogens, and returns a reference to the new Heterogen. |
Loop |
addNewLoop(String loopID,
String startResidueID,
String endResidueID)
Creates a new Loop with the Loop ID given as an argument, adds the Loop to the Chain's collection of Loops, and returns a reference to the new Loop. |
Water |
addNewWater(String residueID)
Creates a new Water with the Residue ID given as an argument, adds the Water to the Chain's collection of Waters, and returns a reference to the new Water. |
AminoAcid |
getAminoAcid(String residueID)
Returns the AminoAcid with the residueID given as an argument. |
BetaStrand |
getBetaStrand(String betaStrandID)
Returns the BetaStrand with the betaStrandID given as an argument. |
String |
getChainID()
Returns the chainID, which is usually a single letter. |
Helix |
getHelix(String helixID)
Returns the Helix with the helixID given as an argument. |
Heterogen |
getHeterogen(String residueID)
Returns the Heterogen with the residueID given as an argument. |
String |
getModelID()
Returns the modelID of the Model this Chain belongs to. |
Residue |
getResidue(String residueID)
Returns the Residue with the residueID given as an argument. |
String |
getStructureID()
Returns the structureID of the Structure this Chain belongs to. |
Water |
getWater(String residueID)
Returns the Water with the residueID given as an argument. |
Iterator<AminoAcid> |
iteratorAminoAcids()
Returns an Iterator for the AminoAcids held by this Chain. |
Iterator<BetaStrand> |
iteratorBetaStrands()
Returns an Iterator for the BetaStrands held by this Chain. |
Iterator<Helix> |
iteratorHelices()
Returns an Iterator for the Helices held by this Chain. |
Iterator<Heterogen> |
iteratorHeterogens()
Returns an Iterator for the Heterogens held by this Chain. |
Iterator<Loop> |
iteratorLoops()
Returns an Iterator for the Loops held by this Chain. |
Iterator<Water> |
iteratorWaters()
Returns an Iterator for the Water molecules held by this Chain. |
int |
numberOfAminoAcids()
Returns the number of AminoAcids held by this Chain. |
int |
numberOfBetaStrands()
Returns the number of BetaStrands held by this Chain. |
int |
numberOfHelices()
Returns the number of Helices held by this Chain. |
int |
numberOfHeterogens()
Returns the number of Heterogens held by this Chain. |
int |
numberOfLoops()
Returns the number of Loops held by this Chain. |
int |
numberOfWaters()
Returns the number of Waters held by this Chain. |
String |
processID(String id,
String typeOfID)
Returns the ID after trimming any leading or trailing whitespace. |
void |
sortBetaStrands()
After all BetaStrand objects have been added to the Chain, this method can be called to sort the linked hash map (the linked list part does have order) according to the starting residue for each beta-strand. |
String |
toString()
Returns the chainID, which is usually a single letter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Chain(String chainID, String modelID, String structureID) throws InvalidIDException
chainID
- the Chain letter.modelID
- the Model number.structureID
- the ID code assigned by the Protein Data Bank.
InvalidIDException
- if chainID is null or does not have at
least one non-whitespace character.Method Detail |
---|
public void accept(Visitor visitor) throws VisitorException
accept
in interface Visitable
visitor
- the Visitor to do a callback with.
VisitorException
- if an error occurs while an object is
being visited.public AminoAcid addNewAminoAcid(AminoAcidEnum type, String residueID) throws MissingAATypeException, InvalidIDException
type
- the AminoAcid type as an AminoAcidEnum.residueID
- the ID of the AminoAcid.
MissingAATypeException
- if type is null.
InvalidIDException
- if residueID is null or does not have
at least one non-whitespace character.public Heterogen addNewHeterogen(String name, String residueID) throws MissingHetNameException, InvalidIDException
name
- the name of the Heterogen.residueID
- the ID to assign the Heterogen.
MissingHetNameException
- if name is null or does not have
at least one non-whitespace
character.
InvalidIDException
- if residueID is null or does not have
at least one non-whitespace character.public Water addNewWater(String residueID) throws InvalidIDException
residueID
- the ID to assign the Water.
InvalidIDException
- if residueID is null or does not have
at least one non-whitespace character.public Loop addNewLoop(String loopID, String startResidueID, String endResidueID) throws InvalidRegionException, InvalidIDException
loopID
- Loop identifier ("Loop 1", "Loop 2", etc.).startResidueID
- ID of the first AminoAcid in the sequence.endResidueID
- ID of the last AminoAcid in the sequence.
InvalidRegionException
- if the sequence of AminoAcids
(with at least two Residues)
cannot be found on the Chain, or
if the first or last AminoAcid
does not have an alpha carbon.
InvalidIDException
- if the loopID, startResidueID, or
endResidueID is null or does not have
at least one non-whitespace character.public Helix addNewHelix(String helixID, String serialNo, String startResidueID, String endResidueID, HelixEnum type) throws InvalidRegionException, InvalidIDException
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.type
- type of Helix as a HelixEnum.
InvalidRegionException
- if the sequence of AminoAcids
(with at least two Residues)
cannot be found on the Chain, or
if the first or last AminoAcid
does not have an alpha carbon.
InvalidIDException
- if the helixID, serialNo,
startResidueID, or endResidueID is
null or does not have at least one
non-whitespace character.public BetaStrand addNewBetaStrand(String betaStrandID, String betaStrandNumber, String sheetID, String startResidueID, String endResidueID, int sense, int strandsInSheet) throws InvalidRegionException, InvalidIDException
betaStrandID
- unique ID (betaStrandNumber plus sheetID).betaStrandNumber
- Strand number from PDB SHEET record.sheetID
- sheet identifier from a PDB SHEET recordstartResidueID
- ID of the first AminoAcid in the sequence.endResidueID
- ID of the last AminoAcid in the sequence.sense
- strand sense (0, 1, or -1).strandsInSheet
- total number of BetaStrands in the sheet.
InvalidRegionException
- if the sequence of AminoAcids
(with at least two Residues)
cannot be found on the Chain, or
if the first or last AminoAcid
does not have an alpha carbon.
InvalidIDException
- if the betaStrandID, sheetID,
startResidueID, or endResidueID is
null or does not have at least one
non-whitespace character.public void sortBetaStrands()
public String getChainID()
public String getModelID()
public String getStructureID()
public Residue getResidue(String residueID)
residueID
- the unique ID for the desired Residue.
public AminoAcid getAminoAcid(String residueID)
residueID
- the unique ID for the desired AminoAcid.
public Heterogen getHeterogen(String residueID)
residueID
- the unique ID for the desired Heterogen.
public Water getWater(String residueID)
residueID
- the unique ID for the desired Water.
public Helix getHelix(String helixID)
helixID
- the unique ID for the desired Helix.
public BetaStrand getBetaStrand(String betaStrandID)
betaStrandID
- the unique ID for the desired BetaStrand.
public Iterator<AminoAcid> iteratorAminoAcids()
public Iterator<Heterogen> iteratorHeterogens()
public Iterator<Water> iteratorWaters()
public Iterator<Loop> iteratorLoops()
public Iterator<Helix> iteratorHelices()
public Iterator<BetaStrand> iteratorBetaStrands()
public int numberOfAminoAcids()
public int numberOfHeterogens()
public int numberOfWaters()
public int numberOfLoops()
public int numberOfHelices()
public int numberOfBetaStrands()
public String processID(String id, String typeOfID) throws InvalidIDException
processID
in interface IDTest
id
- ID to process.typeOfID
- type of ID (for possible use in error message).
InvalidIDException
- if the trimmed ID does not have at
least one character.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |