| Bsoft 2.0.5 Bernard's software package

Functions
mol_compare.h File Reference

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

`#include "Transform.h"`
`#include "rwmolecule.h"`

Go to the source code of this file.

## 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 *molgroup, 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...

## Detailed Description

Library routines used to compare sets of atomic coordinates.

Author
  Bernard Heymann

Date
  Created: 20021020
  Modified: 20070810

Definition in file mol_compare.h.

## Function Documentation

## ◆ mol_calculate_rmsd()

double mol_calculate_rmsd | ( | Bmolecule * | mol1,
|  | Bmolecule * | mol2
| ) |  |

Calculates the RMSD between two molecules.

Parameters

  *mol1 | first molecule.
  *mol2 | second molecule.

Returns
  double RMSD.

      The root-mean-square-deviation between two sets of corrdinates is given by:
          R = sqrt(sum(length(coord1-coord2))/number).

Definition at line 270 of file mol_compare.cpp.

## ◆ mol_find_transformation()

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

Determines the transformation between two identical molecules.

Parameters

  *mol1 | first molecule.
  *mol2 | second molecule.
  offset | offset 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.

Definition at line 139 of file mol_compare.cpp.

## ◆ molgroup_calc_brute_rmsd()

double molgroup_calc_brute_rmsd | ( | Bmolgroup * | molgroup1,
|  | Bmolgroup * | molgroup2
| ) |  |

Calculates the RMSD based on nearest atoms.

Parameters

  *molgroup1 | first molecule group.
  *molgroup2 | second molecule group.

Returns
  double RMSD.

Definition at line 314 of file mol_compare.cpp.

## ◆ molgroup_calculate_rmsd()

double molgroup_calculate_rmsd | ( | Bmolgroup * | molgroup1,
|  | Bmolgroup * | molgroup2
| ) |  |

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

Parameters

  *molgroup1 | first molecule group.
  *molgroup2 | second molecule group.

Returns
  double root-mean-square-deviation.

      The two molecule groups must have identical structures.

Definition at line 213 of file mol_compare.cpp.

## ◆ molgroup_find_transformation()

Transform molgroup_find_transformation | ( | Bmolgroup * | molgroup1,
|  | Bmolgroup * | molgroup2
| ) |  |

Determines the transformation between two groups of identical molecules.

Parameters

  *molgroup1 | first molecule group.
  *molgroup2 | second molecule group.

Returns
  Transform transform structure.

Definition at line 51 of file mol_compare.cpp.

## ◆ 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

  *molgroup | molecule group.
  t | rotation operation.

Returns
  double RMSD.

Definition at line 31 of file mol_compare.cpp.