 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
20 "Usage: bsplitmol [options] input.pdb output.pdb",
21 "-----------------------------------------------",
22 "Splits sets of coordinates to different numbered files.",
25 "-verbose 7 Verbosity of output.",
26 "-first 5 Number given to the first file (default 0).",
27 "-digits 3 Number of digits inserted before the last period in the output file name.",
30 "-parameters parm.star Atomic properties parameter file (default atom_prop.star).",
35 int main(
int argc,
char **argv)
46 for ( curropt = option; curropt; curropt = curropt->
next ) {
47 if ( curropt->
tag ==
"first" )
49 cerr <<
"-first: A number must be specified!" << endl;
50 if ( curropt->
tag ==
"digits" )
52 cerr <<
"-digits: A number of digits must be specified!" << endl;
53 if ( curropt->
tag ==
"parameters" )
60 Bstring inputfile = argv[optind++];
62 if ( molgroup == NULL ) {
63 cerr <<
"Error: No input file read!" << endl;
67 if ( optind >= argc )
bexit(0);
71 for ( mol=molgroup->
mol; mol; mol=mol->
next ) nmol++;
74 cout <<
"Splitting " << inputfile <<
" up into " << nmol <<
" files" << endl << endl;
76 Bstring outputfile = argv[optind];
80 if ( digits < 0.44*log(1.0*nmol) + 1 ) digits = (int) (0.44*log(1.0*nmol) + 1);
81 snprintf(format, 32,
"_%%0%dd.", digits);
85 for ( i=0, mol=molgroup->
mol; mol; mol=mol2, i++ ) {
88 molgroup_out->
mol = mol;
92 molgroup_out->
mol = NULL;
A class for a command line input option.
Bmolgroup * molgroup_init()
Initializes and allocates a new molecule group.
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 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.
Bmolgroup * read_molecule(const char *filename, const char *select, const char *paramfile)
The generalized function for reading molecular files.
Header file for option handlers.
Header file for reading reflection files.
Utilities for timing functions.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
int molecule_kill(Bmolecule *mol)
Destroys a molecule.
int main(int argc, char **argv)
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 option_kill(Boption *option)
Deallocates a linked list of option structures.