 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
22 "Usage: bclass [options] input.star [input.star]",
23 "-----------------------------------------------",
24 "Classifies raw single particle images with respect to multiple reference maps.",
25 "The reference maps can be specified in the parameter file or on the command line.",
27 "Correlation coefficient (FOM = CC)",
28 "R-factor (FOM = 1 - R)",
29 "Phase difference (FOM = cos(dPhi))",
32 "-kernel 10,2 Reciprocal space projection: kernel size and power.",
33 "-CTF Apply CTF to projections.",
36 "-verbose 7 Verbosity of output.",
37 "-resolution 15,200 Resolution limits for comparisons (angstrom).",
38 "-fomtype phase Type FOM to use for classification (default 0=CC=correlation,).",
39 " (other: 1=R=R-factor, 2=PD=phasedifference).",
40 "-cutoff 0.2 FOM cutoff to accept a particle (default 0).",
43 "-reference m1.map,m2.map List of reference maps (replaces any in the parameter file).",
46 "-output file.star Output parameter file.",
47 "-projections Output projection files (with insertion _map<n>).",
48 "-differences Output difference files (with insertion _map<n>_diff).",
53 int main(
int argc,
char **argv)
58 double resolution_lo(1e30);
59 double resolution_hi(0);
70 for ( curropt = option; curropt; curropt = curropt->
next ) {
71 if ( curropt->
tag ==
"kernel" )
72 if ( curropt->
values(kernel_width, kernel_power) < 1 )
73 cerr <<
"-kernel: At least the kernel size must be specified!" << endl;
74 if ( curropt->
tag ==
"CTF" ) ctf_apply = 1;
75 if ( curropt->
tag ==
"resolution" ) {
76 if ( curropt->
values(resolution_hi, resolution_lo) < 1 )
77 cerr <<
"-resolution: At least the high resolution limit must be specified!" << endl;
79 if ( resolution_hi > resolution_lo )
80 swap(resolution_hi, resolution_lo);
82 if ( curropt->
tag ==
"fomtype" ) {
83 if ( isdigit(curropt->
value[0]) ) {
87 if ( curropt->
value[0] ==
'c' )
91 else if ( curropt->
value[0] ==
'p' )
94 if ( fom_type < 0 || fom_type > 2 ) fom_type = 0;
96 if ( curropt->
tag ==
"cutoff" )
97 if ( ( fom_cut = curropt->
value.
real() ) < 0.00001 )
98 cerr <<
"-cutoff: A FOM cutoff must be specified!" << endl;
99 if ( curropt->
tag ==
"projections" )
101 if ( curropt->
tag ==
"differences" )
103 if ( curropt->
tag ==
"reference" )
104 ref_file = curropt->
value;
105 if ( curropt->
tag ==
"output" )
114 while ( optind < argc )
string_add(&file_list, argv[optind++]);
116 cerr <<
"Error: No parameter files specified!" << endl;
124 cerr <<
"Error: No input file read!" << endl;
128 if ( ref_file.
length() ) {
135 cerr <<
"Error: No reference files found!\n" << endl;
140 if ( kernel_width > 1 )
A class for a command line input option.
int project_kill(Bproject *project)
Frees a whole project.
long mg_classify(Bproject *project, double resolution_hi, double resolution_lo, int fom_type, double fom_cut, FSI_Kernel *kernel, int ctf_apply, int img_out)
Classifies particle images with respect to a series of reference maps.
Header file for classification of raw single particle images with respect to multiple models.
int string_kill(Bstring *list)
Kills a string linked list.
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 main(int argc, char **argv)
Header file for option handlers.
long values(T1 &v1, T2 &v2)
Header file for reading and writing micrograph parameters.
Utilities for timing functions.
double timer_start()
Starts timer and prints the time.
Bproject * read_project(const char *filename, int flags=0)
Reading micrograph parameters from files.
Header file for general utilities.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
int write_project(const char *filename, Bproject *project)
Writing micrograph parameters to a file.
Header file for micrograph processing.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
bool contains(const Bstring &s)
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.