 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
26 "Usage: bmol [options] in.pdb out.pdb",
27 "------------------------------------",
28 "Edits, analyzes and transforms atomic coordinate files.",
31 "-select CA Atom selection (default all).",
32 "-chains B,G,O,Z Select chains or molecules by ID (default all).",
33 "-limits -50.5,10,0,40,-100,-20 Coordinate limits (default -10000,-10000,-10000,10000,10000,10000).",
36 "-invert 10,-5.3,2.6 Invert through a point.",
37 "-translate 0,-50,22 Translate (angstrom).",
38 "-scale 2,1.5,2.2 Scale the coordinates.",
39 "-rotate 0.5,0,5.8,45 Rotate around a vector (x,y,z) by an angle.",
40 "-toview 0.3,0.5,0.8,33 Rotate to view: vector {xyz} and angle (default 0,0,1,0).",
41 "-fromview 0.3,0.5,0.8,33 Rotate from view: vector {xyz} and angle (default 0,0,1,0).",
42 "-radius 41.8 Force all coordinates to this radius (default not).",
43 "-rename D Rename molecules from the given letter.",
44 "-renumber 52 Renumber residues from the given number.",
45 "-occupancy 27,99,3 Set an occupancy range (res1,res2) to a value.",
46 "-box 15,66,54 Consolidate structure within box (0,0,0 means no change).",
47 "-wrap 15,66,54 Pack coordinates within periodic box.",
48 "-Bfactor Analyze B-factors.",
49 "-Sequence Output sequence as string of letters.",
50 "-Mass Calculate the total molecular weight and volume.",
51 "-Volume 1 Calculate the Van der Waals volume, wrapping flag (default 0).",
52 "-Composition Calculate the composition.",
53 "-Center Calculate the center of mass.",
54 "-Translate Translate the coordinate set to the center of mass.",
55 "-Place -43.2,33,0 Place the center-of-mass at the given coordinates.",
56 "-Axes Calculate the orthogonal axes.",
57 "-Sphericity 1.5 Calculate the sphericity with the given angular sampling.",
58 "-Radialdensity 0.05,6,1 Calculate the radial density function at a given sampling",
59 " and distance cutoff (angstrom) with optional wrapping.",
62 "-verbose 7 Verbosity of output.",
63 "-origin 10,-10,20 Origin for rotation (default 0,0,0, can be \"center\" for COM)",
66 "-parameters parm.star Atomic properties parameter file (default atom_prop.star).",
67 "-compare mol.pdb Reference to calculate RMSD.",
68 "-distance mol.pdb Reference to calculate distance matrix.",
71 "-matrix file.mat Distance matrix.",
72 "-image file.map Distance matrix as an image.",
77 int main(
int argc,
char **argv)
101 int set_occupancy(0);
107 int show_composition(0);
109 int translate_COM(0);
113 double rdf_sampling(0);
114 double rdf_cutoff(5);
125 for ( curropt = option; curropt; curropt = curropt->
next ) {
126 if ( curropt->
tag ==
"select" ) {
127 atom_select = curropt->
value;
128 if ( atom_select.
length() < 1 )
129 cerr <<
"-select: A selection must be specified!" << endl;
131 if ( curropt->
tag ==
"chains" ) {
132 chain_select = curropt->
value;
133 if ( chain_select.
length() < 1 )
134 cerr <<
"-chains: A selection must be specified!" << endl;
136 if ( curropt->
tag ==
"invert" ) {
140 if ( curropt->
tag ==
"translate" )
142 if ( curropt->
tag ==
"scale" )
144 if ( curropt->
tag ==
"rotate" ) {
147 cerr <<
"-rotate: All three vector elements and an angle must be specified!" << endl;
153 if ( curropt->
tag ==
"toview" )
154 view = curropt->
view();
155 if ( curropt->
tag ==
"fromview" ) {
156 view = curropt->
view();
159 if ( curropt->
tag ==
"origin" ) {
165 if ( curropt->
tag ==
"limits" ) {
166 if ( curropt->
box(min, max) < 6 )
167 cerr <<
"-limits: All 6 limits must be specified!" << endl;
171 if ( curropt->
tag ==
"radius" )
172 if ( ( set_radius = curropt->
value.
real() ) < 1 )
173 cerr <<
"-radius: The radius must be specified!" << endl;
174 if ( curropt->
tag ==
"rename" )
175 if ( ( first_name = curropt->
value[0] ) < 1 )
176 cerr <<
"-rename: The first molecule name must be specified!" << endl;
177 if ( curropt->
tag ==
"renumber" )
179 cerr <<
"-renumber: The first residue number must be specified!" << endl;
180 if ( curropt->
tag ==
"occupancy" ) {
181 if ( curropt->
values(range_first, range_last, occupancy) < 3 )
182 cerr <<
"-occupancy: A range and value must be specified!" << endl;
186 if ( curropt->
tag ==
"box" ) {
187 box = curropt->
size();
190 if ( curropt->
tag ==
"wrap" ) {
191 box = curropt->
size();
194 if ( curropt->
tag ==
"Bfactor" )
196 if ( curropt->
tag ==
"Sequence" )
198 if ( curropt->
tag ==
"Mass" )
200 if ( curropt->
tag ==
"Volume" ) {
202 cerr <<
"-Volume: A wrapping flag must be specified!" << endl;
206 if ( curropt->
tag ==
"Composition" )
207 show_composition = 1;
208 if ( curropt->
tag ==
"Center" )
210 if ( curropt->
tag ==
"Translate" )
212 if ( curropt->
tag ==
"Place" )
214 if ( curropt->
tag ==
"Axes" )
216 if ( curropt->
tag ==
"Sphericity" ) {
217 if ( ( dang = curropt->
value.
real() ) < 0.01 )
218 cerr <<
"-Sphericity: The angular step size must be specified!" << endl;
222 if ( curropt->
tag ==
"Radialdensity" )
223 if ( curropt->
values(rdf_sampling, rdf_cutoff, wrap) < 1 )
224 cerr <<
"-Radialdensity: The sampling must be specified!" << endl;
225 if ( curropt->
tag ==
"parameters" )
227 if ( curropt->
tag ==
"compare" )
229 if ( curropt->
tag ==
"distance" )
231 if ( curropt->
tag ==
"matrix" )
233 if ( curropt->
tag ==
"image" )
238 if ( optind >= argc )
bexit(-1);
242 Bstring filename(argv[optind++]);
246 cerr <<
"Error: Coordinate file not read!" << endl;
250 if ( chain_select.
length() )
254 if ( ( rmin > 0 ) || ( rmax < 1000 ) )
293 }
else if ( t.
angle == 0 ) {
302 if ( set_pbc || set_wrap ) molgroup->
box = box;
321 if ( show_composition )
333 range_last, occupancy);
335 if ( rdf_sampling > 0 )
339 if ( compfile.
length() ) {
342 cerr <<
"Error: Template file not read!" << endl;
349 if ( distfile.
length() ) {
352 cerr <<
"Error: Template file not read!" << endl;
368 if ( optind < argc ) {
371 cerr <<
"Error: " << argv[optind] <<
" not written!" << endl;
A class for a command line input option.
long molgroup_stats(Bmolgroup *molgroup, int show)
Calculates the statistics of a molecule group.
double molgroup_volume(Bmolgroup *molgroup, Bstring ¶mfile, int wrap)
Calculates the volume of a molecular system.
int molgroup_print_sequence(Bmolgroup *molgroup)
Prints the sequence of a molecule as a single letter code string.
int molgroup_kill(Bmolgroup *molgroup)
Destroys a molecule group.
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.
Vector3< double > molgroup_principal_axes(Bmolgroup *molgroup, Vector3< double > *eigenvec)
Calculates the principal axes of a molecule group.
Library routines to select atomic coordinates.
int bexit(int value)
Exit function for cleanup and debugging.
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Library routines used for atomic coordinates.
Bmolgroup * read_molecule(const char *filename, const char *select, const char *paramfile)
The generalized function for reading molecular files.
Header file for option handlers.
int molgroup_coor_select_ring(Bmolgroup *molgroup, double rmin, double rmax)
Selects atoms in a ring.
int molgroup_set_radius(Bmolgroup *molgroup, double radius)
Shifts all coordinates to a given radius.
Vector3< double > origin()
int molgroup_composition(Bmolgroup *molgroup, Bstring ¶mfile)
Calculates the elemental composition of a molecular system.
long values(T1 &v1, T2 &v2)
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
int molgroup_Bfactors(Bmolgroup *molgroup)
Calculates the average Bfactors for residues in molecules.
Header file for reading reflection files.
double molgroup_calculate_weight(Bmolgroup *molgroup)
Calculates the weight of each molecule.
General image parameter class.
Utilities for timing functions.
long box(Vector3< T1 > &st, Vector3< T2 > &sz)
vector< double > split_into_doubles(const Bstring &delim)
int main(int argc, char **argv)
Library routines used to compare sets of atomic coordinates.
int molgroup_residue_renumber(Bmolgroup *molgroup, int first)
Renumbers residues.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
Vector3< double > vector3()
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Vector3< double > molgroup_show_center_of_mass(Bmolgroup *molgroup)
Calculates the center of mass of a molecule group.
int molgroup_coor_select(Bmolgroup *molgroup, Vector3< double > min, Vector3< double > max)
Selects atoms within a box.
Vector3< double > molgroup_center_of_mass(Bmolgroup *molgroup)
Calculates the center of mass of a molecule group.
int write_molecule(char *filename, Bmolgroup *molgroup)
Writes a molecule group.
Header file for 2D and 3D image I/O.
int molgroup_select_chains(Bmolgroup *molgroup, Bstring chains)
Selects molecules.
Matrix mol_distance_matrix(Bmolecule *m1, Bmolecule *m2)
Calculates the distance matrix between the residues in two molecules.
double molgroup_sphericity(Bmolgroup *molgroup, double da)
Calculates how close the coordinate set is to a spherical shape.
int molgroup_rename(Bmolgroup *molgroup, char first_name)
Renames molecules.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
void write(Bstring &filename)
double molgroup_calculate_rmsd(Bmolgroup *molgroup, Bmolgroup *molgroup2)
Calculates the root-mean-square-deviation between two molecule groups.
bool contains(const Bstring &s)
int molgroup_radial_density(Bmolgroup *molgroup, double interval, double cutoff, int wrap)
Calculates a radial distribution function.
int molgroup_coor_reset_occupancy(Bmolgroup *molgroup, int range_first, int range_last, double occupancy)
Sets occupancies to new values..
Library routines used for atomic coordinates.