Rosetta 3.3
Classes | Functions
numeric::model_quality Namespace Reference

Classes

class  RmsData
 RmsData is a class intended to replace the global rms_obj namespace from rosetta++. Initial implementation is with a singleton design pattern to mimic a global namespace from rosetta++. More...

Functions

void maxsub (int &nsup, FArray1A_double xe, FArray1A_double xp, double &rms, double &psi, int &nali, double &zscore, double &evalue, double &score, double rmstol, double distance_tolerance)
 identify the largest subset of CA atoms of a model that superimposes "well" (under certain rms cutoff) over the experimental structure
double erfcc (double x)
void COMAS (FArray1A_double C, FArray1A_double WT, int NAT, double &XC, double &YC, double &ZC)
void COMAS (FArray1A< double > C, FArray1A< double > WT, int NAT, double &XC, double &YC, double &ZC)
numeric::Real calc_rms (utility::vector1< xyzVector< Real > > p1_coords, utility::vector1< xyzVector< Real > > p2_coords)
numeric::Real rms_wrapper (int natoms, FArray2D< numeric::Real > p1a, FArray2D< numeric::Real > p2a)
void calc_rms_fast (float &rms_out, FArray2A< numeric::Real > xx, FArray2A< numeric::Real > yy, FArray1A< numeric::Real > ww, int npoints, numeric::Real ctx)
 companion function for findUU ( it is optional ) computes the minimum RMS deviation beteen XX and YY as though it rotated the arrays, without actually rotating them.
void findUU (FArray2< numeric::Real > &XX, FArray2< numeric::Real > &YY, FArray1< numeric::Real > const &WW, int Npoints, FArray2< numeric::Real > &UU, numeric::Real &sigma3)
 intended to rotate one protein xyz array onto another one such that the point-by-point rms is minimized.
void BlankMatrixMult (FArray2A< numeric::Real > A, int n, int np, int transposeA, FArray2A< numeric::Real > B, int m, int transposeB, FArray2A< numeric::Real > AxB_out)
void MatrixMult (FArray2A< numeric::Real > A, int n, int np, int transposeA, FArray2A< numeric::Real > B, int m, int transposeB, FArray2A< numeric::Real > AxB_out)
void fixEigenvector (FArray2A< numeric::Real > m_v)
void rmsfitca2 (int npoints, ObjexxFCL::FArray2A< double > xx, ObjexxFCL::FArray2A< double > yy, ObjexxFCL::FArray1A< double > ww, int natsel, double &esq)
 computes the rms between two weighted point vectors.
void rmsfitca3 (int npoints, ObjexxFCL::FArray2A< double > xx0, ObjexxFCL::FArray2A< double > xx, ObjexxFCL::FArray2A< double > yy0, ObjexxFCL::FArray2A< double > yy, double &esq)
double det3 (ObjexxFCL::FArray2A< double > m)
 determinant of a 3x3 matrix
void rsym_eigenval (ObjexxFCL::FArray2A< double > m, ObjexxFCL::FArray1A< double > ev)
 computes the eigen values of a real symmetric 3x3 matrix
void rsym_rotation (ObjexxFCL::FArray2A< double > mm, ObjexxFCL::FArray2A< double > m, ObjexxFCL::FArray1A< double > ev, ObjexxFCL::FArray2A< double > rot)
 finds a (proper) rotation matrix that minimizes the rms.
void rsym_evector (ObjexxFCL::FArray2A< double > m, ObjexxFCL::FArray1A< double > ev, ObjexxFCL::FArray2A< double > mvec)
 Author: charlie strauss (cems) 2001 given original matrix plus its eigen values compute the eigen vectors. USAGE notice: for computing min rms rotations be sure to call this with the lowest eigen value in Ev(3).
template<typename T >
void center_atoms_at_origin (utility::vector1< xyzVector< T > > &coords)
 Function that takes a vector1 of coordinates, calculates their center of mass, and translates the center of mass to (0,0,0).

