RdcPanda
Class PhiPsi

java.lang.Object
  extended by RdcPanda.PhiPsi
All Implemented Interfaces:
java.lang.Cloneable

public class PhiPsi
extends java.lang.Object
implements java.lang.Cloneable

Various methods for exact solution and systematic search including the computation of rotation to the frist peptide plane the DFS-search and solver of the quartic equation and the computation of \phi and \psi angles from two vectors in consecutive planse etc. Written by Lincong Wang (2001-2005).


Nested Class Summary
static class PhiPsi.PPComparator
          The Class PPComparator.
 
Constructor Summary
PhiPsi()
          Instantiates a new phi psi.
PhiPsi(double phiT, double psiT, double r_score)
          Instantiates a new phi psi.
PhiPsi(int No)
          Instantiates a new phi psi.
PhiPsi(int no, java.lang.String re, double x, double y)
          Instantiates a new phi psi.
PhiPsi(int no, java.lang.String re, double x, double y, double phi_lo, double phi_up, double psi_lo, double psi_up)
          Instantiates a new phi psi.
 
Method Summary
 double[] addCoords(double[] n1, double[] n2)
          adding two vectors.
 void backwardCoords(java.util.Vector pdbVec2)
          Testing the Computation of backbone structure backwards.
 double[] ca2caDirCal(double phi, double psi, double[] ca1, Matrix rg)
          A method for computing the the Vector CA(i)-->CA(i+1), between the CA(i) and CA(i+1) begin with an frame defined in the peptide plane i.
 double[] caByNextPeptidePlane(double[] n1, Matrix rg)
          Ca by next peptide plane.
 boolean coefPhiBackward(double Syy, double Szz, double rdc, double[][] mat, double[] coefs)
          Method for generating coefs for the quartic equation for computing phi_i from NH RDCs for residue i by working backwards from the residue i+1.
 boolean coefPsiBackward(double Syy, double Szz, double rdc, double[][] mat, double[] coefs)
          Method for generating coefs for the quartic equation.
 double danSeq(double[] ha, double[] co, double psi)
          A method for computing the distance dN(i, i+1), between the NH(i) and NH(i+1) begin with an frame defined in the peptide plane i.
 double dCaCa(double phi, double psi)
          A method for computing the distance Ca(i, i+1), between the CA(i) and CA(i+1) begin with an frame defined in the peptide plane i.
 boolean dirCaCa(double[] ca1, double[] ca3, double theta2, double[][] solutions)
          Compute the CA directions of residues 2 and 3 specified by polar angles (theta, phi), given the CA coordinates for residue 1 and 3 and the theta polar angle for residue 2.
 double[] dirCos(double[] vec)
          cal the directioal cosines of the vector vec.
 double dnaIntra(double phi)
          A method for computing the distance dN(i, i+1), between the NH(i) and NH(i+1) begin with an frame defined in the peptide plane i.
 double dNNseq(double phi, double psi)
          A method for computing the distance dN(i, i+1), between the NH(i) and NH(i+1) begin with an frame defined in the peptide plane i.
 void dNNtest()
          There is another method for computing these angles, see the backup file.
 double[][] extractRestraints(int begin, int end, java.util.Vector h1Vec, java.util.Vector asgVec, java.util.Vector rdcVec1, java.util.Vector rdcVec2, double a1, double a2)
          The method right now may have ERROR! To extract all the sequential restraints (both RDCs and NOEs) involving the backbone nuclei (HA and NH) located in the turn or the loop.
 double getPhi()
          Gets the phi.
 double getPhiLower()
          Gets the phi lower.
 double getPhiUpper()
          Gets the phi upper.
 double getPsi()
          Gets the psi.
 double getPsiLower()
          Gets the psi lower.
 double getPsiUpper()
          Gets the psi upper.
 double getRamaScore()
          Gets the rama score.
 java.lang.String getResidue()
          Gets the residue.
 int getResidueNo()
          Gets the residue no.
 double interAngle(double[] v1, double[] v2)
          calculate the angles between two vectors v1 and v2 The returned angle is in the [0,Pi] range.
 double internuclearDistance(double[] n1, double[] n2)
          Compute the internuclear vector between two atoms.
 double[] internuclearVec(double[] n1, double[] n2)
          Compute the internuclear vector between two atoms.
 double length(double[] v1)
          calculate the length between two vectors v1 and v2 The returned angle is the [0,Pi] region.
 java.util.Vector longTurn(java.util.Vector h1Vec, java.util.Vector asgVec, java.util.Vector pdbVec1, java.util.Vector pdbVec2, java.util.Vector rdcVec1, java.util.Vector rdcVec2, double Syy, double Szz, int no1, int no2, double a1, double a2)
          Compute the loop (18 - 23) by randomly changing the 18, 19 backbone dihedral angles.
 boolean loop34To41(double[][] restraints, double Syy, double Szz, int no1, int no2, double[] n, double[] nh, double[] ca, double[] n2, double[] nh2, double[] ca2, java.util.Vector phiPsiVec, double[] rdcRmsd)
          Loop34 to41.
 void loop50To56(java.util.Vector h1Vec, java.util.Vector asgVec2, java.util.Vector pdbVec, java.util.Vector h56To59Pdb, java.util.Vector chRdcVec, java.util.Vector nhRdcVec, double Syy, double Szz, int no1, int no2, double a1, double a2)
          Compute the loop L50-L56 given the orientation of the peptide planes L50 and L56.
 boolean loop59To65(double[][] restraints, double Syy, double Szz, int no1, int no2, double[] n, double[] nh, double[] ca, double[] n2, double[] nh2, double[] ca2, java.util.Vector phiPsiVec, double[] rdcRmsd)
          Compute the loop Y59 <--> K63 given the absolute coordinates for Y59 and E64.
 double[] newNCA(double phi, double psi, Matrix rg)
          Method for the computation of new N->CA vector for residue $i+1$ from the computed \Phi and Psi angles.
 Matrix newRG(double phi, double psi, Matrix rg)
          Method for the computation of new N->CA vector for residue $i+1$ from the computed \Phi and Psi angles of residue $i$.
 Matrix newRG(double phi, double psi, Matrix rg, boolean rightHand)
          Method for the computation of new N->CA vector for residue $i+1$ from the computed \Phi and Psi angles of residue $i$.
 void nh2ca2Cal()
          Test the computation of psi1, phi2, psi2 given the peptide plane for residue 1 an d3 and phi1 without knowing the relative position between two planes.
 void noeDisVsPhi()
          Noe dis vs phi.
 void noeDisVsPsi()
          Noe dis vs psi.
 java.util.Vector phiCal(double Syy, double Szz, double rdc, Matrix rg)
          Compute the Phi angles.
 java.util.Vector phiCal(double Syy, double Szz, double rdc, Matrix Rg, boolean isHelix)
          Compute the Phi angles.
 java.util.Vector phiCal(double Syy, double Szz, double rdc, Matrix Rg, boolean isHelix, int curResNo, java.util.Vector vecTalos)
          Compute the Phi angles.
 java.util.Vector phiCalBackward(double Syy, double Szz, double rdc, double psi, Matrix rg)
          Compute the Psi angles.
 java.util.Vector phiCalLoop(double Syy, double Szz, double rdc, Matrix Rg)
          Compute the Phi angles for loop fragment.
 java.util.Vector phiCalNoe(double d)
          Compute the Phi angles from the NOE distances, given the coordinates for ca and nh.
 void phiPsiBackwardTest(java.util.Vector rdcNH, java.util.Vector rdcCH)
          Phi psi backward test.
 boolean phiPsiByCa(Matrix rg, double[] cacaVec, double[][] solutions)
          ********************************************************************************* This method compute the \Phi and \Psi pair from the coordinates of CA(i) and CA(i+1) EXACTLY assuming the six angles are known.
 java.util.Vector phiPsiByPP13(double[] u1, double[] v1, double[] n2ca3, double[] n2nh3, double phi1)
          computation of psi1, phi2, psi2 given the peptide planes for residue 1 an d3 and phi1 without knowing the relative position between two planes.
 boolean phiPsiByPP14(double[] ca1, double[] n4, double[] ca4, double[] nh4, Matrix rg1, Matrix rg4, java.util.Vector solutionVec)
          Compute the CA directions of residues 2 and 3 specified by polar angles (theta, phi), given the CA coordinates for residue 1 and 3 and the theta polar angle for residue 2.
 boolean phiPsiByRdcNoe(java.util.Vector asgVec, double[][] restraints, double Syy, double Szz, double[] n0, double[] nh0, double[] ca0, Matrix rg, int depth, int N, double[] ppS, java.util.Vector ppVec, double[] nToNHVec2, double[] nToCAVec2, double[] ca2)
          A recusive function to compute all the backbone (phi, psi) angles for an $m$-residue fragment This is a version for real computation, NOT for collecting running statistics.
 boolean phiPsiChain(double[] rdcArr1, double[] rdcArr2, Matrix rg, double Syy, double Szz, int i, int N, double[] ppS, java.util.Vector ppVec, boolean rightHand, boolean isHelix)
          A recusive function to compute all the backbone (phi, psi) angles for an $N$-residue fragment This is a version for real computation, NOT for collecting running statistics.
 boolean phiPsiChainTalos(double[] rdcArr1, double[] rdcArr2, Matrix rg, double Syy, double Szz, int i, int N, double[] ppS, java.util.Vector ppVec, boolean rightHand, boolean isHelix, int firstResNo, java.util.Vector vecTalos)
          A recusive function to compute all the backbone (phi, psi) angles for an $N$-residue fragment This is a version for real computation, NOT for collecting running statistics.
 void printArray(double[] n1)
          Prints the array.
 java.util.Vector psiCal(double Syy, double Szz, double rdc, double phi, Matrix rg)
          Compute the Psi angles.
 java.util.Vector psiCal(double Syy, double Szz, double rdc, double phi, Matrix rg, boolean isHelix)
          Compute the Psi angles.
 java.util.Vector psiCal(double Syy, double Szz, double rdc, double phi, Matrix rg, boolean isHelix, int curResNo, java.util.Vector vecTalos)
          Compute the Psi angles.
 java.util.Vector psiCalBackward(double Syy, double Szz, double rdc, Matrix rg)
          Compute the Phi angles.
 java.util.Vector psiCalLoop(double Syy, double Szz, double rdc, double phi, Matrix rg)
          Compute the Psi angles for loops.
 java.util.Vector psiCalNoe(double d)
          Compute the Phi angles from the NOE distances, given the coordinates for ca and nh.
 boolean quadraticSolve(double[] coefs, double[] solutions)
          Method for solving the quadratic equation generated from the NOE distance as shown in the above.
 boolean quarticCoefPhi(double Syy, double Szz, double rdc, double[][] mat, double[] coefs)
          Method for generating coefs for the quartic equation for computing CH .
 boolean quarticCoefPsi(double Syy, double Szz, double rdc, double[][] mat, double[] coefs)
          Method for generating coefs for the quartic equation.
 java.util.Vector quarticSolve(double[] coefs)
          Method is for computing \Phi or \Psi using Two RDC in one medium by solving a Quartic eqaution It differs from the method for solving RDCs in two media .
 double[][] restraintsBackward(int begin, int end, java.util.Vector h1Vec, java.util.Vector asgVec, java.util.Vector rdcVec1, java.util.Vector rdcVec2, double a1, double a2)
          To extract all the sequential restraints (both RDCs and NOEs) involving the backbone nuclei (HA and NH) located in the turn or the loop.
 Matrix RgCal(double[] nToh, double[] nToca)
          Compute the global rotation matrix for rotating a coordinate frame such as the PDB frame where the two vectors NH(i)->N(i) (nToh) and N(i)->CA(i) (nToca) defined into the following frame: +Z-axis along the bond NH(i)->N(i), "->" means from nuclear NH(i) to nuclear N(i).
 Matrix RgCal(double[] nToh, double[] nToca, boolean rightHand)
          Rg cal.
 void setPhi(double f1)
          Sets the phi.
 void setPsi(double f1)
          Sets the psi.
 java.util.Vector<PhiPsi> talosAngleReader(java.lang.String talosFile)
          A very simple reader for talos angle.
 void testDirCaCa()
          Test dir ca ca.
 void testNOEs()
          Testing the methods for computing the \phi and \psi angle from NOE disances.
 void testPhiPsiByCa(java.util.Vector pdbVec)
          Test phi psi by ca.
 java.lang.String toString()
           
 java.util.Vector turnByCaCa(java.util.Vector h1Vec, java.util.Vector asgVec, java.util.Vector pdbVec1, java.util.Vector pdbVec2, java.util.Vector rdcVec1, java.util.Vector rdcVec2, double Syy, double Szz, int no1, int no2, double a1, double a2)
          Compute the turns (8 - 11) by randomly changing the.
 double vdwEnergy(java.util.Vector pdbVec1, java.util.Vector pdbVec2, int[] count)
          Vdw energy.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PhiPsi

