Bsoft 2.1.4
Bernard's software package
mol_compare.cpp File Reference

Library routines used to compare sets of atomic coordinates. More...

#include "rwmolecule.h"
#include "rwatomprop.h"
#include "mol_symmetry.h"
#include "mol_compare.h"
#include "mol_transform.h"
#include "mol_util.h"
#include "seq_align.h"
#include "Matrix3.h"
#include "matrix_linear.h"
#include "Matrix.h"
#include "symmetry.h"
#include "utilities.h"

Functions

double molgroup_rotate_and_compare (Bmolgroup *molgroup, Transform t)
 Copies and rotates the molecule group and compares it with the original. More...
 
Transform molgroup_find_transformation (Bmolgroup *molgroup1, Bmolgroup *molgroup2)
 Determines the transformation between two groups of identical molecules. More...
 
Transform mol_find_transformation (Bmolecule *mol1, Bmolecule *mol2, int offset)
 Determines the transformation between two identical molecules. More...
 
double molgroup_calculate_rmsd (Bmolgroup *molgroup1, Bmolgroup *molgroup2)
 Calculates the root-mean-square-deviation between two molecule groups.
More...
 
double mol_calculate_rmsd (Bmolecule *mol1, Bmolecule *mol2)
 Calculates the RMSD between two molecules. More...
 
double molgroup_calc_brute_rmsd (Bmolgroup *molgroup1, Bmolgroup *molgroup2)
 Calculates the RMSD based on nearest atoms. More...
 
Matrix mol_distance_matrix (Bmolecule *m1, Bmolecule *m2)
 Calculates the distance matrix between the residues in two molecules. More...
 

Variables

int verbose
 

Detailed Description

Library routines used to compare sets of atomic coordinates.

Author
Bernard Heymann
Date
Created: 20021020
Modified: 20150209

Function Documentation

◆ mol_calculate_rmsd()

double mol_calculate_rmsd ( Bmolecule mol1,
Bmolecule mol2 
)

Calculates the RMSD between two molecules.

Parameters
*mol1first molecule.
*mol2second molecule.
Returns
double RMSD.
The root-mean-square-deviation between two sets of corrdinates is given by:
    R = sqrt(sum(length(coord1-coord2))/number).

◆ mol_distance_matrix()

Matrix mol_distance_matrix ( Bmolecule m1,
Bmolecule m2 
)

Calculates the distance matrix between the residues in two molecules.

Parameters
*m1first molecules structure.
*m2second molecules structure.
Returns
Matrix distance matrix.
The matrix is calculated from the pairwise distances between residues. 

◆ mol_find_transformation()

Transform mol_find_transformation ( Bmolecule mol1,
Bmolecule mol2,
int  offset 
)

Determines the transformation between two identical molecules.

Parameters
*mol1first molecule.
*mol2second molecule.
offsetoffset of second sequence with respect to first.
Returns
Transform transform structure.
The transformation:
    coord2 = rot_mat * (coord1 - origin) + origin + shift
is solved.
The algorithm is set up in parts, solving first for:
    coord2 = rot_mat * coord1 + shift_temp
The last term is given by:
    shift_temp = shift + origin - rot_mat * origin
The shift vector must be parallel to the rotation axis, and is
determined as:
    shift = axis * |shift_temp| * cos(alpha)
where alpha is the angle between shift_temp and the rotation axis.
The origin is then calculated from:
    origin = (shift_temp - shift) * inverse(id_mat - rot_mat)
Note that the origin still has one degree of freedom: It can be
anywhere along the rotation axis.

◆ molgroup_calc_brute_rmsd()

double molgroup_calc_brute_rmsd ( Bmolgroup molgroup1,
Bmolgroup molgroup2 
)

Calculates the RMSD based on nearest atoms.

Parameters
*molgroup1first molecule group.
*molgroup2second molecule group.
Returns
double RMSD.

◆ molgroup_calculate_rmsd()

double molgroup_calculate_rmsd ( Bmolgroup molgroup1,
Bmolgroup molgroup2 
)

Calculates the root-mean-square-deviation between two molecule groups.

Parameters
*molgroup1first molecule group.
*molgroup2second molecule group.
Returns
double root-mean-square-deviation.
The two molecule groups must have identical structures.

◆ molgroup_find_transformation()

Transform molgroup_find_transformation ( Bmolgroup molgroup1,
Bmolgroup molgroup2 
)

Determines the transformation between two groups of identical molecules.

Parameters
*molgroup1first molecule group.
*molgroup2second molecule group.
Returns
Transform transform structure.

◆ molgroup_rotate_and_compare()

double molgroup_rotate_and_compare ( Bmolgroup molgroup,
Transform  t 
)

Copies and rotates the molecule group and compares it with the original.

Parameters
*molgroupmolecule group.
trotation operation.
Returns
double RMSD.

Variable Documentation

◆ verbose

int verbose
extern