 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
55 vector<double> bx(4), by(4), bz(4), v(4,0);
60 for ( i=0; i<4; i++ ) bx[i] = by[i] = bz[i] = 0;
69 for ( n=0, mol1=molgroup1->
mol, mol2=molgroup2->
mol; mol1 && mol2; mol1=mol1->
next, mol2=mol2->
next ) {
70 for ( res1=mol1->
res, res2=mol2->
res; res1 && res2; res1=res1->
next, res2=res2->
next ) {
71 for ( atom1=res1->
atom, atom2=res2->
atom; atom1 && atom2; atom1=atom1->
next, atom2=atom2->
next ) {
72 if ( strncmp(atom1->
el, atom2->
el, 2) == 0 ) {
73 c1 = atom1->
coord - com;
77 c2 = atom2->
coord - com;
78 for ( i=0; i<4; i++ ) {
82 for ( j=0; j<=i; j++ ) a[i][j] += v[i]*v[j];
91 for ( j=i+1; j<4; j++ ) a[i][j] = a[j][i];
99 Matrix3 mat(bx[0],bx[1],bx[2],by[0],by[1],by[2],bz[0],bz[1],bz[2]);
107 cout <<
"Atoms compared: " << n << endl;
143 vector<double> bx(4), by(4), bz(4), v(4,0);
148 for ( i=0; i<4; i++ ) bx[i] = by[i] = bz[i] = 0;
150 Batom *atom1, *atom2;
153 if ( offset < 0 )
for ( i=0; i<-offset; i++ ) res2=res2->
next;
154 else for ( i=0; i<offset; i++ ) res1=res1->
next;
158 if ( offset < 0 )
for ( i=0; i<-offset; i++ ) res2=res2->
next;
159 else for ( i=0; i<offset; i++ ) res1=res1->
next;
164 for ( n=0; res1 && res2; res1=res1->
next, res2=res2->
next ) {
165 for ( atom1=res1->
atom, atom2=res2->atom; atom1 && atom2; atom1=atom1->
next, atom2=atom2->
next ) {
166 if ( strncmp(atom1->
el, atom2->
el, 2) == 0 ) {
167 c1 = atom1->
coord - com;
171 c2 = atom2->
coord - com;
172 for ( i=0; i<4; i++ ) {
176 for ( j=0; j<=i; j++ ) a[i][j] += v[i]*v[j];
183 for ( i=0; i<3; i++ )
184 for ( j=i+1; j<4; j++ ) a[i][j] = a[j][i];
192 Matrix3 mat(bx[0],bx[1],bx[2],by[0],by[1],by[2],bz[0],bz[1],bz[2]);
216 double d, ad(0), sd(0), R(0);
219 Batom *atom1, *atom2;
223 for ( mol1=molgroup1->
mol, mol2=molgroup2->
mol; mol1 && mol2; mol1=mol1->
next, mol2=mol2->
next ) {
224 for ( res1=mol1->
res, res2=mol2->
res; res1 && res2; res1=res1->
next, res2=res2->
next ) {
225 for ( atom1=res1->
atom, atom2=res2->
atom; atom1 && atom2; atom1=atom1->
next, atom2=atom2->
next ) {
226 if ( strncmp(atom1->
el, atom2->
el, 2) == 0 ) {
242 if ( sd > 0 ) R = sqrt(sd);
244 if ( sd > 0 ) sd = sqrt(sd);
251 cout <<
"Number of comparisons: " << n << endl;
252 cout <<
"Center-of-mass difference: " << comd <<
" " << comd.
length() << endl;
253 cout <<
"Distance avg & std: " << ad <<
" " << sd <<
" A" << endl;
254 cout <<
"RMSD: " << R <<
" A" << endl << endl;
273 double d, ad(0), sd(0), R(0);
275 Batom *atom1, *atom2;
277 for ( res1=mol1->
res, res2=mol2->
res; res1 && res2; res1=res1->
next, res2=res2->
next ) {
278 for ( atom1=res1->
atom, atom2=res2->
atom; atom1 && atom2; atom1=atom1->
next, atom2=atom2->
next ) {
279 if ( strncmp(atom1->
el, atom2->
el, 2) == 0 ) {
291 if ( sd > 0 ) R = sqrt(sd);
293 if ( sd > 0 ) sd = sqrt(sd);
300 cout <<
"Center-of-mass difference: " << comd <<
" " << comd.
length() << endl;
301 cout <<
"Distance avg & std: " << ad <<
" " << sd <<
" A" << endl;
302 cout <<
"RMSD: " << R <<
" A" << endl << endl;
318 Batom *atom1, *atom2;
322 for ( mol1 = molgroup1->
mol; mol1; mol1 = mol1->
next ) {
323 for( res1 = mol1->
res; res1; res1 = res1->
next ) {
324 for ( atom1 = res1->
atom; atom1; atom1 = atom1->
next ) {
326 for ( mol2 = molgroup2->
mol; mol2; mol2 = mol2->
next ) {
327 for( res2 = mol2->
res; res2; res2 = res2->
next ) {
328 for ( atom2 = res2->
atom; atom2; atom2 = atom2->
next ) {
330 if ( d > dd ) d = dd;
358 Batom *atom1, *atom2;
362 for ( i=0, res1 = m1->
res; res1; res1 = res1->
next, ++i ) {
363 for ( atom1 = res1->
atom; atom1 && strncmp(atom1->
type,
"CA", 2); atom1 = atom1->
next ) ;
365 for ( j=0, res2 = m2->
res; res2; res2 = res2->
next, ++j ) {
366 for ( atom2 = res2->
atom; atom2 && strncmp(atom2->
type,
"CA", 2); atom2 = atom2->
next ) ;
Transform mol_find_transformation(Bmolecule *mol1, Bmolecule *mol2, int offset)
Determines the transformation between two identical molecules.
Header file for matrix functions.
Vector3< double > mol_center_of_mass(Bmolecule *mol)
Calculates the center of mass of a molecule.
int molgroup_kill(Bmolgroup *molgroup)
Destroys a molecule group.
int multiply_in_place(vector< double > &vec)
Header file for general symmetry functions.
3x3 Matrix manipulation functions
double distance2(const Vector3 &v)
Transform molgroup_find_transformation(Bmolgroup *molgroup1, Bmolgroup *molgroup2)
Determines the transformation between two groups of identical molecules.
double distance(const Vector3 &v)
double singular_value_decomposition()
Singular value decomposition of a matrix .
Header file for reading reflection files.
Header file for reading atom property files.
Header file for functions to generate and analyze dot plots.
double mol_calculate_rmsd(Bmolecule *mol1, Bmolecule *mol2)
Calculates the RMSD between two molecules.
Library routines used to compare sets of atomic coordinates.
Header file for general utilities.
Vector3< double > molgroup_center_of_mass(Bmolgroup *molgroup)
Calculates the center of mass of a molecule group.
Generalized matrix class.
Library routines used for symmetry operations on atomic coordinates.
Matrix mol_distance_matrix(Bmolecule *m1, Bmolecule *m2)
Calculates the distance matrix between the residues in two molecules.
double molgroup_calc_brute_rmsd(Bmolgroup *molgroup1, Bmolgroup *molgroup2)
Calculates the RMSD based on nearest atoms.
double molgroup_rotate_and_compare(Bmolgroup *molgroup, Transform t)
Copies and rotates the molecule group and compares it with the original.
double molgroup_calculate_rmsd(Bmolgroup *molgroup1, Bmolgroup *molgroup2)
Calculates the root-mean-square-deviation between two molecule groups.
Bmolgroup * molgroup_copy(Bmolgroup *molgroup)
Copies a molecule group.
Library routines used for atomic coordinates.
int matrix3_show_hp(Matrix3 &mat)
Print out a matrix.