public PhiPsi(double phiT,
              double psiT,
              double r_score)
Instantiates a new phi psi.

Parameters:
phiT - the phi t
psiT - the psi t
r_score - the r_score

PhiPsi

public PhiPsi()
Instantiates a new phi psi.


PhiPsi

public PhiPsi(int No)
Instantiates a new phi psi.

Parameters:
No - the no

PhiPsi

public PhiPsi(int no,
              java.lang.String re,
              double x,
              double y)
Instantiates a new phi psi.

Parameters:
no - the no
re - the re
x - the x
y - the y

PhiPsi

public PhiPsi(int no,
              java.lang.String re,
              double x,
              double y,
              double phi_lo,
              double phi_up,
              double psi_lo,
              double psi_up)
Instantiates a new phi psi.

Parameters:
no - the no
re - the re
x - the x
y - the y
phi_lo - the phi_lo
phi_up - the phi_up
psi_lo - the psi_lo
psi_up - the psi_up
Method Detail

getResidueNo

public int getResidueNo()
Gets the residue no.

Returns:
the residue no

getResidue

public java.lang.String getResidue()
Gets the residue.

Returns:
the residue

getPhi

public double getPhi()
Gets the phi.

Returns:
the phi

setPhi

public void setPhi(double f1)
Sets the phi.