Function Documentation

void numeric::model_quality::BlankMatrixMult ( FArray2A< numeric::Real A,
int  n,
int  np,
int  transposeA,
FArray2A< numeric::Real B,
int  m,
int  transposeB,
FArray2A< numeric::Real AxB_out 
)

BlankMatrixMult

Detailed:
Parameters:
A- [in/out]? -
n- [in/out]? -
np- [in/out]? -
transposeA- [in/out]? -
B- [in/out]? -
m- [in/out]? -
transposeB- [in/out]? -
AxB_out- [in/out]? -
Global Read:
Global Write:
Remarks:
References:
Authors:
Last Modified:

References ObjexxFCL::FArray2A< T >::dimension(), and MatrixMult().

Referenced by findUU().

numeric::Real numeric::model_quality::calc_rms ( utility::vector1< xyzVector< Real > >  p1_coords,
utility::vector1< xyzVector< Real > >  p2_coords 
)

References color_pdb::i, and rms_wrapper().

Referenced by main().

void numeric::model_quality::calc_rms_fast ( float &  rms_out,
FArray2A< numeric::Real xx,
FArray2A< numeric::Real yy,
FArray1A< numeric::Real ww,
int  npoints,
numeric::Real  ctx 
)

companion function for findUU ( it is optional ) computes the minimum RMS deviation beteen XX and YY as though it rotated the arrays, without actually rotating them.

calc_rms_fast

Detailed:
Parameters:
rms_out[in/out]? - the real-valued output value of the rms deviation
XX- [in/out]? - first set of points representing xyz coordinates
YY- [in/out]? - second set of points representing xyz coordinates
WW- [in/out]? - relative weight for each point
npoints- [in/out]? - number of points
ctx- [in/out]? - magic number computed during find UU that is needed for this calculation
Global Read:
Global Write:
Remarks:
the XX, YY, WW must be the same as call to findUU (remember that findUU offsets the XX and YY weighted COM to the origin!)
References:
Authors:
Last Modified:

References ObjexxFCL::abs(), ObjexxFCL::FArray1A< T >::dimension(), ObjexxFCL::FArray2A< T >::dimension(), and loops_kic::rms.

Referenced by rms_wrapper().

template<typename T >
void numeric::model_quality::center_atoms_at_origin ( utility::vector1< xyzVector< T > > &  coords)

Function that takes a vector1 of coordinates, calculates their center of mass, and translates the center of mass to (0,0,0).

References end.

void numeric::model_quality::COMAS ( FArray1A_double  C,
FArray1A_double  WT,
int  NAT,
double XC,
double YC,
double ZC 
)

COMAS

Detailed:
Parameters:
C- [in/out]? -
WT- [in/out]? -
NAT- [in/out]? -
XC- [in/out]? -
YC- [in/out]? -
ZC- [in/out]? -
Global Read:
Global Write:
Remarks:
References:
Authors:
Last Modified:

References ObjexxFCL::FArray1A< T >::dimension(), color_pdb::i, and ObjexxFCL::star.

Referenced by rmsfitca2().

void numeric::model_quality::COMAS ( FArray1A< double C,
FArray1A< double WT,
int  NAT,
double XC,
double YC,
double ZC 
)

COMAS

Detailed:
Parameters:
C- [in/out]? -
WT- [in/out]? -
NAT- [in/out]? -
XC- [in/out]? -
YC- [in/out]? -
ZC- [in/out]? -
Global Read:
Global Write:
Remarks:
References:
Authors:
Last Modified:
double numeric::model_quality::det3 ( ObjexxFCL::FArray2A< double m)

determinant of a 3x3 matrix

det3

Detailed:
cute factoid: det of a 3x3 is the dot product of one row with the cross product of the other two. This explains why a right hand coordinate system has a positive determinant. cute huh?
Parameters:
m- [in/out]? -
Returns:
Global Read:
Global Write:
Remarks:
References:
Authors:
charlie strauss 2001
Last Modified:

