ProGAL.proteins.chainTree
Class ChainTree

java.lang.Object
  extended by ProGAL.proteins.chainTree.ChainTree

public class ChainTree
extends java.lang.Object

A chain tree representation of the structure of a protein sub-chain.

Author:
P.Winter, R.Fonseca

Constructor Summary
ChainTree(PrimaryStructure ps)
          Construct a chain tree representing the structure of the specified sequence.
ChainTree(PrimaryStructure ps, int firstRes, int lastRes)
          Construct a chain tree representing the structure of the residues in the specified interval.
 
Method Summary
 double closeCCD(Point[] target, int iterations)
          Perform cyclic coordinate descent on this chain so the positions of the end-atoms overlap with those specified in the target-array.
 Point[] getAllBackboneAtoms()
          Collect all backbone atoms using the leaves only.
 Point getBackboneAtom(int res, int atom)
          Return the position of a specific backbone atom.
 double getTorsionAngle(int res, int bond)
          Return the torsion angle of the specified residue and bond.
 boolean isLocked(int res, int bond)
           
static void main(java.lang.String[] args)
           
 void setFirstTransformation(Matrix m)
          Change the orientation and translation of the entire chain.
 void setLocked(int res, int bond)
           
 void setTorsionAngle(int res, int bond, double value)
          Changes the torsion angle of the specified residue and bond.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainTree

public ChainTree(PrimaryStructure ps)
Construct a chain tree representing the structure of the specified sequence.

Parameters:
ps - Primary structure specifying the sequence

ChainTree

public ChainTree(PrimaryStructure ps,
                 int firstRes,
                 int lastRes)
Construct a chain tree representing the structure of the residues in the specified interval.

Parameters:
ps - Primary structure specifying the sequence
firstRes - The residue-index of the first residue in the loop.
lastRes - The residue-index of the last residue in the loop.
Method Detail

getTorsionAngle

public double getTorsionAngle(int res,
                              int bond)
Return the torsion angle of the specified residue and bond. This is a constant time operation.

Parameters:
res - The residue-index in this chain-tree (0 is the first residue)
bond - Indication of which bond in the residue (0=phi, 1=psi and 2=omega).
Returns:
The torsion angle of the specified bond

setTorsionAngle

public void setTorsionAngle(int res,
                            int bond,
                            double value)
Changes the torsion angle of the specified residue and bond. Since the CT-hierarchy must be traversed to the root this method runs O(lgn) in the number of residues.

Parameters:
res - The residue-index in this chain-tree (0 is the first residue)
bond - Indication of which bond in the residue (0=phi, 1=psi and 2=omega).
value - The new value of the torsion angle

setLocked

public void setLocked(int res,
                      int bond)

isLocked

public boolean isLocked(int res,
                        int bond)

setFirstTransformation

public void setFirstTransformation(Matrix m)
Change the orientation and translation of the entire chain. In practice this is done by changing the transformation applied to the first leaf.

Parameters:
m - The new first-transformation

getBackboneAtom

public Point getBackboneAtom(int res,
                             int atom)
Return the position of a specific backbone atom. The internal structure of the chain tree is used making the running-time O(lgn).

Parameters:
res - The residue index in this chain tree (0 is the first residue).
atom - The atom index in the residue (0=N, 1=CA and 2=C).
Returns:
The position of the specified atom

getAllBackboneAtoms

public Point[] getAllBackboneAtoms()
Collect all backbone atoms using the leaves only. Because all positions are being calculated, the internal structure of the tree is not used. This gives a O(n)-time method instead of O(nlgn).


closeCCD

public double closeCCD(Point[] target,
                       int iterations)
Perform cyclic coordinate descent on this chain so the positions of the end-atoms overlap with those specified in the target-array.

Parameters:
target - The desired position of the target.length last atoms in the chain.
iterations - The number of iterations of CCD to perform
Returns:
The root-mean-square deviation of the last atoms from the target-points.

main

public static void main(java.lang.String[] args)