Parameters:
f1 - the new phi

getPsi

public double getPsi()
Gets the psi.

Returns:
the psi

setPsi

public void setPsi(double f1)
Sets the psi.

Parameters:
f1 - the new psi

getRamaScore

public double getRamaScore()
Gets the rama score.

Returns:
the rama score

getPhiLower

public double getPhiLower()
Gets the phi lower.

Returns:
the phi lower

getPhiUpper

public double getPhiUpper()
Gets the phi upper.

Returns:
the phi upper

getPsiLower

public double getPsiLower()
Gets the psi lower.

Returns:
the psi lower

getPsiUpper

public double getPsiUpper()
Gets the psi upper.

Returns:
the psi upper

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

printArray

public void printArray(double[] n1)
Prints the array.

Parameters:
n1 - the n1

length

public double length(double[] v1)
calculate the length between two vectors v1 and v2 The returned angle is the [0,Pi] region.

Parameters:
v1 - the v1
Returns:
the double

interAngle

public double interAngle(double[] v1,
                         double[] v2)
calculate the angles between two vectors v1 and v2 The returned angle is in the [0,Pi] range.

Parameters:
v1 - the v1
v2 - the v2
Returns:
the double

dirCos

public double[] dirCos(double[] vec)
cal the directioal cosines of the vector vec.

Parameters:
vec - the vec
Returns:
the double[]

internuclearVec

public double[] internuclearVec(double[] n1,
                                double[] n2)
Compute the internuclear vector between two atoms.

Parameters:
n1 - the coordinate for atom 1
n2 - the coordinate for atom 2
Returns:
a vector from n1->n2

internuclearDistance

public double internuclearDistance(double[] n1,
                                   double[] n2)
Compute the internuclear vector between two atoms.

Parameters:
n1 - the coordinate for atom 1
n2 - the coordinate for atom 2
Returns:
a vector from n1->n2

addCoords

public double[] addCoords(double[] n1,
                          double[] n2)
adding two vectors.

Parameters:
n1 - the coordinate (direction cosine) for vector n1
n2 - the coordinate (direction cosine) for vector n2
Returns:
a vector from n1+n2

RgCal

public Matrix RgCal(double[] nToh,
                    double[] nToca)
Compute the global rotation matrix for rotating a coordinate frame such as the PDB frame where the two vectors NH(i)->N(i) (nToh) and N(i)->CA(i) (nToca) defined into the following frame: +Z-axis along the bond NH(i)->N(i), "->" means from nuclear NH(i) to nuclear N(i). +Y-axis in the peptide plane i,and the angle between +Y and the N(i)->CA(i) < 90 degree. +X-axis is defined based on the right-handedness.

Parameters:
nToh - the direction cosine of N->NH vector
nToca - the direction cosine of N->CA vector
Returns:
All the rotation Matrix

RgCal

