 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
24 "Usage: bpartmulti [options] input.star [input.star]",
25 "---------------------------------------------------",
26 "Selection and analysis of single particles from multiple parameter files.",
27 "Selects particles based on correlation coefficient values",
28 "returning the number of the input file with the best value.",
31 "-reconstructions Operate on reconstruction parameters rather than micrographs.",
32 "-all Reset selection to all particles before other selections (default not).",
33 "-setasu D3 Set the views to the asymmetric unit.",
34 "-select var Select based on: fom (FOM), err (error between first 2),",
35 " rmsd (RMSD between first 2), msd or var (variance).",
36 "-merge Merge multiple files, keeping selected particle parameters.",
37 "-divide 3 Divide the project into a number of subsets of fields.",
38 "-Compare Compare selections.",
39 "-Statistics Do selection statistics.",
42 "-verbose 7 Verbosity of output.",
43 "-symmetry D6 Symmetry: Point group identifier.",
44 "-fom 0.2,2,1 FOM cutoff, index and flag to weigh with defocus (default 0,0,0).",
45 "-Origin 1.2 Origin deviation to accept (default 10 pixels).",
46 "-View 13.5 View deviation to accept (default 180 degrees).",
47 "-Angle 5.8 Rotation angle deviation to accept (default 180 degrees).",
48 "-Magnification 0.03 Magnification deviation to accept (default 2).",
51 "-template input.star Template parameter file to merge in data blocks from other input files.",
54 "-output file.star Output parameter file.",
59 int main(
int argc,
char** argv)
71 double origin_dev(10);
72 double view_dev(
M_PI);
73 double angle_dev(
M_PI);
75 int selection_compare(0);
76 int selection_stats(0);
83 for ( curropt = option; curropt; curropt = curropt->
next ) {
84 if ( curropt->
tag ==
"reconstructions" ) flags |= 1;
85 if ( curropt->
tag ==
"all" ) flags |= 4;
86 if ( curropt->
tag ==
"setasu" )
88 if ( curropt->
tag ==
"merge" )
90 if ( curropt->
tag ==
"divide" )
92 cerr <<
"-divide: A number of subsets must be specified!" << endl;
93 if ( curropt->
tag ==
"select" ) {
95 if ( selection_type.
length() < 1 )
96 cerr <<
"-select: A selection type (fom/var/err) must be specified!" << endl;
98 if ( curropt->
tag ==
"symmetry" )
100 if ( curropt->
tag ==
"fom" ) {
101 if ( curropt->
values(fom_cut, fom_index, fom_def_flag) < 1 )
102 cerr <<
"-fom: A cutoff value must be specified" << endl;
104 selection_type =
"fom";
106 if ( curropt->
tag ==
"Origin" ) {
107 if ( ( origin_dev = curropt->
value.
real() ) <= 0 )
108 cerr <<
"-Origin: An acceptable origin deviation must be specified!" << endl;
110 if ( origin_dev < 0.01 ) origin_dev = 0.01;
112 if ( curropt->
tag ==
"View" ) {
113 if ( ( view_dev = curropt->
value.
real() ) <= 0 )
114 cerr <<
"-View: An acceptable view deviation must be specified!" << endl;
116 view_dev *=
M_PI/180.0;
117 if ( view_dev < 0.001 ) view_dev = 0.001;
120 if ( curropt->
tag ==
"Angle" ) {
121 if ( ( angle_dev = curropt->
value.
real() ) <= 0 )
122 cerr <<
"-Angle: An acceptable angle deviation must be specified!" << endl;
124 angle_dev *=
M_PI/180.0;
125 if ( angle_dev < 0.001 ) angle_dev = 0.001;
128 if ( curropt->
tag ==
"Magnification" ) {
129 if ( ( mag_dev = curropt->
value.
real() ) <= 0 )
130 cerr <<
"-Magnification: An acceptable magnification deviation must be specified!" << endl;
132 if ( mag_dev < 0.0001 ) mag_dev = 0.0001;
134 if ( curropt->
tag ==
"Compare" )
135 selection_compare = 1;
136 if ( curropt->
tag ==
"Statistics" )
138 if ( curropt->
tag ==
"template" )
140 if ( curropt->
tag ==
"output" )
156 if ( masterfile.
length() ) {
160 while ( optind < argc )
string_add(&file_list, argv[optind++]);
162 cerr <<
"Error: No parameter or image files specified!" << endl;
169 for ( np=0; optind < argc; np++ ) {
170 if ( first_project ) {
180 cout << np <<
" parameter files read" << endl << endl;
182 cerr <<
"Error: No parameter or image files specified!" << endl;
188 if ( symmetry_asu.
length() )
192 if ( selection_type.
contains(
"err") )
194 origin_dev, view_dev, angle_dev, mag_dev);
196 if ( selection_type.
contains(
"var") )
198 origin_dev, view_dev, angle_dev, mag_dev);
200 if ( selection_type.
contains(
"msd") )
202 sym, origin_dev, view_dev, angle_dev, mag_dev,
205 if ( selection_type.
contains(
"fom") )
208 if ( selection_compare )
211 if ( selection_stats )
216 first_project->
next = NULL;
A class for a command line input option.
int project_kill(Bproject *project)
Frees a whole project.
int string_kill(Bstring *list)
Kills a string linked list.
long project_divide(Bproject *project, long n)
Divides a project into a number of micrograph subsets.
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.
long project_multi_select_low_difference(Bproject *project1, Bproject *project2, Bsymmetry *sym, double origin_err, double view_err, double angle_err, double mag_err)
Selects the best particle orientations from two parameter files.
Header file for option handlers.
long values(T1 &v1, T2 &v2)
Header file for reading and writing micrograph parameters.
long project_show_selected(Bproject *project)
Shows the selected particles in a project.
long part_reset_selection(Bproject *project, int flag=0)
Resets selection to all particles.
long project_multi_select_low_rmsd(Bproject *project1, Bproject *project2, Bsymmetry *sym, double origin_rmsd, double view_rmsd, double angle_rmsd, double mag_rmsd, int flag)
Selects the best particle orientations from two parameter files.
long project_multi_select_low_variance(Bproject *project_list, Bsymmetry *sym, double origin_dev, double view_dev, double angle_dev, double mag_dev)
Selects the best particle orientations from multiple parameter files.
int project_set_particle_asu_views(Bproject *project, Bstring &symmetry_asu)
Sets particle views within the asymmetric unit.
int main(int argc, char **argv)
Utilities for timing functions.
Bstring symmetry_string()
double timer_start()
Starts timer and prints the time.
long project_multi_selection_stats(Bproject *project_list)
Counts particle assignment distributions using selection arrays.
Bproject * read_project(const char *filename, int flags=0)
Reading micrograph parameters from files.
Header file for general utilities.
Bsymmetry * init_point_group_symmetry(Bstring symmetry_string)
Sets up a symmetry structure from a string identifier.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
int merge(Bimage *p, int padd)
Pads an image and shifts it to the middle.
int write_project(const char *filename, Bproject *project)
Writing micrograph parameters to a file.
Generalized matrix class.
Header file for micrograph processing.
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
long project_multi_selection_compare(Bproject *project1, Bproject *project2)
Calculates the number of selections that are the same.
Selection of single particle parameters from multiple files for classification.
long project_multi_select_best_FOM(Bproject *project_list, double fom_cut, int fom_index, int fom_def_flag)
Selects the best particle orientations from multiple parameter files.
bool contains(const Bstring &s)
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Bproject * project_multi_merge(Bstring *file_list, int fom_index, int flags)
Merges multiple projects.