Bsoft 2.1.4
Bernard's software package
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"

Functions

Bmolgroupmonte_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))
 
Bmolgroupmolgroup_generate_masked_grid_list (Bmolgroup *molgroup, Bimage *pmask, Vector3< double > grid_sampling, Bstring filename)
 Generates multiple versions of a molecule at different locations.
More...
 
Bmodelmolgroup_generate_masked_grid_list (Bmolgroup *molgroup, Vector3< double > grid_sampling, Bimage *pmask)
 
Bmolgroupmolgroup_generate_orientation_list (Bmolgroup *molgroup, double angle_step, Bstring filename, int whole)
 Generates multiple versions of a molecule at different locations.
More...
 
Bmodelmolgroup_generate_orientation_list (Bmolgroup *molgroup, double angle_step)
 
Bmolgroupmcm_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

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
*molgroupmolecule group.
*modelmodel parameters (modified).
*mdmolecular dynamics structure.
*mapmap.
betaequivalent of 1/kT.
max_anglemaximum allowed angular step size.
max_shiftmaximum allowed shift.
max_itermaximum number of iterations.
rigidselection 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.

◆ 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
*molgroupmolecule group.
*modelmodel parameters (modified).
*mdmolecular dynamics structure.
*mapmap.
betaequivalent of 1/kT.
max_anglemaximum allowed angular step size.
max_shiftmaximum allowed shift.
max_itermaximum number of iterations.
rigidselection 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.

◆ molgroup_atom_overlap()

double molgroup_atom_overlap ( Bmolgroup molgroup,
Bmd md 
)

Calculates an energy term based on atom overlap.

Parameters
*molgroupmolecular structure.
*mdmolecular 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

◆ 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
*molgroupmolecule group.
*pmaskmask to get limit grid positions.
grid_samplingsampling for grid search.
filenameoutput 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.

◆ molgroup_generate_masked_grid_list() [2/2]

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

◆ molgroup_generate_orientation_list() [1/2]

Bmodel * molgroup_generate_orientation_list ( Bmolgroup molgroup,
double  angle_step 
)

◆ molgroup_generate_orientation_list() [2/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
*molgroupmolecule group.
angle_stepangular step size in radians.
filenameoutput base file name.
wholetreat 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.

◆ 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
*molgroupmolecular structure.
max_angle(not used).
max_shiftmaximum shift for each atom.
Returns
double 0.
The distance of movement is limited to the maximum shift.

◆ 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
*molgroupmolecular structure.
max_anglemaximum rotation angle.
shift_stdgaussian 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.

◆ 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
*molgroupmolecule group.
*mapmap to get boundaries from.
Returns
int 0.

◆ 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
*molgroupmolecule group.
minstart of box.
maxend of box.
Returns
long 0.

◆ 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
*molgroupmolecular structure.
*mapdensity map.
*mdmolecular dynamics structure.
Returns
double potential energy.
The energy is the sum of the bond, angle, and map energies.

◆ 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
*molgroupmolecular structure.
*mapdensity map.
*mdmolecular dynamics structure.
Returns
double potential energy.
The energy is the sum of the bond, angle, and map energies.

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

◆ 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
*molgroupmolecular structure.
*mapdensity map.
*mdmolecular dynamics structure.
Returns
double potential energy.
The energy is the sum of the overlap, map, and point force energies.