 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
26 "Usage: bmoledit [options] in.pdb out.pdb",
27 "----------------------------------------",
28 "Manipulates atomic coordinate files.",
31 "-rename D Rename molecules from the given letter.",
32 "-renumber 52 Renumber residues from the given number.",
33 "-select CA Atom selection (default all).",
34 "-elements Use elements as identifiers for atom types.",
35 "-split Split molecule groups, output multiple numbered files.",
36 "-slices 23.7 Split coordinates into slices of this thickness, output multiple numbered files.",
37 "-translate 0,-50,22 Translate (angstrom).",
38 "-trim 200,230,180 Trim to new box size (use with -translate).",
39 "-noH Remove all hydrogens.",
40 "-SS 2.2 Add disulfide bonds within the given separation.",
41 "-nobonds Remove all bond specifications.",
42 "-bonds 2.1 Add bonds between atoms closer than the given distance.",
43 "-pseudobonds 3 Add pseudo-atoms on bonds given the number per bond.",
44 "-random 1.2 Add a random displacement to each coordinate within a maximum (angstrom).",
45 "-B 23.4 Add a random displacement to each coordinate based on a B-factor (angstrom^2).",
46 "-prune Remove overlapping molecules.",
47 "-untangle 3.5,0.2 Eliminate overlaps by moving molecules apart (sampling and damping factor).",
50 "-verbose 7 Verbosity of output.",
51 "-distance 3.5 Distance between overlapping atoms allowed (default 3 angstrom, use with -insert).",
54 "-parameters parm.star Atomic properties parameter file (default atom_prop.star).",
55 "-insert in.pdb Insert this into the input file, deleting overlapping atoms in the input file.",
56 " (use with -distance to indicate cutoff to eliminate atoms).",
61 int main(
int argc,
char **argv)
68 double slice_thickness(0);
91 for ( curropt = option; curropt; curropt = curropt->
next ) {
92 if ( curropt->
tag ==
"select" ) {
93 atom_select = curropt->
value;
94 if ( atom_select.
length() < 1 )
95 cerr <<
"-select: A selection must be specified!" << endl;
97 if ( curropt->
tag ==
"elements" ) elements = 1;
98 if ( curropt->
tag ==
"split" )
split = 1;
99 if ( curropt->
tag ==
"rename" )
100 if ( ( first_name = curropt->
value[0] ) < 1 )
101 cerr <<
"-rename: The first molecule name must be specified!" << endl;
102 if ( curropt->
tag ==
"renumber" )
104 cerr <<
"-renumber: The first residue number must be specified!" << endl;
105 if ( curropt->
tag ==
"slices" ) {
106 if ( ( slice_thickness = curropt->
value.
real() ) < 1 )
107 cerr <<
"-slices: A slice thickness must be specified!" << endl;
109 if ( slice_thickness <= 0 ) slice_thickness = 0;
111 if ( curropt->
tag ==
"translate" )
113 if ( curropt->
tag ==
"trim" )
114 trim = curropt->
size();
115 if ( curropt->
tag ==
"noH" )
117 if ( curropt->
tag ==
"SS" )
118 if ( ( SSdistance = curropt->
value.
real() ) < 0.1 )
119 cerr <<
"-SS: A maximum separation distance must be specified!" << endl;
120 if ( curropt->
tag ==
"nobonds" )
122 if ( curropt->
tag ==
"bonds" )
123 if ( ( addBonds = curropt->
value.
real() ) < 0.1 )
124 cerr <<
"-bonds: A maximum bond length must be specified!" << endl;
125 if ( curropt->
tag ==
"pseudobonds" )
127 cerr <<
"-pseudobonds: A number of pseudo-atoms must be specified!" << endl;
128 if ( curropt->
tag ==
"insert" )
130 if ( curropt->
tag ==
"random" )
131 if ( ( random_max = curropt->
value.
real() ) < 0.1 )
132 cerr <<
"-random: A random displacement maximum must be specified!" << endl;
133 if ( curropt->
tag ==
"B" )
134 if ( ( B = curropt->
value.
real() ) < 0.1 )
135 cerr <<
"-B: A B-factor must be specified!" << endl;
136 if ( curropt->
tag ==
"prune" ) prune = 1;
137 if ( curropt->
tag ==
"untangle" )
138 if ( curropt->
values(untangle, lambda) < 1 )
139 cerr <<
"-untangle: Grid sampling in angstrom must be specified!" << endl;
140 if ( curropt->
tag ==
"distance" )
142 cerr <<
"-distance: A separation distance must be specified!" << endl;
143 if ( curropt->
tag ==
"wrap" ) {
144 box = curropt->
size();
147 if ( curropt->
tag ==
"parameters" )
152 if ( optind >= argc )
bexit(-1);
156 Bstring filename = argv[optind++];
159 cerr <<
"Error: Coordinate file not read!" << endl;
175 else if ( set_wrap ) molgroup->
box = box;
185 molgroup->
bond = NULL;
215 if ( optind < argc ) {
216 filename = argv[optind];
221 }
else if ( slice_thickness > 0 ) {
223 for ( i=0; i<num; i++ ) {
228 delete[] molgroup_set;
232 cerr <<
"Error: No output file written!" << endl;
254 if ( box.
volume() < 1 )
return 0;
263 cout <<
"Trimming to a box of size: " << box << endl;
265 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
266 for( res = mol->
res; res; res = res->
next ) {
267 for ( atom = res->
atom; atom; atom = atom->
next, n++ ) {
280 if ( n != nsel + ndel )
281 cerr <<
"Error: There is a discrepancy between the the total number of atoms ("
282 << n <<
") and the sum of selected (" << nsel
283 <<
") and deleted (" << ndel <<
") atoms!" << endl;
288 cout <<
"Number of atoms remaining: " << nsel << endl;
A class for a command line input option.
bool within(Vector3 &v1, Vector3 &v2)
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.
int molgroup_add_disulfides(Bmolgroup *molgroup, double distance)
Adds disulfide bonds when sulfur atoms are close to each other.
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.
int molgroup_randomize_B(Bmolgroup *molgroup, double B)
Applies random displacements to coordinates.
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.
Bmolgroup ** molgroup_split_into_slices(Bmolgroup *molgroup, double slice_thickness, int &nslices)
Splits a set of coordinates into slices with a given thickness.
long molgroup_trim(Bmolgroup *molgroup, Vector3< double > box)
Deletes atoms outside the box.
int molgroup_bond_pseudo_atoms(Bmolgroup *molgroup, int atoms_per_bond, int wrap)
Places pseudo-atoms on bonds.
long values(T1 &v1, T2 &v2)
string insert(string &filename, string ins)
Header file for reading reflection files.
int molgroup_remove_hydrogens(Bmolgroup *molgroup)
Removes all hydrogens from a molecular system.
Utilities for timing functions.
long molgroup_set_atom_types_to_elements(Bmolgroup *molgroup)
Sets atom types to element names.
double distance(vector< T1 > &v1, vector< T2 > &v2)
int molgroup_residue_renumber(Bmolgroup *molgroup, int first)
Renumbers residues.
int molecules_to_molgroups(Bmolgroup *molgroup)
Converts molecules in a molecule group to individual molecule groups.
int molgroup_list_write(Bstring &filename, Bmolgroup *molgroup)
Writes a molecule group list.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
vector< string > split(const string &s)
Splits a string on whitespace.
int molgroup_prune_molecules(Bmolgroup *molgroup)
Deletes overlapping molecules.
Vector3< double > vector3()
int molgroup_untangle_molecules(Bmolgroup *molgroup, double sampling, double lambda)
Moves overlapping molecules away from each other.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
int write_molecule(char *filename, Bmolgroup *molgroup)
Writes a molecule group.
int molgroup_insert(Bmolgroup *molgroup, Bmolgroup *molinsert, double distance)
Inserts one set of molecules into another.
int main(int argc, char **argv)
int molgroup_rename(Bmolgroup *molgroup, char first_name)
Renames molecules.
Library routines used for symmetry operations on atomic coordinates.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Bbond * molgroup_bond_list_generate(Bmolgroup *molgroup, double maxlength, int wrap)
Generates a bond list based on atom separation.
int molgroup_randomize(Bmolgroup *molgroup, double random_max)
Applies random displacements to coordinates.
long molgroup_delete_deselected_atoms(Bmolgroup *molgroup)
Deletes deselected atoms.
int bond_kill(Bbond *bond)
Dealocates a list of bonds.
Library routines used for atomic coordinates.