|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteinshader.structure.visitor.Visitor
org.proteinshader.structure.visitor.FrenetFrameGeneratorVisitor
public class FrenetFrameGeneratorVisitor
Calculates a discrete Frenet frame for each AminoAcid visited.
In order to represent amino acids as segments of a tube or ribbon in
a "cartoon" like drawing, it is necessary to have a local coordinate
frame for each alpha-carbon (the alpha-carbon will be considered as
the center of a Segment object). This class will traverse the
AminoAcids of each Chain and calculate a discrete Frenet frame to
assign to each AminoAcid. The Frenet frame will be calculated as
three column vectors: the normal, the binormal, and the tangent.
There three column vectors form the rotation matix [N B T], which
will be converted to a Quaterion object that will be given to the
setRotation() method of each AminoAcid.
ALGORITHM:
The discrete Frenet frame for alpha-carbon(i) will be calculated based
on the triangle formed by the vertices alpha-carbon(i) and the
previous and next alpha-carbons, alpha-carbon(i-1) and
alpha-carbon(i+1), respectively. In the equations below, CA is the
symbol for an alpha-carbon.
T = tangent vector = CA(i+1) - CA(i-1)
V = non-tangent vector = CA(i) - CA(i-1)
B = binormal vector = V x T, where 'x' means the crossproduct
N = normal vector = B x T, where 'x' means the crossproduct
The matrix [N B T] forms a right-handed coordinate system (and OpenGL
uses a right-handed coordinate system).
At the beginning of the Chain, there is no CA(i-1), so...
| Field Summary | |
|---|---|
static double |
MAX_CA_DISTANCE
The maximum distance from one alpha-carbon to the next alpha-carbon in a chain of amino acids should not be greater than 4.5 angstroms. |
| Constructor Summary | |
|---|---|
FrenetFrameGeneratorVisitor()
Constructs a FrenetFrameGeneratorVisitor. |
|
| Method Summary | |
|---|---|
void |
calculateRotation(AminoAcid prev,
AminoAcid cur,
AminoAcid next)
Calculates the equivalent of a discrete Frenet frame (a rotation matrix [N B T]) and uses it to set the rotation attribute of the current AminoAcid. |
Quaternion |
calculateRotation(Atom atom1,
Atom atom2,
Atom atom3)
Calculates a rotation matrix [N B T] based on the xyz-centers of the three Atoms given as arguments, and then converts the rotation matrix into a Quaternion that is returned. |
void |
visit(AminoAcid aminoAcid)
The AminoAcid being visited is considered as CA(i+1), while the last two AminoAcids are considered to be CA(i) and CA(i-1). |
void |
visit(Chain chain)
All AminoAcids of the Chain will be visited. |
| Methods inherited from class org.proteinshader.structure.visitor.Visitor |
|---|
clear, includeAAHetAndWater, setDebug, setMode, setMode, setMode, setMode, setMode, setMode, setVisitSegments, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double MAX_CA_DISTANCE
| Constructor Detail |
|---|
public FrenetFrameGeneratorVisitor()
| Method Detail |
|---|
public void visit(Chain chain)
throws VisitorException
visit in class Visitorchain - the Chain to generate Loops for.
VisitorException - if an error occurs while visiting.
public void visit(AminoAcid aminoAcid)
throws VisitorException
visit in class VisitoraminoAcid - the next AminoAcid in the Chain.
VisitorException - if an error occurs while visiting.
public void calculateRotation(AminoAcid prev,
AminoAcid cur,
AminoAcid next)
prev - alpha-carbon(i-1)cur - alpha-carbon(i)next - alpha-carbon(i+1)
public Quaternion calculateRotation(Atom atom1,
Atom atom2,
Atom atom3)
atom1 - the first Atom in a triangle is CA(i-1) or N(i).atom2 - the second Atom in a triangle is always CA(i).atom3 - the third Atom in a triangle is CA(i+1) or C(i).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||