References ObjexxFCL::FArray2A< T >::dimension().

Referenced by rmsfitca2(), and rmsfitca3().

double numeric::model_quality::erfcc ( double  x)

erfcc

Detailed:
Parameters:
x- [in/out]? -
Returns:
Global Read:
Global Write:
Remarks:
References:
(C) Copr. 1986-92 Numerical Recipes Software
Authors:
Last Modified:

References ObjexxFCL::abs(), and sd::t.

Referenced by maxsub().

void numeric::model_quality::findUU ( FArray2< numeric::Real > &  XX,
FArray2< numeric::Real > &  YY,
FArray1< numeric::Real > const &  WW,
int  Npoints,
FArray2< numeric::Real > &  UU,
numeric::Real sigma3 
)

intended to rotate one protein xyz array onto another one such that the point-by-point rms is minimized.

findUU

Detailed:
1) ORIGINAL PAPER HAD ERROR IN HANDEDNESS OF VECTORS, LEADING TO INVERSION MATRICIES ON OCCASION. OOPS. NOW FIXED. SEE ACTA CRYST(1978) A34 PAGE 827 FOR REVISED MATH 2) TRAP DIVIDE BY ZERO ERRORS WHEN NO ROTATIONS REQUIRED. 3) ADDED WEIGHTS (WEIGHTS NOW WORK) 4) ADDED FAST RMS CALC AUXILIRARY ROUTINE. 5) CHANGED TO numeric::Real TO DEAL WITH HIGHLY DISSIMILAR BUT LARGE PROTEINS.

switched order of array subscripts so that can use logical array sizes XX and YY are lists of Npoints XYZ vectors (3xNpoint matrix) to be co-aligned these matrices are returned slightly modified: they are translated so their origins are at the center of mass (see Weights below ). WW is the weight or importance of each point (weighted RMS) vector of size Npoints The center of mass is figured including this variable. UU is a 3x3 symmetric orthonornal rotation matrix that will rotate YY onto XX such that the weighted RMS distance is minimized.

Parameters:
[in]XX- in - XX,YY are 2D arrays of x,y,z position of each atom
[in]YY- in -
[in]WW- in - a weight matrix for the points
[in]Npoints- in - the number of XYZ points (need not be physical array size)
[out]UU- out - 3x3 rotation matrix.
[out]sigma3- out - TO BE PASSED TO OPTIONAL FAST_RMS CALC ROUTINE.
Global Read:
Global Write:
Remarks:
SIDEEFECTS: the Matrices XX, YY are Modified so that their weighted center of mass is moved to (0,0,0).

CAVEATS: 1) it is CRITICAL that the first physical dimension of XX and YY is 3

2) an iterative approx algorithm computes the diagonalization of a 3x3 matrix. if this program needs a speed up this could be made into an analytic but uggggly diagonalization function.

References:
Mathethematical Basis from paper: (Wolfgang Kabsch) acta Cryst (1976) A32 page 922
Authors:
Charlie Strauss 1999 Revised april 22
Last Modified:

References ObjexxFCL::abs(), BlankMatrixMult(), ObjexxFCL::fmt::E(), numeric::eigenvector_jacobi(), fixEigenvector(), color_pdb::i, XX, and YY.

Referenced by rms_wrapper().

void numeric::model_quality::fixEigenvector ( FArray2A< numeric::Real m_v)

fixEigenvector

Detailed:
m_v is a 3x3 matrix of 3 eigen vectors replaces the third eigenvector by taking cross product of of the first two eigenvectors
Parameters:
m_v- [in/out]? -
Global Read:
Global Write:
Remarks:
References:
Authors:
Last Modified:

References ObjexxFCL::FArray2A< T >::dimension().

Referenced by findUU().

void numeric::model_quality::MatrixMult ( FArray2A< numeric::Real A,
int  n,
int  np,
int  transposeA,
FArray2A< numeric::Real B,
int  m,
int  transposeB,
FArray2A< numeric::Real AxB_out 
)