public Matrix RgCal(double[] nToh,
                    double[] nToca,
                    boolean rightHand)
Rg cal.

Parameters:
nToh - the n toh
nToca - the n toca
rightHand - the right hand
Returns:
the matrix

quadraticSolve

public boolean quadraticSolve(double[] coefs,
                              double[] solutions)
Method for solving the quadratic equation generated from the NOE distance as shown in the above.

Parameters:
coefs - coefs generated by the above methods
solutions - for returning all the real solutions if there are
Returns:
true

phiCalNoe

public java.util.Vector phiCalNoe(double d)
Compute the Phi angles from the NOE distances, given the coordinates for ca and nh.

Parameters:
d - the intra noe distance bewteen NH(i) and HA(i) of residue i+1
Returns:
a set of solutions for \phi angles: if the set empty ==> no solution

psiCalNoe

public java.util.Vector psiCalNoe(double d)
Compute the Phi angles from the NOE distances, given the coordinates for ca and nh.

Parameters:
d - the intra noe distance bewteen NH(i) and HA(i) of residue i+1
Returns:
a set of solutions for \psi angles: if the set empty ==> no solution

testNOEs

public void testNOEs()
Testing the methods for computing the \phi and \psi angle from NOE disances.


noeDisVsPhi

public void noeDisVsPhi()
Noe dis vs phi.


dnaIntra

public double dnaIntra(double phi)
A method for computing the distance dN(i, i+1), between the NH(i) and NH(i+1) begin with an frame defined in the peptide plane i.

Parameters:
phi - The backbone \phi angle
Returns:
the distance dna between HN(i) and HA(i)

danSeq

public double danSeq(double[] ha,
                     double[] co,
                     double psi)
A method for computing the distance dN(i, i+1), between the NH(i) and NH(i+1) begin with an frame defined in the peptide plane i.

Parameters:
psi - The backbone \psi angle
ha - the coordinate of HA (i)
co - the coordinate of CO (i)
Returns:
the distance dan between HA(i) and HN(i+1)

dNNseq

public double dNNseq(double phi,
                     double psi)
A method for computing the distance dN(i, i+1), between the NH(i) and NH(i+1) begin with an frame defined in the peptide plane i.

Parameters:
phi - The backbone \phi angle
psi - The backbone \psi angle
Returns:
Pdb object consisting of atoms: NH, CA, CO, HA and O of residue (i). Please note that the coordinates of N, NH and CA of residue (i+1) are returned by overwriting the original array for them: This may be BUG prone.

noeDisVsPsi

public void noeDisVsPsi()
Noe dis vs psi.


dCaCa

public double dCaCa(double phi,
                    double psi)
A method for computing the distance Ca(i, i+1), between the CA(i) and CA(i+1) begin with an frame defined in the peptide plane i. In FACT, with standard bond angles and lengths, dCaCa is a constant.

Parameters:
phi - The backbone \phi angle
psi - The backbone \psi angle
Returns:
the distance dCaCa.

dirCaCa

public boolean dirCaCa(double[] ca1,
                       double[] ca3,
                       double theta2,
                       double[][] solutions)
Compute the CA directions of residues 2 and 3 specified by polar angles (theta, phi), given the CA coordinates for residue 1 and 3 and the theta polar angle for residue 2. See Math derivation for the detail; Be careful to return all the solutions.

Parameters:
ca1 - the coordinate of the CA nucleus of residue i
ca3 - the coordinate of the CA nucleus of residue i+2
theta2 - the polar theta angle of CA2CA vector between residues i and i+1.
solutions - double[][] allAngles = new double[2][3];
Returns:
true, if dir ca ca

caByNextPeptidePlane

public double[] caByNextPeptidePlane(double[] n1,
                                     Matrix rg)
Ca by next peptide plane.

Parameters:
n1 - the n1
rg - the rg
Returns:
the double[]

testDirCaCa

public void testDirCaCa()
Test dir ca ca.


phiPsiByCa

public boolean phiPsiByCa(Matrix rg,
                          double[] cacaVec,
                          double[][] solutions)
********************************************************************************* This method compute the \Phi and \Psi pair from the coordinates of CA(i) and CA(i+1) EXACTLY assuming the six angles are known. The math is similar to those for computing \Phi and \Psi from two vectors in consequtive peptide plane. See the detail for the Math derivation ****************************************************

Parameters:
rg - the rotation matrix from a unique global frame to a local frame specified in the peptide plane i
solutions - double[][] solutions = new double[2][3]; //since only two pairs
cacaVec - the caca vec
Returns:
the solutions in the array solutions, and true is there are solutions The six angles are assumed to be constants

turnByCaCa

public java.util.Vector turnByCaCa(java.util.Vector h1Vec,
                                   java.util.Vector asgVec,
                                   java.util.Vector pdbVec1,
                                   java.util.Vector pdbVec2,
                                   java.util.Vector rdcVec1,
                                   java.util.Vector rdcVec2,
                                   double Syy,
                                   double Szz,
                                   int no1,
                                   int no2,
                                   double a1,
                                   double a2)
Compute the turns (8 - 11) by randomly changing the.

Parameters:
no1 - the first residue of the fragment (turn and loop)
no2 - the last residue of the fragment (turn and loop)
h1Vec - resonance assignment sorted by H1 CS shift.
asgVec - the merged resonacs assigement and HN and HA NOEs
rdcVec1 - the CH RDC
rdcVec2 - the NH RDC
a1 - the constant used to convert the intensity to distance
a2 - the constant used to convert the intensity to distance
pdbVec1 - the structure for the beginning side of turn or loop
pdbVec2 - the structure for the end side of turn or loop
Syy - the diagnolized Saupe elements
Szz - the diagnolized Saupe elements
Returns:
the refined Pdb vector

longTurn

