 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
25 "Usage: bxb [options] in1.star [in2.star ...]",
26 "--------------------------------------------",
27 "Extracting a part of a density map and building a new map based on a model.",
28 "Component orientational and positional refinement can be done as:",
29 " 1. random modifications over the specified iterations,",
30 " 2. a contracting grid search when the steps and accuracy are specified.",
33 "-setviews local Calculate views for components. Modes: origin: current origin,",
34 " com: center-of-mass origin, map: map origin, local: neigbor plane.",
35 "-invert Invert views for selected components.",
36 "-linklength 58.4 Reference link length to generate links (angstrom, default 1).",
37 "-type component Type of element: component (default) or link.",
38 "-extract 80,50,30 Extract a part of the density with the given size.",
39 "-build 200,250,150 Build a new map of the given size.",
40 "-refine template.map Refine the positions by cross-correlation.",
41 "-average 2 Average extracted densities: averages per type (use with -extract).",
42 "-componenttype A,Ver Names to assign to component types in the template file.",
45 "-all Reset selection to all models and components before other selections.",
46 "-select #Mod1@14 Select models and components.",
47 "-linkselect 2 Link selection for building a new map (first = 1, default all).",
48 "-fom 0.25 Select: FOM cutoff.",
51 "-verbose 7 Verbose output.",
52 "-datatype u Force writing of a new data type.",
54 "Parameters for building:",
55 "-sampling 1.5,1.5,1.5 Sampling (A/pixel; a single value can be given).",
56 "-origin 0.8,-10,15.7 Set the origin for extracted or built map",
57 " (origins for extract and build cannot be used together).",
58 "-weigh Weigh by contributions when building a new map (default not).",
59 "-separate Separate maps for each component type (default one map).",
61 "Common refinement parameters:",
62 "-resolution 4.5,130 Resolution range for cross-correlation (default 0 - 1e6 angstrom).",
63 "-shift 2.3 Maximum shift allowed per iteration (angstrom, default 10% map width).",
64 "-viewangle 1.4 Maximum rotation angle of view vector allowed per iteration (default 0 degrees).",
65 "-rotationangle 3.5 Maximum rotation angle around view vector allowed per iteration (default 0 degrees).",
66 "-normal Flag to shift only along the component view vector.",
67 "-lateral Flag to shift only perpendicular to the component view vector.",
69 "Parameters for random refinement:",
70 "-iterations 80 Maximum number of refining iterations (default 0 - only positional refinement).",
72 "Parameters for grid refinement:",
73 "-viewstep 2.5 Angular steps in 2 view directions (default 0 degrees).",
74 "-rotationstep 1.3 Angular step around view (default 0 degrees).",
75 "-accuracy 0.7 Angular refinement accuracy (default 0.5 degrees).",
77 "Output image parameters:",
78 "-rescale -0.1,5.2 Rescale data to average and standard deviation.",
81 "-parameters param.star Input parameter file.",
82 "-map file.map Input map file.",
83 "-mask mask.mrc Real space mask to be applied to template and subvolumes.",
84 "-Mask mask.mrc Mask for cross-correlation during refinement.",
87 "-output file.star Output model parameter file.",
88 "-construct file.pif Constructed map file.",
89 "-std file.pif Standard deviation map file.",
94 int main(
int argc,
char **argv)
103 int extract_average(0);
104 double fom_cutoff(0);
108 double hires(0), lores(1e6);
110 double max_view_angle(0);
111 double max_rot_angle(0);
115 double viewstep(0), rotstep(0);
116 double accuracy(0.5);
117 double linklength(1);
121 double nuavg(0), nustd(0);
137 for ( curropt = option; curropt; curropt = curropt->
next ) {
138 if ( curropt->
tag ==
"setviews" ) calc_views = curropt->
value.
lower();
139 if ( curropt->
tag ==
"invert" ) inv_views = 1;
140 if ( curropt->
tag ==
"type" ) {
141 if ( curropt->
value[0] ==
'c' || curropt->
value[0] ==
'C' ) type = 1;
142 if ( curropt->
value[0] ==
'l' || curropt->
value[0] ==
'L' ) type = 2;
144 if ( curropt->
tag ==
"extract" )
145 extract = curropt->
size();
146 if ( curropt->
tag ==
"build" )
147 build = curropt->
size();
148 if ( curropt->
tag ==
"average" )
149 if ( ( extract_average = curropt->
value.
integer() ) < 1 )
150 cerr <<
"-average: An integer must be specified" << endl;
151 if ( curropt->
tag ==
"all" ) reset = 1;
152 if ( curropt->
tag ==
"select" )
153 mod_select = curropt->
value;
154 if ( curropt->
tag ==
"linkselect" )
156 cerr <<
"-linkselect: A number must be specified" << endl;
157 if ( curropt->
tag ==
"fom" )
158 if ( ( fom_cutoff = curropt->
value.
real() ) < 0.001 )
159 cerr <<
"-fom: A FOM cutoff must be specified!" << endl;
160 if ( curropt->
tag ==
"datatype" )
162 if ( curropt->
tag ==
"sampling" )
163 sam = curropt->
scale();
164 if ( curropt->
tag ==
"origin" )
165 origin = curropt->
origin();
166 if ( curropt->
tag ==
"resolution" )
167 if ( curropt->
values(hires, lores) < 1 )
168 cerr <<
"-resolution: A high resolution limit must be specified" << endl;
169 if ( curropt->
tag ==
"shift" )
170 if ( ( max_shift = curropt->
value.
real() ) < 0.001 )
171 cerr <<
"-shift: A maximum shift distance must be specified" << endl;
172 if ( curropt->
tag ==
"viewangle" ) {
173 if ( ( max_view_angle = curropt->
value.
real() ) < 0.001 )
174 cerr <<
"-viewangle: A maximum rotation angle must be specified" << endl;
176 max_view_angle *=
M_PI/180.0;
178 if ( curropt->
tag ==
"rotationangle" ) {
179 if ( ( max_rot_angle = curropt->
value.
real() ) < 0.001 )
180 cerr <<
"-rotationangle: A maximum rotation angle must be specified" << endl;
182 max_rot_angle *=
M_PI/180.0;
184 if ( curropt->
tag ==
"bias" )
185 if ( ( bias = curropt->
value.
real() ) < 0.001 )
186 cerr <<
"-bias: A bias must be specified" << endl;
187 if ( curropt->
tag ==
"normal" ) shift_flag = 1;
188 if ( curropt->
tag ==
"lateral" ) shift_flag = 2;
189 if ( curropt->
tag ==
"iterations" )
191 cerr <<
"-iterations: A number of iterations must be specified!" << endl;
192 if ( curropt->
tag ==
"viewstep" ) {
193 if ( ( viewstep = curropt->
value.
real() ) < 0.001 )
194 cerr <<
"-viewstep: An angle must be specified" << endl;
196 viewstep *=
M_PI/180.0;
198 if ( curropt->
tag ==
"rotationstep" ) {
199 if ( ( rotstep = curropt->
value.
real() ) < 0.001 )
200 cerr <<
"-rotationstep: An angle must be specified" << endl;
202 rotstep *=
M_PI/180.0;
204 if ( curropt->
tag ==
"accuracy" ) {
205 if ( ( accuracy = curropt->
value.
real() ) < 0.001 )
206 cerr <<
"-accuracy: An angle must be specified" << endl;
208 accuracy *=
M_PI/180.0;
210 if ( curropt->
tag ==
"linklength" )
211 if ( ( linklength = curropt->
value.
real() ) < 1 )
212 cerr <<
"-linklength: A link length must be specified" << endl;
213 if ( curropt->
tag ==
"weigh" ) flags |= 1;
214 if ( curropt->
tag ==
"separate" ) flags |= 2;
215 if ( curropt->
tag ==
"componenttype" ) {
216 astring = curropt->
value;
217 if ( astring.
length() ) ct_names = astring.
split(
",");
219 if ( curropt->
tag ==
"rescale" )
220 if ( curropt->
values(nuavg, nustd) < 2 )
221 cerr <<
"-rescale: Both average and standard deviation must be specified!" << endl;
222 if ( curropt->
tag ==
"refine" )
223 refine_template = curropt->
filename();
224 if ( curropt->
tag ==
"parameters" )
226 if ( curropt->
tag ==
"map" )
228 if ( curropt->
tag ==
"mask" )
230 if ( curropt->
tag ==
"Mask" )
232 if ( curropt->
tag ==
"output" )
234 if ( curropt->
tag ==
"construct" )
236 if ( curropt->
tag ==
"std" )
245 while ( optind < argc )
string_add(&file_list, argv[optind++]);
247 cerr <<
"Error: No model files specified!" << endl;
255 cerr <<
"Error: Input file not read!" << endl;
279 cerr <<
"Error: No image file read!" << endl;
288 if ( refine_template.
length() ) {
290 pt =
read_img(refine_template, 1, -1);
292 cerr <<
"Error: No image file read!" << endl;
299 viewstep, rotstep, hires, lores, accuracy,
300 max_shift, max_view_angle, max_rot_angle, shift_flag);
301 }
else if ( type == 2 ) {
303 max_shift, shift_flag, bias);
309 }
else if ( ct_names ) {
317 if ( extract_average > 0 ) {
323 }
else if ( type == 2 ) {
337 }
else if ( type == 2 ) {
343 if ( modelout.
length() ) {
A class for a command line input option.
long model_invert_views(Bmodel *model)
Invert views.
Tcl_Obj * link_select(Bmodel *model, int objc, Tcl_Obj *CONST objv[])
Vector3< double > scale()
int string_kill(Bstring *list)
Kills a string linked list.
Header file for reading and writing atomic model files.
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.
Header file for option handlers.
int calculate_background(long nn, int flag)
Calculates the background for one sub-image.
long model_fom_deselect(Bmodel *model, double fom_cutoff)
Deselects components based on the FOM.
Vector3< double > origin()
int main(int argc, char **argv)
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 values(T1 &v1, T2 &v2)
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
int model_kill(Bmodel *model)
Deallocates all memory in the list.
long model_link_list_generate(Bmodel *model, double maxlength)
Generates a link list for a model based on vertex separation.
General image parameter class.
Header file for reading and writing atomic model files.
Utilities for timing functions.
long model_calculate_views(Bmodel *model, Bstring &mode)
Calculates the views associated with each component.
long model_reset_selection(Bmodel *model)
Resets the selection to all components.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
int write_model(Bstring &filename, Bmodel *model)
Writes model parameters.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Library routines used for analysing model component views.
void change_type(char letter)
Get the data type indicated by a single letter code.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Library routines used for model processing.
Bmodel * read_model(Bstring &filename)
void sampling(long nn, Vector3< double > u)
int model_set_comptype_filenames(Bmodel *model, Bstring &filename)
Sets the filenames of all selected component types to the given string.
DataType
Base data type specifier.
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.
int rescale_to_avg_std(double nuavg, double nustd)
Rescales the image data to a given average and standard deviation.