MatrixMult

Detailed:
multiplys matrices A (npXn) and B (npXn). results in AxB.out IF THE MATRICES are SQUARE. you can also multiply the transposes of these matrices to do so set the transposeA or transposeB flags to 1, otherwise they should be zero.
Parameters:
A- [in/out]? -
n- [in/out]? -
np- [in/out]? -
transposeA- [in/out]? -
B- [in/out]? -
m- [in/out]? -
transposeB- [in/out]? -
AxB_out- [in/out]? -
Global Read:
Global Write:
Remarks:
transpose only works correctly for square matricies!

this function does SUMS to the old value of AxB_out... you might want to call BlankMatrixMult instead (see above) 4/30/01 jjg

this function works on numeric::Real values float version below. jjg

References:
Authors:
charlie strauss 1999
Last Modified:

References ObjexxFCL::fmt::A(), ObjexxFCL::FArray2A< T >::dimension(), and color_pdb::i.

Referenced by BlankMatrixMult().

void numeric::model_quality::maxsub ( int nsup,
FArray1A_double  xe,
FArray1A_double  xp,
double rms,
double psi,
int nali,
double zscore,
double evalue,
double score,
double  rmstol,
double  distance_tolerance 
)

identify the largest subset of CA atoms of a model that superimposes "well" (under certain rms cutoff) over the experimental structure

maxsub_native

Detailed:
cems 2001. this is the main rosetta entry point for this function. it is a wrapper for max sub, converting the input arrays to double precision and reducing them to just calphas it does max sub comparing the claphas passed into thosw of the native and returns the number of aligned residues, the rms of these and the log eval c of the comparison
Parameters:
x- [in/out]? -
nali- [in/out]? -
rms- [in/out]? -
logeval- [in/out]? -
Global Read:
Global Write:
Remarks:
References:
Authors:
Last Modified:
maxsub

this function was adapted and improved by cem strauss from an original template provided by angel ortiz.

Here applies a modification of Dani Fischer's heuristic algorithm for finding the largest subset of residues for superimposition within a threshold. The part that restraints the secondary structure matching needs to be changed.

At this point, the algorithm works as follows: first, the residue assignment is done on the basis of the global secondary structure similarity. Then, with this assignment for residue pairs, the heuristic procedure of Fisher is used.

A seed segment of 7 CA atoms was first superimposed onto the reference structure, then the neighbor radius is gradually increased (up to "distance_tolerance"):to include more CA atoms within the range "t" to do a new superimposition, if the aligned rms is below the rms cutoff "rmstol" the new alignment is accepted. This proceduare is repeated for every 7-residue seed segment along the sequence until the largest subset of atoms which can yield an aligned rms below is found."nsup" is the total number of CA atoms in the model, xe and xp are coordinates of native and model respectively. "rms" is the final aligned rms based on the identified subset of atoms, "nali" is the number of aligned atoms in the subset and "psi" is the ratio of nali/nsup; The rest scores are metrics for quality of the alignment. Note that if no suitable alignment can be found given the input rms cutoff, the rms of overall structure alignment is returned and "nali" is set to zero. -- chu 2009/10

Parameters:
nsup- [in/out]? -
xe- [in/out]? -
xp- [in/out]? -
rms- [in/out]? -
psi- [in/out]? -
nali- [in/out]? -
zscore- [in/out]? -
evalue- [in/out]? -
score- [in/out]? -
Global Read:
Global Write:
Remarks:
References:
Authors:
Last Modified: chu

References numeric::model_quality::RmsData::add_rms(), numeric::model_quality::RmsData::clear_rms(), make_table_of_pilot_apps::d, ObjexxFCL::FArray1A< T >::dimension(), ObjexxFCL::fmt::E(), erfcc(), color_pdb::i, numeric::model_quality::RmsData::instance(), basic::options::OptionKeys::in::file::l, ObjexxFCL::pow(), loops_kic::rms, rmsfitca2(), rmsfitca3(), numeric::square(), and sd::t.

