 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
26 "Usage: bmodsym [options] in1.star [in2.star...]",
27 "-----------------------------------------------",
28 "Manipulates models.",
30 "Actions for preparation:",
31 "-merge Merge models in different files rather than concatenate.",
32 "-all Reset selection to all models and components before other selections.",
35 "-select #232@14 Select models and components.",
38 "-center Center before all other operations.",
39 "-map image.pif,2 Map and image number associated with model.",
40 "-setasu D8 Set components to within an asymmetric unit.",
41 "-apply T Apply point group symmetry.",
42 "-symmetrize C5 Symmetrize for a point group symmetry.",
43 "-separate D7 Generate separate symmetry-related models.",
44 "-find 3,12 Find component cyclic symmetry in the given order range.",
46 "Actions for finishing:",
47 "-reset Reset selection to all components before other selections.",
50 "-verbose 7 Verbose output.",
51 "-componentradius 8.4 Set display radius for all components.",
52 "-linkradius 5.1 Set display radius for all links.",
53 "-origin 0,22.5,30 Set the symmetry origin.",
55 "Parameters for finding symmetry:",
56 "-annuli 3,12 Annular range to find cyclic symmetry (pixels).",
57 " If not specified, taken from component radius.",
58 "-width 10 Annular width to find cyclic symmetry (pixels).",
61 "-parameters param.star Input parameter file.",
64 "-output file.star Output model parameter file.",
65 "-split 3 Split models into individual files:",
66 " Argument: 1-6: number of digits inserted before extension",
67 " Argument: \"id\": model ID's are used as file names.",
72 int main(
int argc,
char **argv)
82 long minorder(0), maxorder(0);
83 long ann_min(0), ann_max(0);
102 for ( curropt = option; curropt; curropt = curropt->
next ) {
103 if ( curropt->
tag ==
"all" ) all = 1;
104 if ( curropt->
tag ==
"reset" ) reset = 1;
105 if ( curropt->
tag ==
"select" )
106 mod_select = curropt->
value;
107 if ( curropt->
tag ==
"center" ) center = 1;
108 if ( curropt->
tag ==
"map" ) {
109 map_name = curropt->
value;
110 img_num = (map_name.
post(
',')).integer();
111 map_name = map_name.
pre(
',');
112 if ( map_name.
length() < 1 )
113 cerr <<
"-map: A file name must be specified!" << endl;
115 if ( curropt->
tag ==
"parameters" )
117 if ( curropt->
tag ==
"setasu" )
119 if ( curropt->
tag ==
"apply" )
121 if ( curropt->
tag ==
"symmetrize" )
123 if ( curropt->
tag ==
"separate" )
125 if ( curropt->
tag ==
"find" )
126 if ( curropt->
values(minorder, maxorder) < 2 )
127 cerr <<
"-find: Minimum and maximum orders must be specified!" << endl;
128 if ( curropt->
tag ==
"componentradius" )
129 if ( ( comprad = curropt->
value.
real() ) < 1 )
130 cerr <<
"-componentradius: A display radius must be specified!" << endl;
131 if ( curropt->
tag ==
"linkradius" )
132 if ( ( linkrad = curropt->
value.
real() ) < 1 )
133 cerr <<
"-linkradius: A radius must be specified!" << endl;
134 if ( curropt->
tag ==
"origin" )
135 origin = curropt->
origin();
136 if ( curropt->
tag ==
"annuli" )
137 if ( curropt->
values(ann_min, ann_max) < 1 )
138 cerr <<
"-annuli: An annular range must be specified!" << endl;
139 if ( curropt->
tag ==
"width" )
141 cerr <<
"-width: An annular width must be specified!" << endl;
142 if ( curropt->
tag ==
"reference" )
143 ref_view = curropt->
view();
144 if ( curropt->
tag ==
"output" )
146 if ( curropt->
tag ==
"split" ) {
149 cerr <<
"-split: An integer must be specified!" << endl;
160 while ( optind < argc )
string_add(&file_list, argv[optind++]);
162 cerr <<
"Error: No model files specified!" << endl;
170 cerr <<
"Error: Input file not read!" << endl;
178 if ( map_name.
length() ) {
191 if ( symmetry_apply_string.
length() )
194 if ( symmetrize_string.
length() )
197 if ( separate_symmetrize.
length() )
A class for a command line input option.
int string_kill(Bstring *list)
Kills a string linked list.
Header file for reading and writing atomic model files.
long model_set_link_radius(Bmodel *model, double linkrad)
Set the display radius for all links to a specific value.
int bexit(int value)
Exit function for cleanup and debugging.
Header file for model to map conversions.
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 model symmetry operations.
Header file for option handlers.
Vector3< double > origin()
int model_component_symmetry(Bmodel *model, long nangles, long ann_min, long ann_max, long ann_width, long zmin, long zmax, long zinc, long minorder, long maxorder)
Determines the cyclic symmetry of components.
Library routines used for model link processing.
long models_process(Bmodel *model, long(modfunc)(Bmodel *))
Process a list of models using the specified function.
long model_selection_stats(Bmodel *model)
Calculates selection statistics.
long values(T1 &v1, T2 &v2)
int model_kill(Bmodel *model)
Deallocates all memory in the list.
long model_symmetry_related(Bmodel *model, Bstring &symmetry_string)
Generates a list of symmetry-related models.
Header file for reading and writing atomic model files.
Utilities for timing functions.
int main(int argc, char **argv)
long model_reset_selection(Bmodel *model)
Resets the selection to all components.
Bstring symmetry_string()
double timer_start()
Starts timer and prints the time.
long model_symmetrize(Bmodel *model, Bstring &symmetry_string)
Symmetrize a model.
Header file for general utilities.
long model_find_asymmetric_unit(Bmodel *model, Bstring &symmetry_string)
Set model component locations within the asymmetric unit.
int write_model(Bstring &filename, Bmodel *model)
Writes model parameters.
vector< string > split(const string &s)
Splits a string on whitespace.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Library routines used for model processing.
Bmodel * read_model(Bstring &filename)
bool contains(const Bstring &s)
long model_set_component_radius(Bmodel *model, double comprad)
Set the display radius for all components to a specific value.
long model_apply_point_group(Bmodel *model, Bstring &symmetry_string, Vector3< double > origin, View ref_view, int flags=0)
Applying symmetry to model components.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
long model_select(Bmodel *model, Bstring &comptype)
Selects models, components and component types.