public java.util.Vector longTurn(java.util.Vector h1Vec,
                                 java.util.Vector asgVec,
                                 java.util.Vector pdbVec1,
                                 java.util.Vector pdbVec2,
                                 java.util.Vector rdcVec1,
                                 java.util.Vector rdcVec2,
                                 double Syy,
                                 double Szz,
                                 int no1,
                                 int no2,
                                 double a1,
                                 double a2)
Compute the loop (18 - 23) by randomly changing the 18, 19 backbone dihedral angles.

Parameters:
no1 - the first residue of the fragment (turn and loop)
no2 - the last residue of the fragment (turn and loop)
h1Vec - resonance assignment sorted by H1 CS shift.
asgVec - the merged resonance assigement and HN and HA NOEs
rdcVec1 - the CH RDC
rdcVec2 - the NH RDC
a1 - the constant used to convert the intensity to distance
a2 - the constant used to convert the intensity to distance
pdbVec1 - the structure for the beginning side of turn or loop
pdbVec2 - the structure for the end side of turn or loop
Syy - the diagnolized Saupe elements
Szz - the diagnolized Saupe elements
Returns:
the refined Pdb vector

ca2caDirCal

public double[] ca2caDirCal(double phi,
                            double psi,
                            double[] ca1,
                            Matrix rg)
A method for computing the the Vector CA(i)-->CA(i+1), between the CA(i) and CA(i+1) begin with an frame defined in the peptide plane i. In FACT, with standard bond angles and lengths, dCaCa is a constant.

Parameters:
phi - The backbone \phi angle
psi - The backbone \psi angle
rg - the rotation matrix to the peptide plane i
ca1 - the ca1
Returns:
the Ca(i)-->Ca(i+1) vector.

dNNtest

public void dNNtest()
There is another method for computing these angles, see the backup file.


testPhiPsiByCa

public void testPhiPsiByCa(java.util.Vector pdbVec)
Test phi psi by ca.

Parameters:
pdbVec - the pdb vec

nh2ca2Cal

public void nh2ca2Cal()
Test the computation of psi1, phi2, psi2 given the peptide plane for residue 1 an d3 and phi1 without knowing the relative position between two planes.


phiPsiByPP13

public java.util.Vector phiPsiByPP13(double[] u1,
                                     double[] v1,
                                     double[] n2ca3,
                                     double[] n2nh3,
                                     double phi1)
computation of psi1, phi2, psi2 given the peptide planes for residue 1 an d3 and phi1 without knowing the relative position between two planes. The peptide plane specified by N2NH and N2CA vectors

Parameters:
u1 - the n2ca vector of residue 1
v1 - the n2nh vector of residue 1
n2ca3 - the n2ca vector of residue 3
n2nh3 - the n2nh vector of residue 3
phi1 - the phi angle of residue 1.
Returns:
the vector

quarticCoefPhi

public boolean quarticCoefPhi(double Syy,
                              double Szz,
                              double rdc,
                              double[][] mat,
                              double[] coefs)
Method for generating coefs for the quartic equation for computing CH . suppose \phi is computed from an CH RDC.

Parameters:
rdc - Rdc data of CH vector
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
mat - the elements of the Matrix M as appeared in the math derivation
coefs - the five coefs of the quartic equation and others for checking the final solution
Returns:
false if no quartic equation can be generated, otherwise, true.

quarticCoefPsi

public boolean quarticCoefPsi(double Syy,
                              double Szz,
                              double rdc,
                              double[][] mat,
                              double[] coefs)
Method for generating coefs for the quartic equation. suppose \psi is computed from an NH RDC.

Parameters:
rdc - Rdc data of NH vector
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
mat - the elements of the Matrix M as appeared in the math derivation
coefs - the five coefs of the quartic equation and others for checking the final solution
Returns:
false if no quartic equation can be generated, otherwise. true.

quarticSolve

public java.util.Vector quarticSolve(double[] coefs)
Method is for computing \Phi or \Psi using Two RDC in one medium by solving a Quartic eqaution It differs from the method for solving RDCs in two media . solve the quartic equation by eigenValues method (cf. NR book), which is at least 2-fold slower than the other method, and much more slower than the exact method, return: an array of solutions

Parameters:
coefs - coefs generated by the coef generating methods
Returns:
all the real solutions.

phiCal

public java.util.Vector phiCal(double Syy,
                               double Szz,
                               double rdc,
                               Matrix rg)
Compute the Phi angles. This is a test method to see if it can reproduce the directional cosines of the CH vector and the \phi angle.

Parameters:
rdc - Rdc data of CH vector
rg - the rotation matrix rotate a POF to a frame defined in the peptine plane $i$
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
Returns:
a set of solutions for \phi angles: if the set empty ==> no solution

phiCal

public java.util.Vector phiCal(double Syy,
                               double Szz,
                               double rdc,
                               Matrix Rg,
                               boolean isHelix)
Compute the Phi angles. This is a test method to see if it can reproduce the directional cosines of the CH vector and the \phi angle.

Parameters:
rdc - Rdc data of CH vector
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
Rg - the rg
isHelix - the is helix
Returns:
a set of solutions for \phi angles: if the set empty ==> no solution

phiCalLoop

public java.util.Vector phiCalLoop(double Syy,
                                   double Szz,
                                   double rdc,
                                   Matrix Rg)
Compute the Phi angles for loop fragment.

Parameters:
rdc - Rdc data of CH vector
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
Rg - the rg
Returns:
a set of solutions for \phi angles: if the set empty ==> no solution

phiCal

public java.util.Vector phiCal(double Syy,
                               double Szz,
                               double rdc,
                               Matrix Rg,
                               boolean isHelix,
                               int curResNo,
                               java.util.Vector vecTalos)
Compute the Phi angles. This is a test method to see if it can reproduce the directional cosines of the CH vector and the \phi angle.

Parameters:
rdc - Rdc data of CH vector
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
Rg - the rg
isHelix - the is helix
curResNo - the cur res no
vecTalos - the vec talos
Returns:
a set of solutions for \phi angles: if the set empty ==> no solution

psiCal

public java.util.Vector psiCal(double Syy,
                               double Szz,
                               double rdc,
                               double phi,
                               Matrix rg)
Compute the Psi angles. This is a test method to see if it can reproduce the directional cosines of the CH vector and the \phi angle.

Parameters:
rdc - Rdc data of NH vector
phi - the computed \phi value for the same residue
rg - the rotation matrix rotate a POF to a frame defined in the peptine plane $i$
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
Returns:
a set of solutions for \psi angles: if the set empty ==> no solution

psiCal

public java.util.Vector psiCal(double Syy,
                               double Szz,
                               double rdc,
                               double phi,
                               Matrix rg,
                               boolean isHelix)
Compute the Psi angles. This is a test method to see if it can reproduce the directional cosines of the CH vector and the \phi angle.

Parameters:
rdc - Rdc data of NH vector
phi - the computed \phi value for the same residue
rg - the rotation matrix rotate a POF to a frame defined in the peptine plane $i$
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
isHelix - the is helix
Returns:
a set of solutions for \psi angles: if the set empty ==> no solution

psiCalLoop

public java.util.Vector psiCalLoop(double Syy,
                                   double Szz,
                                   double rdc,
                                   double phi,
                                   Matrix rg)
Compute the Psi angles for loops.

Parameters:
rdc - Rdc data of NH vector
phi - the computed \phi value for the same residue
rg - the rotation matrix rotate a POF to a frame defined in the peptine plane $i$
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
Returns:
a set of solutions for \psi angles: if the set empty ==> no solution

psiCal

public java.util.Vector psiCal(double Syy,
                               double Szz,
                               double rdc,
                               double phi,
                               Matrix rg,
                               boolean isHelix,
                               int curResNo,
                               java.util.Vector vecTalos)
Compute the Psi angles. This is a test method to see if it can reproduce the directional cosines of the CH vector and the \phi angle.

Parameters:
rdc - Rdc data of NH vector
phi - the computed \phi value for the same residue
rg - the rotation matrix rotate a POF to a frame defined in the peptine plane $i$
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
isHelix - the is helix
curResNo - the cur res no
vecTalos - the vec talos
Returns:
a set of solutions for \psi angles: if the set empty ==> no solution

coefPhiBackward

public boolean coefPhiBackward(double Syy,
                               double Szz,
                               double rdc,
                               double[][] mat,
                               double[] coefs)
Method for generating coefs for the quartic equation for computing phi_i from NH RDCs for residue i by working backwards from the residue i+1. The method is identical to that for the forward method but the coefficients (the matrix M and Cs) differ.

Parameters:
rdc - Rdc data of NH vector
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
mat - the elements of the Matrix M as appeared in the math derivation
coefs - the five coefs of the quartic equation and others for checking the final solution
Returns:
false if no quartic equation can be generated, otherwise, true.

coefPsiBackward

public boolean coefPsiBackward(double Syy,
                               double Szz,
                               double rdc,
                               double[][] mat,
                               double[] coefs)
Method for generating coefs for the quartic equation. suppose \psi_i is computed from an = CH RDC of residue i.

Parameters:
rdc - Rdc data of CH vector of residue i
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
mat - the elements of the Matrix M as appeared in the math derivation
coefs - the five coefs of the quartic equation and others for checking the final solution
Returns:
false if no quartic equation can be generated, otherwise. true.

psiCalBackward

public java.util.Vector psiCalBackward(double Syy,
                                       double Szz,
                                       double rdc,
                                       Matrix rg)
Compute the Phi angles. This is a test method to see if it can reproduce the directional cosines of the CH vector and the \phi angle.

Parameters:
rdc - Rdc data of CH vector
rg - the rotation matrix rotate a POF to a frame defined in the peptine plane $i+1$
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
Returns:
a set of solutions for \phi angles: if the set empty ==> no solution

phiCalBackward

public java.util.Vector phiCalBackward(double Syy,
                                       double Szz,
                                       double rdc,
                                       double psi,
                                       Matrix rg)
Compute the Psi angles. This is a test method to see if it can reproduce the directional cosines of the CH vector and the \phi angle.

Parameters:
rdc - Rdc data of NH vector
rg - the rotation matrix rotate a POF to a frame defined in the peptine plane $i$
Syy - diagonilized Saupe elements computed by SVD with both CH and NH RDCs.
Szz - diagonilized Saupe elements
psi - the psi
Returns:
a set of solutions for \psi angles: if the set empty ==> no solution

phiPsiBackwardTest

public void phiPsiBackwardTest(java.util.Vector rdcNH,
                               java.util.Vector rdcCH)
Phi psi backward test.

Parameters:
rdcNH - the rdc nh
rdcCH - the rdc ch

backwardCoords

public void backwardCoords(java.util.Vector pdbVec2)
Testing the Computation of backbone structure backwards.

Parameters:
pdbVec2 - the pdb vec2

phiPsiChain

public boolean phiPsiChain(double[] rdcArr1,
                           double[] rdcArr2,
                           Matrix rg,
                           double Syy,
                           double Szz,
                           int i,
                           int N,
                           double[] ppS,
                           java.util.Vector ppVec,
                           boolean rightHand,
                           boolean isHelix)
A recusive function to compute all the backbone (phi, psi) angles for an $N$-residue fragment This is a version for real computation, NOT for collecting running statistics.

Parameters:
rdcArr1 - an array of CH RDCs for the fragment
rdcArr2 - an array of NH RDCs for the fragment
rg - a matrix to rotate the POF to a coodinate system defined in the first peptide plane.
Syy - Saupe elements computed from both NH and CH rdcs
Szz - Saupe elements computed from both NH and CH rdcs
i - the current depth of the depth-first search. Begin the call with i = 0;
N - the total depth of the depth-first search.
ppS - a temporary array for saving intermediate (\phi, \psi) angles.
ppVec - an array for saving and returning final (\phi, \psi) angles.
rightHand - make sure the computed rg has the same handedness as the rotating matrix by the SVD method
isHelix - the is helix
Returns:
true, if phi psi chain

phiPsiChainTalos

public boolean phiPsiChainTalos(double[] rdcArr1,
                                double[] rdcArr2,
                                Matrix rg,
                                double Syy,
                                double Szz,
                                int i,
                                int N,
                                double[] ppS,
                                java.util.Vector ppVec,
                                boolean rightHand,
                                boolean isHelix,
                                int firstResNo,
                                java.util.Vector vecTalos)
A recusive function to compute all the backbone (phi, psi) angles for an $N$-residue fragment This is a version for real computation, NOT for collecting running statistics.

Parameters:
rdcArr1 - an array of CH RDCs for the fragment
rdcArr2 - an array of NH RDCs for the fragment
rg - a matrix to rotate the POF to a coodinate system defined in the first peptide plane.
Syy - Saupe elements computed from both NH and CH rdcs
Szz - Saupe elements computed from both NH and CH rdcs
i - the current depth of the depth-first search. Begin the call with i = 0;
N - the total depth of the depth-first search.
ppS - a temporary array for saving intermediate (\phi, \psi) angles.
ppVec - an array for saving and returning final (\phi, \psi) angles.
rightHand - make sure the computed rg has the same handedness as the rotating matrix by the SVD method
isHelix - the is helix
firstResNo - the first res no
vecTalos - the vec talos
Returns:
true, if phi psi chain talos

extractRestraints

public double[][] extractRestraints(int begin,
                                    int end,
                                    java.util.Vector h1Vec,
                                    java.util.Vector asgVec,
                                    java.util.Vector rdcVec1,
                                    java.util.Vector rdcVec2,
                                    double a1,
                                    double a2)
The method right now may have ERROR! To extract all the sequential restraints (both RDCs and NOEs) involving the backbone nuclei (HA and NH) located in the turn or the loop.

Parameters:
begin - the first residue of the fragment (turn and loop)
end - the last residue of the fragment (turn and loop)
h1Vec - resonance assignment sorted by H1 CS shift.
asgVec - the merged resonacs assigement and HN and HA NOEs
rdcVec1 - the CH RDC
rdcVec2 - the NH RDC
a1 - the constant used to convert the intensity to distance
a2 - the constant used to convert the intensity to distance
Returns:
a double array, and the elements of each row is {chRdc, nhRdc, dna, dan, dnn} where chRdc is for residue i and nhRDc for residue i+1

restraintsBackward

public double[][] restraintsBackward(int begin,
                                     int end,
                                     java.util.Vector h1Vec,
                                     java.util.Vector asgVec,
                                     java.util.Vector rdcVec1,
                                     java.util.Vector rdcVec2,
                                     double a1,
                                     double a2)
To extract all the sequential restraints (both RDCs and NOEs) involving the backbone nuclei (HA and NH) located in the turn or the loop.

Parameters:
begin - the first residue of the fragment (turn and loop) such as 22.
end - the last residue of the fragment (turn and loop) such as 18
h1Vec - resonance assignment sorted by H1 CS shift.
asgVec - the merged resonacs assigement and HN and HA NOEs
rdcVec1 - the CH RDC
rdcVec2 - the NH RDC
a1 - the constant used to convert the intensity to distance
a2 - the constant used to convert the intensity to distance
Returns:
a double array, and the elements of each row is {chRdc, nhRdc, dna, dan, dnn}, where dan and dnn are between residue HA(i) <--> HN(i+1) and HN(i) <--> HN(i+1), the double array begin with residue "begin"

phiPsiByRdcNoe

public boolean phiPsiByRdcNoe(java.util.Vector asgVec,
                              double[][] restraints,
                              double Syy,
                              double Szz,
                              double[] n0,
                              double[] nh0,
                              double[] ca0,
                              Matrix rg,
                              int depth,
                              int N,
                              double[] ppS,
                              java.util.Vector ppVec,
                              double[] nToNHVec2,
                              double[] nToCAVec2,
                              double[] ca2)
A recusive function to compute all the backbone (phi, psi) angles for an $m$-residue fragment This is a version for real computation, NOT for collecting running statistics.

Parameters:
asgVec - has the resonance assignment and NOE peaklist
restraints - a double array, and the elements of each row is {chRdc, nhRdc, dna, dan, dnn}
rg - a matrix to rotate the POF to a coodinate system defined in the first peptide plane.
Syy - Saupe elements computed from both NH and CH rdcs
Szz - Saupe elements computed from both NH and CH rdcs
depth - the current depth of the depth-first search. Begin with i = 0;
N - the total depth of the depth-first search, the same as the number of residues
ppS - a temporary array for saving intermediate (\phi, \psi) angles.
ppVec - an array for returning final (\phi, \psi) angles.
ca2 - the coordinate of the CA nucleus of the end side of the loop We need a method to search all the possible NOEs based two proton CSs, which can be used for identify possible sequential NOE assignment. // double dnaCal = 0.0, danCal = 0.0, dnnCal = 0.0; // double [] noeScore = new double[5]; // for (i=0; in0 - the n0
nh0 - the nh0
ca0 - the ca0
nToNHVec2 - the n to nh vec2
nToCAVec2 - the n to ca vec2
Returns:
true, if phi psi by rdc noe

loop34To41

public boolean loop34To41(double[][] restraints,
                          double Syy,
                          double Szz,
                          int no1,
                          int no2,
                          double[] n,
                          double[] nh,
                          double[] ca,
                          double[] n2,
                          double[] nh2,
                          double[] ca2,
                          java.util.Vector phiPsiVec,
                          double[] rdcRmsd)
Loop34 to41.

Parameters:
restraints - the restraints
Syy - the syy
Szz - the szz
no1 - the no1
no2 - the no2
n - the n
nh - the nh
ca - the ca
n2 - the n2
nh2 - the nh2
ca2 - the ca2
phiPsiVec - the phi psi vec
rdcRmsd - the rdc rmsd
Returns:
true, if successful

phiPsiByPP14

public boolean phiPsiByPP14(double[] ca1,
                            double[] n4,
                            double[] ca4,
                            double[] nh4,
                            Matrix rg1,
                            Matrix rg4,
                            java.util.Vector solutionVec)
Compute the CA directions of residues 2 and 3 specified by polar angles (theta, phi), given the CA coordinates for residue 1 and 3 and the theta polar angle for residue 2. See Math derivation for the detail; Be careful to return all the solutions.

Parameters:
ca1 - the coordinate of the CA nucleus of residue i
n4 - the n4
ca4 - the ca4
nh4 - the nh4
rg1 - the rg1
rg4 - the rg4
solutionVec - the solution vec
Returns:
true, if phi psi by p p14

newNCA

public double[] newNCA(double phi,
                       double psi,
                       Matrix rg)
Method for the computation of new N->CA vector for residue $i+1$ from the computed \Phi and Psi angles.

Parameters:
phi - the \Phi angle of residue $i$
phi - the \Phi angle of residue $i$
rg - the first rotation matrix to the coordinate frame defined in the Math derivation
Returns:
a new n2CA vector (n2CA vector of residue $i+1$)

newRG

public Matrix newRG(double phi,
                    double psi,
                    Matrix rg)
Method for the computation of new N->CA vector for residue $i+1$ from the computed \Phi and Psi angles of residue $i$.

Parameters:
phi - the \Psi angle of residue $i$
rg - the rotation matrix to the coordinate frame defined in the peptide plane $i$ as in the Math derivation
psi - the psi
Returns:
a new rotation matrix rg, i.e. the rotation matrix for the residue $i+1$.

newRG

public Matrix newRG(double phi,
                    double psi,
                    Matrix rg,
                    boolean rightHand)
Method for the computation of new N->CA vector for residue $i+1$ from the computed \Phi and Psi angles of residue $i$.

Parameters:
phi - the \Psi angle of residue $i$
rg - the rotation matrix to the coordinate frame defined in the peptide plane $i$ as in the Math derivation
psi - the psi
rightHand - the right hand
Returns:
a new rotation matrix rg, i.e. the rotation matrix for the residue $i+1$.

vdwEnergy

public double vdwEnergy(java.util.Vector pdbVec1,
                        java.util.Vector pdbVec2,
                        int[] count)
Vdw energy.

Parameters:
pdbVec1 - the pdb vec1
pdbVec2 - the pdb vec2
count - the count
Returns:
the double

talosAngleReader

public java.util.Vector<PhiPsi> talosAngleReader(java.lang.String talosFile)
A very simple reader for talos angle.

Parameters:
talosFile - the name of the file
Returns:
a vector of PhiPsi object

loop50To56

public void loop50To56(java.util.Vector h1Vec,
                       java.util.Vector asgVec2,
                       java.util.Vector pdbVec,
                       java.util.Vector h56To59Pdb,
                       java.util.Vector chRdcVec,
                       java.util.Vector nhRdcVec,
                       double Syy,
                       double Szz,
                       int no1,
                       int no2,
                       double a1,
                       double a2)
Compute the loop L50-L56 given the orientation of the peptide planes L50 and L56. Since there is no RDCs for G53, we compute the backbone angles of L50 and E51 and the phi angle of D52 by forward method. the backbone angles for R54 and T55 are computed by backward method. FOr each computed conformation, we compute the link between Y59--E64 as presented in the following.

Parameters:
no1 - L50
no2 - L56
pdbVec - the coordinates for the entire protein minus the loop (E51-L63)
h56To59Pdb - the RDC-oriented helix L56-Y59
h1Vec - the h1 vec
asgVec2 - the asg vec2
chRdcVec - the ch rdc vec
nhRdcVec - the nh rdc vec
Syy - the syy
Szz - the szz
a1 - the a1
a2 - the a2

loop59To65

public boolean loop59To65(double[][] restraints,
                          double Syy,
                          double Szz,
                          int no1,
                          int no2,
                          double[] n,
                          double[] nh,
                          double[] ca,
                          double[] n2,
                          double[] nh2,
                          double[] ca2,
                          java.util.Vector phiPsiVec,
                          double[] rdcRmsd)
Compute the loop Y59 <--> K63 given the absolute coordinates for Y59 and E64.

Parameters:
no1 - the N-terminal of the loop. (Y59 in ubiquitin)
no2 - the C-terminal of the loop. (K63 in ubiquitin)
n - the amide coordinate of the beginning residue (Y59) of the loop
nh - the amide proton coordinate of the beginning residue (Y59) of the loop
ca - the CA coordinate of the beginning residue (Y59) of the loop
n2 - the amide coordinate of the ending residue (E64) of the loop
nh2 - the amide proton coordinate of the ending residue (E64) of the loop
ca2 - the CA coordinate of the beginning residue (E64) of the loop
phiPsiVec - for returning the backbone angles.
restraints - the restraints
Syy - the syy
Szz - the szz
rdcRmsd - the rdc rmsd
Returns:
true, if loop59 to65