|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.structure.Model
public class Model
A Model serves as a container for one or more Chains.
If a protein structure is determined by x-ray crystallography, there
is usually only a single model. However, if NMR (Nuclear Magnetic
Resonance imaging) is used, there are normally several possible models
that fit the data. The atomic coordinates will differ between the
models, but all other information is the same, so the models are all
stored in one PDB structure entry.
Constructor Summary | |
---|---|
Model(String modelID,
String structureID)
Constructs a Model with the requested modelID and structureID. |
Method Summary | |
---|---|
void |
accept(Visitor visitor)
Accepts a Visitor and does a callback. |
void |
addLoop(Loop loop)
Adds a Loop to the Model. |
void |
addNewBetaStrand(String chainID,
String betaStrandID,
String betaStrandNumber,
String sheetID,
String startResidueID,
String endResidueID,
int sense,
int strandsInSheet)
The BetaStrand will be added to the Chain only if the sequence of Residues that the BetaStrand refers to has already been added. |
Chain |
addNewChain(String chainID)
Creates a new Chain with the chainID given as an argument, adds the Chain to the Model's collection of Chains, and returns a reference to the new Chain. |
void |
addNewHelix(String chainID,
String helixID,
String serialNo,
String startResidueID,
String endResidueID,
HelixEnum type)
The Helix will be added to the Chain only if the sequence of Residues that the Helix refers to has already been added. |
void |
clearListsOfVisibles()
Clears the lists of opaque and translucent Drawable objects. |
BetaStrand |
getBetaStrand(String betaStrandID)
Returns the BetaStrand with the betaStrandID given as an argument. |
Chain |
getChain(String chainID)
Returns the Chain with the chainID given as an argument. |
double |
getDepth()
Returns the depth of the Model (maxZ - minZ). |
double |
getHeight()
Returns the height of the Model (maxY - minY). |
Helix |
getHelix(String helixID)
Returns the Helix with the helixID given as an argument. |
Loop |
getLoop(String loopID)
Returns the Loop with the loopID given as an argument. |
double |
getMaxDimension()
Returns the maximum dimension (the greatest of width, height, or depth). |
double |
getMaxX()
Returns the maximum x-coordinate value. |
double |
getMaxY()
Returns the maximum y-coordinate value. |
double |
getMaxZ()
Returns the maximum z-coordinate value. |
double |
getMinX()
Returns the minimum x-coordinate value. |
double |
getMinY()
Returns the minimum y-coordinate value. |
double |
getMinZ()
Returns the minimum z-coordinate value. |
String |
getModelID()
Returns the modelID, which is the Model's number. |
Drawable[] |
getOpaqueAtomsAndBonds()
Copies the list of opaque Atoms and Bonds into an array and returns the array. |
Segment[] |
getOpaqueSegments()
Copies the list of opaque Segments into an array and returns the array. |
Segment |
getSegment(String segmentID,
String regionID,
RegionEnum regionType)
Returns the requested Segment if it exists. |
String |
getStructureID()
Returns the structureID of the Structure this Model belongs to. |
Drawable[] |
getTranslucentDrawables()
Copies the list of translucent Drawables into an array and returns the array. |
double |
getWidth()
Returns the width of the Model (maxX - minX). |
double |
getX()
Returns the x-coordinate for the center of gravity of the Model. |
double |
getY()
Returns the y-coordinate for the center of gravity of the Model. |
double |
getZ()
Returns the z-coordinate for the center of gravity of the Model. |
boolean |
hasAminoAcids()
Returns true if the model holds any AminoAcids. |
boolean |
hasHeterogens()
Returns true if the model holds any Heterogens. |
boolean |
hasWaters()
Returns true if the model holds any Waters. |
Iterator<BetaStrand> |
iteratorBetaStrands()
Returns an Iterator for the BetaStrands held by this Model. |
Iterator<Chain> |
iteratorChains()
Returns an Iterator for the Chains held by this Model. |
Iterator<Helix> |
iteratorHelices()
Returns an Iterator for the Helices held by this Model. |
Iterator<Loop> |
iteratorLoops()
Returns an Iterator for the Loops held by this Model. |
int |
numberOfBetaStrands()
Returns the number of BetaStrands held by this Model. |
int |
numberOfChains()
Returns the number of Chains held by this Model. |
int |
numberOfHelices()
Returns the number of Helices held by this Model. |
int |
numberOfLoops()
Returns the number of Loops held by this Model. |
String |
processID(String id,
String typeOfID)
Returns the Model ID after trimming any leading or trailing whitespace. |
void |
setMinMaxXYZ(double minX,
double maxX,
double minY,
double maxY,
double minZ,
double maxZ)
Sets the minimum and maximum values for the xyz-coordinates. |
void |
sortBetaStrands()
Iterates through all Chains of the Model and modifies the linked hash map of beta-strands so that when an iterator for beta-strands is handed over (based on the linked list part) the beta-strands will be ordered according to the starting amino acid. |
String |
toString()
Returns the modelID, which is the Model's number. |
void |
updateListsOfVisibles(boolean includeAtoms,
boolean includeBonds,
boolean includeAminoAcids,
boolean includeHeterogens,
boolean includeWaters,
boolean includeSegments)
Finds visible Drawable objects and transfers them to a list of opaque Segments, opaque Atoms and Bonds, or a list of translucent Drawables. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Model(String modelID, String structureID) throws InvalidIDException
modelID
- the Model number.structureID
- the ID code assigned by the Protein Data Bank.
InvalidIDException
- if the Model ID is null or cannot be
converted to a positive integer.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 void updateListsOfVisibles(boolean includeAtoms, boolean includeBonds, boolean includeAminoAcids, boolean includeHeterogens, boolean includeWaters, boolean includeSegments) throws VisitorException
includeAtoms
- true if Atoms should be included in lists.includeBonds
- true if Bonds should be included in lists.includeAminoAcids
- true if AminoAcids should be included.includeHeterogens
- true if Heterogens should be included.includeWaters
- true if Waters should be included.includeSegments
- true if Segments should be included.
VisitorException
public Segment[] getOpaqueSegments()
public Drawable[] getOpaqueAtomsAndBonds()
public Drawable[] getTranslucentDrawables()
public void addNewHelix(String chainID, String helixID, String serialNo, String startResidueID, String endResidueID, HelixEnum type) throws InvalidRegionException, InvalidIDException
chainID
- ID of the Chain to add the Helix to.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.
InvalidIDException
- if the helixID, serialNo,
startResidueID, or endResidueID is
null or does not have at least
one non-whitespace character.public void addNewBetaStrand(String chainID, String betaStrandID, String betaStrandNumber, String sheetID, String startResidueID, String endResidueID, int sense, int strandsInSheet) throws InvalidRegionException, InvalidIDException
chainID
- ID of the Chain to add the BetaStrand to.betaStrandID
- unique ID (betaStrandNumber plus sheetID).betaStrandNumber
- Strand identifier from PDB SHEET record.sheetID
- sheet identifier from a PDB SHEET record.startResidueID
- 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.
InvalidIDException
- if the betaStrandID, sheetID,
startResidueID, or endResidueID is
null or does not have at least one
non-whitespace character.public void addLoop(Loop loop)
loop
- the Loop reference to add to the Loop hash.public void clearListsOfVisibles()
public String getModelID()
public String getStructureID()
public Chain addNewChain(String chainID) throws InvalidIDException
chainID
- the ID of the Chain.
InvalidIDException
- if chainID is null or does not have at
least one non-whitespace character.public Chain getChain(String chainID)
chainID
- the ID for the desired Chain.
public Iterator<Chain> iteratorChains()
public int numberOfChains()
public Helix getHelix(String helixID)
helixID
- the ID for the desired Helix.
public Iterator<Helix> iteratorHelices()
public int numberOfHelices()
public BetaStrand getBetaStrand(String betaStrandID)
betaStrandID
- the ID for the desired BetaStrand.
public Iterator<BetaStrand> iteratorBetaStrands()
public int numberOfBetaStrands()
public void sortBetaStrands()
public Loop getLoop(String loopID)
loopID
- the ID for the desired Loop.
public Iterator<Loop> iteratorLoops()
public int numberOfLoops()
public boolean hasAminoAcids()
public boolean hasHeterogens()
public boolean hasWaters()
public String processID(String id, String typeOfID) throws InvalidIDException
processID
in interface IDTest
id
- Model ID to process.typeOfID
- type of ID (for possible use in error message).
InvalidIDException
- if the Model ID cannot be converted
to a positive integer.public String toString()
toString
in class Object
public void setMinMaxXYZ(double minX, double maxX, double minY, double maxY, double minZ, double maxZ)
minX
- the minimum x-coordinate.maxX
- the maximum x-coordinate.minY
- the minimum y-coordinate.maxY
- the maximum y-coordinate.minZ
- the minimum z-coordinate.maxZ
- the maximum z-coordinate.public double getX()
public double getY()
public double getZ()
public double getMinX()
public double getMaxX()
public double getMinY()
public double getMaxY()
public double getMinZ()
public double getMaxZ()
public double getWidth()
public double getHeight()
public double getDepth()
public double getMaxDimension()
public Segment getSegment(String segmentID, String regionID, RegionEnum regionType)
segmentID
- the ID of the requested Segment.regionID
- the ID of the Region the Segment belongs to.regionType
- the type of Region the Segment belongs to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |