 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
25 "Usage: bmonte [options] input.pdb output.pdb",
26 "--------------------------------------------",
27 "Minimizes the energy of a set of molecular structures using a Monte Carlo Metropolis algorithm.",
28 "The -grid and -orientation options only work with rigid bodies, not atoms,",
29 " and their output is to a model parameter file (.star).",
32 "-rigid mol Rigidity: all/whole = single rigid body (default),",
33 " group = each file with a molecule group is a rigid body,",
34 " molecule = each molecule is a rigid body,",
35 " atom = each atom can move.",
36 "-concurrent Run all models simultaneously (default each model separately),",
37 "-grid 3.5,5,4.2 Search on a grid with this sampling and within the bounding box (angstroms).",
38 "-orientations 12.5 Search all orientations with the given angular step size (degrees).",
41 "-verbose 7 Verbosity of output.",
42 "-sampling 1.5,1.5,1.5 Sampling (A/pixel; a single value can be given).",
43 "-bbox 0,82.5,50,50,80,50 Bounding box center and size (default from coordinates or map).",
44 "-wrap Wrap around (periodic boundaries).",
45 "-resolution 20 Resolution limit (angstrom).",
46 "-iterations 60 Maximum number of iterations (default 1).",
47 "-Kbond 150 Bond strength (default 0).",
48 "-Kangle 4 Angle strength (default 0).",
49 "-Kvdw 0.1 Van der Waals strength (default 0).",
50 "-Kelectrostatic 0.4 Electrostatic strength (default 0).",
51 "-Kseparation 0.02 Separation energy constant (default 0).",
52 "-Kmap 1.5 Map energy constant (default 1 if -Map option is used).",
53 "-separation 4.5 Separation distance for overlap calculation (default 4 A).",
54 "-cutoff 7.8 Distance cutoff for non-bonded forces (default 5 A).",
55 "-beta 12 Inverse of mean energy per atom and degree of freedom (default 10).",
56 "-angle 1.5 Maximum angular increment per iteration (default 1 degree).",
57 "-shift 3.1 Maximum shift per iteration (default 1 angstrom).",
58 "-bondsteps 5 Number of steps along a bond for map fitting (default none).",
59 "-location 12,5.3,6 Location of harmonic force to apply to center-of-mass.",
60 "-Klocation 16.8,0.2 Magnitude of harmonic force and decay constant.",
61 "-SS 2.05 Set disulphide reference bond length.",
64 "-parameters md.star Molecular dynamics parameter file.",
65 "-Model locations.star Model parameter file with initial rigid body locations.",
66 "-Map file.map Map to use as an additional restraint.",
67 "-Mask mask.mrc Mask to limit grid-searches (must be byte data type).",
72 int main(
int argc,
char **argv)
82 unsigned long max_iter(1);
92 double max_angle(
M_PI/180.0);
96 double pointdecay(0.1);
112 for ( curropt = option; curropt; curropt = curropt->
next ) {
113 if ( curropt->
tag ==
"rigid" ) {
114 if ( curropt->
value[0] ==
'g' ) rigid = 1;
115 if ( curropt->
value[0] ==
'm' ) rigid = 2;
116 if ( curropt->
value[0] ==
'a' ) rigid = 3;
118 if ( curropt->
tag ==
"concurrent" ) concurrent = 1;
119 if ( curropt->
tag ==
"grid" )
120 grid_sampling = curropt->
scale();
121 if ( curropt->
tag ==
"orientations" ) {
122 if ( ( angle_step = curropt->
value.
real() ) < 0.1 )
123 cerr <<
"-orientations: An angle step size must be specified!" << endl;
125 angle_step *=
M_PI/180.0;
127 if ( curropt->
tag ==
"sampling" )
128 sam = curropt->
scale();
129 if ( curropt->
tag ==
"bbox" )
130 if ( curropt->
box(bbox_center, bbox_size) < 6 )
131 cerr <<
"-bbox: All 6 values must be specified!" << endl;
132 if ( curropt->
tag ==
"wrap" )
134 if ( curropt->
tag ==
"resolution" )
135 if ( ( resolution = curropt->
value.
real() ) < 0.001 )
136 cerr <<
"-resolution: A resolution limit must be specified!" << endl;
137 if ( curropt->
tag ==
"iterations" )
139 cerr <<
"-iterations: A number must be specified!" << endl;
140 if ( curropt->
tag ==
"Kbond" )
141 if ( ( Kbond = curropt->
value.
real() ) < 1e-30 )
142 cerr <<
"-Kbond: The bond strength must be specified!" << endl;
143 if ( curropt->
tag ==
"Kangle" )
144 if ( ( Kangle = curropt->
value.
real() ) < 1e-30 )
145 cerr <<
"-Kangle: The angle strength must be specified!" << endl;
146 if ( curropt->
tag ==
"Kelectrostatic" )
147 if ( ( Kelec = curropt->
value.
real() ) < 1e-30 )
148 cerr <<
"-Kelectrostatic: The electrostatic strength must be specified!" << endl;
149 if ( curropt->
tag ==
"Kvdw" )
150 if ( ( Kvdw = curropt->
value.
real() ) < 1e-30 )
151 cerr <<
"-Kvdw: The Van der Waals strength must be specified!" << endl;
152 if ( curropt->
tag ==
"Kseparation" )
153 if ( ( Ksep = curropt->
value.
real() ) < 1e-30 )
154 cerr <<
"-Kseparation: The separation energy constant strength must be specified!" << endl;
155 if ( curropt->
tag ==
"Kmap" )
156 if ( ( Kmap = curropt->
value.
real() ) < 1e-30 )
157 cerr <<
"-Kmap: The map energy constant strength must be specified!" << endl;
158 if ( curropt->
tag ==
"separation" )
159 if ( ( separation = curropt->
value.
real() ) < 1e-30 )
160 cerr <<
"-separation: The separation distance must be specified!" << endl;
161 if ( curropt->
tag ==
"cutoff" )
162 if ( ( cutoff = curropt->
value.
real() ) < 1e-30 )
163 cerr <<
"-cutoff: The cutoff distance must be specified!" << endl;
164 if ( curropt->
tag ==
"beta" )
166 cerr <<
"-beta: A value must be specified!" << endl;
167 if ( curropt->
tag ==
"angle" ) {
168 if ( ( max_angle = curropt->
value.
real() ) < 1e-30 )
169 cerr <<
"-angle: An angle must be specified!" << endl;
173 if ( curropt->
tag ==
"shift" )
174 if ( ( max_shift = curropt->
value.
real() ) < 1e-30 )
175 cerr <<
"-shift: A distance must be specified!" << endl;
176 if ( curropt->
tag ==
"bondsteps" )
178 cerr <<
"-bondsteps: The bond step length must be specified!" << endl;
179 if ( curropt->
tag ==
"location" )
181 if ( curropt->
tag ==
"Klocation" )
182 if ( curropt->
values(Kpoint, pointdecay) < 1 )
183 cerr <<
"-Klocation: The location force constant must be specified!" << endl;
184 if ( curropt->
tag ==
"SS" )
185 if ( ( ss = curropt->
value.
real() ) < 1e-30 )
186 cerr <<
"-SS: A bond length must be specified!" << endl;
187 if ( curropt->
tag ==
"parameters" )
189 if ( curropt->
tag ==
"Model" )
191 if ( curropt->
tag ==
"Map" )
193 if ( curropt->
tag ==
"Mask" )
201 if ( paramfile.
length() ) {
212 md->
point = location;
220 Bstring filename(argv[optind++]);
223 cerr <<
"Error: No molecules read!" << endl;
238 strcpy(bt->
type1,
"S");
239 strcpy(bt->
type2,
"S");
253 filename = argv[optind];
260 if ( natom_in < 2 ) {
265 if ( Kmap ) md->
Kmap = Kmap;
268 if ( maskfile.
length() ) {
273 if ( bbox_size[0] > 0 && bbox_size[1] > 0 && bbox_size[2] > 0 ) {
274 molgroup->
min = bbox_center - (bbox_size * 0.5);
275 molgroup->
max = bbox_center + (bbox_size * 0.5);
276 molgroup->
box = bbox_size;
279 if ( modelfile.
length() ) {
281 }
else if ( grid_sampling[0] > 0 ) {
283 }
else if ( angle_step > 0 ) {
299 if ( bond_steps > 0 )
A class for a command line input option.
int main(int argc, char **argv)
Vector3< double > scale()
int molecule_update_comment(Bmolgroup *molgroup, int n, char **strings)
Puts a set of strings and time in the main comment of a molecule group.
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))
int molgroup_set_box_to_map_boundaries(Bmolgroup *molgroup, Bimage *map)
Sets the box in a molgroup to that defined by the map boundaries.
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.
int molgroup_rigid_body_transform(Bmolgroup *molgroup, double max_angle, double shift_std)
Randomly transforms a molecule or molecule group.
double monte_bond_fit_energy(Bmolgroup *molgroup, Bimage *map, Bmd *md)
Calculates the potential energy for fitting bonds to a map.
int molgroup_list_kill(Bmolgroup *molgroup)
Destroys a molecule group linked list.
double monte_rigid_body_fit_energy(Bmolgroup *molgroup, Bimage *map, Bmd *md)
Calculates the potential energy for rigid body fitting.
int md_kill(Bmd *md)
Deallocates a molecular dynamics structure.
double md_bond_list_set_parameters(Bbond *bondlist, Bbondtype *bondtype)
Assigns covalent bond lengths to bonds.
int bexit(int value)
Exit function for cleanup and debugging.
Header to read and write molecular dynamics parameters in STAR format.
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Bmolgroup * read_molecule(const char *filename, const char *select, const char *paramfile)
The generalized function for reading molecular files.
Header file for option handlers.
double angle_set_negPI_to_PI(double angle)
Returns an angle between -PI and PI.
long molgroup_test_if_within_box(Bmolgroup *molgroup, Vector3< double > min, Vector3< double > max)
Tests if a molecule overlaps with a defined box.
double monte_atom_fit_energy(Bmolgroup *molgroup, Bimage *map, Bmd *md)
Calculates the potential energy for fitting atoms to a map.
long values(T1 &v1, T2 &v2)
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
Bmolgroup * mcm_molecule_list(Bmolgroup *molgroup, Bmd *md, Bimage *map, double beta, double max_angle, double max_shift, long max_iter, int rigid)
Bmolgroup * molgroup_generate_orientation_list(Bmolgroup *molgroup, double angle_step, Bstring filename, int whole)
Generates multiple versions of a molecule at different locations.
Header for molecular dynamics.
Header file for reading reflection files.
Bmd * md_init()
Initializes a molecular dynamics structure.
int model_kill(Bmodel *model)
Deallocates all memory in the list.
General image parameter class.
Utilities for timing functions.
long box(Vector3< T1 > &st, Vector3< T2 > &sz)
double timer_start()
Starts timer and prints the time.
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.
Header file for general utilities.
int write_model(Bstring &filename, Bmodel *model)
Writes model parameters.
Bangle * md_generate_angle_list(Bmolgroup *molgroup, Bmd *md)
Generates an angle list.
Vector3< double > vector3()
double timer_report(double lasttime)
Reports the time elapsed since a given time.
long random_seed()
Gets a random seed and sets the flag.
int write_molecule(char *filename, Bmolgroup *molgroup)
Writes a molecule group.
Headers of functions using a monte carlo metroplis algorithm to energy minimize molecular positions.
Header file for 2D and 3D image I/O.
Bbond * md_generate_bond_list(Bmolgroup *molgroup, Bmd *md)
Generates a distance-based bond list.
double beta(double volt)
Calculates the relative electron velocity.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
int md_angle_list_set_parameters(Bangle *anglelist, Bangletype *angletype)
Assigns angles from angle types.
Bmodel * read_model(Bstring &filename)
void sampling(long nn, Vector3< double > u)
int molgroup_move_atoms_down_energy(Bmolgroup *molgroup, double max_angle, double max_shift)
Move atoms random distances down the energy gradient.
Bmd * read_md_parameters(Bstring &filename)
Reading molecular dynamics parameters from STAR files.