numeric::Real numeric::model_quality::rms_wrapper ( int  natoms,
FArray2D< numeric::Real p1a,
FArray2D< numeric::Real p2a 
)

References calc_rms_fast(), and findUU().

Referenced by calc_rms(), and main().

void numeric::model_quality::rmsfitca2 ( int  npoints,
ObjexxFCL::FArray2A< double xx,
ObjexxFCL::FArray2A< double yy,
ObjexxFCL::FArray1A< double ww,
int  natsel,
double esq 
)

computes the rms between two weighted point vectors.

rmsfitca2

Detailed:
xx_0,yy_0 are the input vectors of of points and ww is their weights xx,yy are by product output vectors of the same points offset to remove center of mass det is an out value of the determinant of the cross moment matrix returned value is the rms

most of this is double for good reasons. first there are some large differences of small numbers. and second the rsymm_eignen() function can internally have numbers larger than the largest double number. (you could do some fancy foot work to rescale things if you really had a problem with this.)

Parameters:
npoints- [in/out]? -
xx- [in/out]? -
yy- [in/out]? -
ww- [in/out]? -
natsel- [in/out]? -
esq- [in/out]? -
Global Read:
Global Write:
Remarks:
det is a double precision real (xx,yy) can be same arrays as (xx_0,yy_0) if desired
References:
Authors:
charlie strauss 2001
Last Modified:

References ObjexxFCL::abs(), COMAS(), det3(), ObjexxFCL::FArray1A< T >::dimension(), ObjexxFCL::FArray2A< T >::dimension(), ObjexxFCL::fmt::E(), color_pdb::i, rosetta_py::utility::rankorder::R, rsym_eigenval(), rsym_rotation(), numeric::sign_transfered(), and sd::t.

Referenced by maxsub().

void numeric::model_quality::rmsfitca3 ( int  npoints,
ObjexxFCL::FArray2A< double xx0,
ObjexxFCL::FArray2A< double xx,
ObjexxFCL::FArray2A< double yy0,
ObjexxFCL::FArray2A< double yy,
double esq 
)

rmsfitca3

Detailed:
This function gets its alignment info via a namespace! Alignment (rotation matrix) and rms(esq) are computed on the basis of residues previously designated by calls to add_rms(). However, the rotation is applied to all Npoints of XX0,yy0 with the results returned in xx,yy.

most of this is double for good reasons. first there are some large differences of small numbers. second the rsymm_eignen() function can internally have numbers larger than the largest double number. (you could do some fancy foot work to rescale m_moment if you really had a problem with this.)

Parameters:
npoints- [in/out]? -
xx0- [in/out]? -
xx- [in/out]? -
yy0- [in/out]? -
yy- [in/out]? -
esq- [in/out]? -
Global Read:
Global Write:
Remarks:
NOTE: det is a double precision real NOTE: (xx,yy) can be same arrays as (xx_0,yy_0) if desired
References:
Authors:
Last Modified:

References ObjexxFCL::abs(), numeric::model_quality::RmsData::count(), det3(), ObjexxFCL::FArray2A< T >::dimension(), ObjexxFCL::fmt::E(), color_pdb::i, numeric::model_quality::RmsData::instance(), NetLink::r, rsym_eigenval(), rsym_rotation(), numeric::sign_transfered(), sd::t, numeric::model_quality::RmsData::xm(), numeric::model_quality::RmsData::xre(), numeric::model_quality::RmsData::xrp(), numeric::model_quality::RmsData::xse(), and numeric::model_quality::RmsData::xsp().

Referenced by maxsub().

void numeric::model_quality::rsym_eigenval ( ObjexxFCL::FArray2A< double m,
ObjexxFCL::FArray1A< double ev 
)

computes the eigen values of a real symmetric 3x3 matrix

rsym_eigenval

