| Bsoft 2.0.5 Bernard's software package

Functions
mol_monte.h File Reference

Headers of functions using a monte carlo metroplis algorithm to energy minimize molecular positions. More...

`#include "rwmolecule.h"`
`#include "rwimg.h"`
`#include "rwmodel.h"`
`#include "rwmd.h"`

Go to the source code of this file.

## Functions
Bmolgroup * | monte_carlo_metropolis (Bmolgroup *molgroup, Bmd *md, Bimage *map, double beta, double max_angle, double max_shift, long max_iter, int rigid, double(Efunc)(Bmolgroup *, Bimage *, Bmd *), int(Tfunc)(Bmolgroup *, double, double))
Bmolgroup * | molgroup_generate_masked_grid_list (Bmolgroup *molgroup, Bimage *pmask, Vector3< double > grid_sampling, Bstring filename)
| Generates multiple versions of a molecule at different locations. More...
Bmodel * | molgroup_generate_masked_grid_list (Bmolgroup *molgroup, Vector3< double > grid_sampling, Bimage *pmask)
Bmolgroup * | molgroup_generate_orientation_list (Bmolgroup *molgroup, double angle_step, Bstring filename, int whole)
| Generates multiple versions of a molecule at different locations. More...
Bmodel * | molgroup_generate_orientation_list (Bmolgroup *molgroup, double angle_step)
Bmolgroup * | mcm_molecule_list (Bmolgroup *molgroup, Bmd *md, Bimage *map, double beta, double max_angle, double max_shift, long max_iter, int rigid)
int | mcm_molecule_groups (Bmolgroup *molgroup, Bmodel *model, Bmd *md, Bimage *map, double beta, double max_angle, double max_shift, long max_iter, int rigid)
| Monte Carlo fit of a set of molecule groups. More...
int | mcm_molecule_list (Bmolgroup *molgroup, Bmodel *model, Bmd *md, Bimage *map, double beta, double max_angle, double max_shift, long max_iter, int rigid)
| Monte Carlo fit of a molecule to a list of locations and orientations. More...
int | molgroup_set_box_to_map_boundaries (Bmolgroup *molgroup, Bimage *map)
| Sets the box in a molgroup to that defined by the map boundaries. More...
long | molgroup_test_if_within_box (Bmolgroup *molgroup, Vector3< double > min, Vector3< double > max)
| Tests if a molecule overlaps with a defined box. More...
double | monte_rigid_body_fit_energy (Bmolgroup *molgroup, Bimage *map, Bmd *md)
| Calculates the potential energy for rigid body fitting. More...
double | monte_atom_fit_energy (Bmolgroup *molgroup, Bimage *map, Bmd *md)
| Calculates the potential energy for fitting atoms to a map. More...
double | monte_bond_fit_energy (Bmolgroup *molgroup, Bimage *map, Bmd *md)
| Calculates the potential energy for fitting bonds to a map. More...
double | molgroup_atom_overlap (Bmolgroup *molgroup, Bmd *md)
| Calculates an energy term based on atom overlap. More...
int | molgroup_rigid_body_transform (Bmolgroup *molgroup, double max_angle, double shift_std)
| Randomly transforms a molecule or molecule group. More...
int | molgroup_move_atoms_down_energy (Bmolgroup *molgroup, double max_angle, double max_shift)
| Move atoms random distances down the energy gradient. More...

## Detailed Description

Headers of functions using a monte carlo metroplis algorithm to energy minimize molecular positions.

Author
  Bernard Heymann

Date
  Created: 20041230
  Modified: 20071223

Definition in file mol_monte.h.

## Function Documentation

## ◆ mcm_molecule_groups()

int mcm_molecule_groups | ( | Bmolgroup * | molgroup,
|  | Bmodel * | model,
|  | Bmd * | md,
|  | Bimage * | map,
|  | double | beta,
|  | double | max_angle,
|  | double | max_shift,
|  | long | max_iter,
|  | int | rigid
| ) |  |

Monte Carlo fit of a set of molecule groups.

Parameters

  *molgroup | molecule group.
  *model | model parameters (modified).
  *md | molecular dynamics structure.
  *map | map.
  beta | equivalent of 1/kT.
  max_angle | maximum allowed angular step size.
  max_shift | maximum allowed shift.
  max_iter | maximum number of iterations.
  rigid | selection of mode.

Returns
  Bmolgroup* new molecule group list.

      For each model, the molecule group is first transformed to the model
      location and orientation. The whole ensemble is then refined with the
      Monte Carlo Metropolis algorithm and the model parameters updated.

Definition at line 543 of file mol_monte.cpp.

## ◆ mcm_molecule_list() [1/2]

Bmolgroup* mcm_molecule_list | ( | Bmolgroup * | molgroup,
|  | Bmd * | md,
|  | Bimage * | map,
|  | double | beta,
|  | double | max_angle,
|  | double | max_shift,
|  | long | max_iter,
|  | int | rigid
| ) |  |

## ◆ mcm_molecule_list() [2/2]

int mcm_molecule_list | ( | Bmolgroup * | molgroup,
|  | Bmodel * | model,
|  | Bmd * | md,
|  | Bimage * | map,
|  | double | beta,
|  | double | max_angle,
|  | double | max_shift,
|  | long | max_iter,
|  | int | rigid
| ) |  |

Monte Carlo fit of a molecule to a list of locations and orientations.

Parameters

  *molgroup | molecule group.
  *model | model parameters (modified).
  *md | molecular dynamics structure.
  *map | map.
  beta | equivalent of 1/kT.
  max_angle | maximum allowed angular step size.
  max_shift | maximum allowed shift.
  max_iter | maximum number of iterations.
  rigid | selection of mode.

Returns
  Bmolgroup* new molecule group list.

      For each model, the molecule group is first transformed to the model
      location and orientation. This is then refined with the Monte Carlo
      Metropolis algorithm and the model parameters updated.

Definition at line 485 of file mol_monte.cpp.

## ◆ molgroup_atom_overlap()

double molgroup_atom_overlap | ( | Bmolgroup * | molgroup,
|  | Bmd * | md
| ) |  |

Calculates an energy term based on atom overlap.

Parameters

  *molgroup | molecular structure.
  *md | molecular dynamics structure.

Returns
  double total overlap energy.

      The energy is defined as linear decay to the reference separation distance
      and zero beyond:
          Esep = Ksep * (1 - d/dsep)  for  d < dsep, zero otherwise

Definition at line 759 of file mol_monte.cpp.

## ◆ molgroup_generate_masked_grid_list() [1/2]

Bmolgroup* molgroup_generate_masked_grid_list | ( | Bmolgroup * | molgroup,
|  | Bimage * | pmask,
|  | Vector3< double > | grid_sampling,
|  | Bstring | filename
| ) |  |

Generates multiple versions of a molecule at different locations.

Parameters

  *molgroup | molecule group.
  *pmask | mask to get limit grid positions.
  grid_sampling | sampling for grid search.
  filename | output base file name.

Returns
  Bmolgroup* linked list of molecule groups.

      The locations of the molecules are defined on the intersection of a
      grid and a user-defined mask.
      The numbered output filename is also set.
      Note: the molecule group minima and maxima should be set to the
      volume to be searched before calling this function.

Definition at line 260 of file mol_monte.cpp.

## ◆ molgroup_generate_masked_grid_list() [2/2]

Bmodel* molgroup_generate_masked_grid_list | ( | Bmolgroup * | molgroup,
|  | Vector3< double > | grid_sampling,
|  | Bimage * | pmask
| ) |  |

Definition at line 319 of file mol_monte.cpp.

## ◆ molgroup_generate_orientation_list() [1/2]

Bmolgroup* molgroup_generate_orientation_list | ( | Bmolgroup * | molgroup,
|  | double | angle_step,
|  | Bstring | filename,
|  | int | whole
| ) |  |

Generates multiple versions of a molecule at different locations.

Parameters

  *molgroup | molecule group.
  angle_step | angular step size in radians.
  filename | output base file name.
  whole | treat the whole ensemble as a rigid body.

Returns
  Bmolgroup* linked list of molecule groups.

      The molecule group is rotated in place to give all orientations
      with a given angle step size between the views.
      The numbered output filename is also set.

Definition at line 386 of file mol_monte.cpp.

## ◆ molgroup_generate_orientation_list() [2/2]

Bmodel* molgroup_generate_orientation_list | ( | Bmolgroup * | molgroup,
|  | double | angle_step
| ) |  |

Definition at line 435 of file mol_monte.cpp.

## ◆ molgroup_move_atoms_down_energy()

int molgroup_move_atoms_down_energy | ( | Bmolgroup * | molgroup,
|  | double | max_angle,
|  | double | max_shift
| ) |  |

Move atoms random distances down the energy gradient.

Parameters

  *molgroup | molecular structure.
  max_angle | (not used).
  max_shift | maximum shift for each atom.

Returns
  double 0.

      The distance of movement is limited to the maximum shift.

Definition at line 891 of file mol_monte.cpp.

## ◆ molgroup_rigid_body_transform()

int molgroup_rigid_body_transform | ( | Bmolgroup * | molgroup,
|  | double | max_angle,
|  | double | shift_std
| ) |  |

Randomly transforms a molecule or molecule group.

Parameters

  *molgroup | molecular structure.
  max_angle | maximum rotation angle.
  shift_std | gaussian length for shift vector.

Returns
  int 0.

      The transformation is calculted as a random angular rotation and a
      random shift. The shift is sampled from a random vector with a
      gaussian length distribution.

Definition at line 847 of file mol_monte.cpp.

## ◆ molgroup_set_box_to_map_boundaries()

int molgroup_set_box_to_map_boundaries | ( | Bmolgroup * | molgroup,
|  | Bimage * | map
| ) |  |

Sets the box in a molgroup to that defined by the map boundaries.

Parameters

  *molgroup | molecule group.
  *map | map to get boundaries from.

Returns
  int 0.

Definition at line 604 of file mol_monte.cpp.

## ◆ molgroup_test_if_within_box()

long molgroup_test_if_within_box | ( | Bmolgroup * | molgroup,
|  | Vector3< double > | min,
|  | Vector3< double > | max
| ) |  |

Tests if a molecule overlaps with a defined box.

Parameters

  *molgroup | molecule group.
  min | start of box.
  max | end of box.

Returns
  long 0.

Definition at line 626 of file mol_monte.cpp.

## ◆ monte_atom_fit_energy()

double monte_atom_fit_energy | ( | Bmolgroup * | molgroup,
|  | Bimage * | map,
|  | Bmd * | md
| ) |  |

Calculates the potential energy for fitting atoms to a map.

Parameters

  *molgroup | molecular structure.
  *map | density map.
  *md | molecular dynamics structure.

Returns
  double potential energy.

      The energy is the sum of the bond, angle, and map energies.

Definition at line 693 of file mol_monte.cpp.

## ◆ monte_bond_fit_energy()

double monte_bond_fit_energy | ( | Bmolgroup * | molgroup,
|  | Bimage * | map,
|  | Bmd * | md
| ) |  |

Calculates the potential energy for fitting bonds to a map.

Parameters

  *molgroup | molecular structure.
  *map | density map.
  *md | molecular dynamics structure.

Returns
  double potential energy.

      The energy is the sum of the bond, angle, and map energies.

Definition at line 725 of file mol_monte.cpp.

## ◆ monte_carlo_metropolis()

Bmolgroup* monte_carlo_metropolis | ( | Bmolgroup * | molgroup,
|  | Bmd * | md,
|  | Bimage * | map,
|  | double | beta,
|  | double | max_angle,
|  | double | max_shift,
|  | long | max_iter,
|  | int | rigid,
|  | double(Efunc)(Bmolgroup *, Bimage *, Bmd *) | ,
|  | int(Tfunc)(Bmolgroup *, double, double) |
| ) |  |

Definition at line 71 of file mol_monte.cpp.

## ◆ monte_rigid_body_fit_energy()

double monte_rigid_body_fit_energy | ( | Bmolgroup * | molgroup,
|  | Bimage * | map,
|  | Bmd * | md
| ) |  |

Calculates the potential energy for rigid body fitting.

Parameters

  *molgroup | molecular structure.
  *map | density map.
  *md | molecular dynamics structure.

Returns
  double potential energy.

      The energy is the sum of the overlap, map, and point force energies.

Definition at line 661 of file mol_monte.cpp.