Detailed:
the method used is a deterministic analytic result that I hand factored.(whew!) Amusingly, while I suspect this factorization is not yet optimal in the number of calcs required I cannot find a signifcantly better one. (if it were optimal I suspect I would not have to compute imaginary numbers that I know must eventually cancel out to give a net real result.) this method relys on the fact that an analytic factoring of an order 3 polynomial exists. m(3,3) is a 3x3 real symmetric matrix: only the upper triangle is actually used ev(3) is a real vector of eigen values, not neccesarily in sorted order.
Parameters:
m- [in/out]? -
ev- [in/out]? -
Global Read:
Global Write:
Remarks:
References:
Authors:
charlie strauss 2001
Last Modified:

References ObjexxFCL::abs(), test::T850_SubClassing::b, ObjexxFCL::FArray1A< T >::dimension(), ObjexxFCL::FArray2A< T >::dimension(), numeric::max(), ObjexxFCL::pow(), and basic::options::OptionKeys::james::real.

Referenced by rmsfitca2(), and rmsfitca3().

void numeric::model_quality::rsym_evector ( ObjexxFCL::FArray2A< double m,
ObjexxFCL::FArray1A< double ev,
ObjexxFCL::FArray2A< double mvec 
)

Author: charlie strauss (cems) 2001 given original matrix plus its eigen values compute the eigen vectors. USAGE notice: for computing min rms rotations be sure to call this with the lowest eigen value in Ev(3).

rsym_evector

The minimal factorization of the eigenvector problem I have derived below has a puzzling or, rather, interesting assymetry. Namely, it doesn't matter what either ZZ=M(3,3) is or what Ev(3) is! One reason for this is that of course all we need to know is contained in the M matrix in the firstplace, so the eigen values overdetermine the problem We are just exploiting the redundant info in the eigen values to hasten the solution. What I dont know is if infact there exists any symmetic form using the eigen values.

we deliberately introduce another assymetry for numerical stability, and to force proper rotations (since eigen vectors are not unique within a sign change). first, we explicitly numerically norm the vectors to 1 rather than assuming the algebra will do it with enough accuracy. ( and its faster to boot!) second, we explicitly compute the third vector as being the cross product of the previous two rather than using the M matrix and third eigen value. If you arrange the eigen values so that the third eigen value is the lowest then this guarantees a stable result under the case of either very small eigen value or degenerate eigen values. this norm, and ignoring the third eigen value also gaurentee us the even if the eigen vectors are not perfectly accurate that, at least, the matrix that results is a pure orthonormal rotation matrix, which for most applications is the most important form of accuracy.

Detailed:
Parameters:
m- [in/out]? -
ev- [in/out]? -
mvec- [in/out]? -
Global Read:
Global Write:
Remarks:
References:
Authors:
Last Modified:

References utility::io::oc::cerr, ObjexxFCL::FArray1A< T >::dimension(), ObjexxFCL::FArray2A< T >::dimension(), and color_pdb::i.

Referenced by rsym_rotation().

void numeric::model_quality::rsym_rotation ( ObjexxFCL::FArray2A< double mm,
ObjexxFCL::FArray2A< double m,
ObjexxFCL::FArray1A< double ev,
ObjexxFCL::FArray2A< double rot 
)

finds a (proper) rotation matrix that minimizes the rms.

rsym_rotation

Detailed: this computes the rotation matrix based on the eigenvectors of m that gives the
the mimimum rms. this is determined using mm the cross moments matrix.

for best results the third eigen value should be the smallest eigen value!

Parameters:
mm- [in/out]? -
m- [in/out]? -
ev- [in/out]? -
rot- [in/out]? -
Global Read:
Global Write:
Remarks:
References:
Authors:
charlie strauss (cems) 2001
Last Modified:

References ObjexxFCL::abs(), ObjexxFCL::FArray1A< T >::dimension(), ObjexxFCL::FArray2A< T >::dimension(), color_pdb::i, loops_kic::mm, rsym_evector(), and color_pdb::temp.

Referenced by rmsfitca2(), and rmsfitca3().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines