 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
29 "Usage: dcount [options] input.star [input2.star...]",
30 "---------------------------------------------------",
31 "Determines the occupancy of components in the maps associated with models.",
32 "The maps must have positive density for occupancy determination (use -invert option).",
35 "-invert Invert density for determination of the threshold.",
38 "-verbose 7 Verbosity of output.",
39 "-componentradius 8.4 Set radius for all components.",
40 "-shift 40 Maximum shift allowed (angstrom, default infinite).",
41 "-resolution 50,500 Resolution range for cross-correlation (default 0 - 1e6 angstrom).",
42 "-rho 0.8 Protein density (default 0.81 Da/A3, use with -mass).",
43 "-mass 12.645M Molecular mass of the particle (determines the threshold.",
44 "-cutoff 0.3 Cutoff for voxels above threshold for determining occupancy (default 0.5),",
45 "-bins 50 Number of bins for histogram of average intensities at the marker locations in all images.",
46 "-fit 2 Number of fitted binomial distributions to the distribution of occupancy.",
49 "-model model.star Input reference model of expected locations in the particle.",
50 "-template templ.pif Template map for cross-correlation refinement of component locations.",
51 "-Mask shell.map Binary mask to hide denisity in some regions of the map before determination of occupancy.",
54 "-output model.star Model output file.",
55 "-split 3 Split models into individual files:",
56 " Argument: 1-6: number of digits inserted before extension",
57 " Argument: \"id\": model ID's are used as file names.",
58 "-Postscript plots.ps Postscript output file.",
61 "dcount -v 7 -model model_template.star -comp 15.6 -template map_template.pif -shift 55 ",
62 " -resol 50,500 -invert -mass 12.645M -cutoff 50 -bins 20 -fit 2 ",
63 " -output model_occ.star -Postscript model_occ.ps model.star",
69 int main(
int argc,
char **argv)
93 for ( curropt = option; curropt; curropt = curropt->
next ) {
94 if ( curropt->
tag ==
"invert" ) invert_flag = 1;
95 if ( curropt->
tag ==
"fit" )
97 cerr <<
"-fit: Number of fitted distributions must be specified!" << endl;
98 if ( curropt->
tag ==
"componentradius" )
99 if ( ( comprad = curropt->
value.
real() ) < 1 )
100 cerr <<
"-componentradius: A display radius must be specified!" << endl;
101 if ( curropt->
tag ==
"model" )
103 if ( curropt->
tag ==
"Mask" )
105 if ( curropt->
tag ==
"template" )
107 if ( curropt->
tag ==
"shift" )
108 if ( ( max_shift = curropt->
value.
real() ) < 1 )
109 cerr <<
"-shift: A maximum shift distance must be specified" << endl;
110 if ( curropt->
tag ==
"resolution" )
111 if ( curropt->
values(hires, lores) < 1 )
112 cerr <<
"-resolution: A high resolution limit must be specified" << endl;
113 if ( curropt->
tag ==
"rho" )
114 if ( ( rho = curropt->
value.
real() ) < 1 )
115 cerr <<
"-rho: A protein density value must be specified!" << endl;
116 if ( curropt->
tag ==
"mass" ) {
117 if ( ( mol_weight = curropt->
value.
real() ) < 1 )
118 cerr <<
"-mass: A molecular weight must be specified!" << endl;
125 if ( curropt->
tag ==
"cutoff" ) {
126 if ( ( cutoff = curropt->
value.
real() ) < 1 )
127 cerr <<
"-cuttof: A cutoff fraction must be specified!" << endl;
129 if ( cutoff >= 1 ) cutoff /= 100;
131 if ( curropt->
tag ==
"bins" )
133 cerr <<
"-bins: Number of bins must be specified!" << endl;
134 if ( curropt->
tag ==
"output" ) {
135 outmod = curropt->
value;
136 if ( outmod.
length() < 1 )
137 cerr <<
"-output: A filename must be specified!" << endl;
139 if ( curropt->
tag ==
"split" ) {
142 cerr <<
"-split: An integer must be specified!" << endl;
146 if ( curropt->
tag ==
"Postscript" ) {
147 PSname = curropt->
value;
148 if ( PSname.
length() < 1 )
149 cerr <<
"-Postscript: A filename for the output PostScript file must be specified!" << endl;
159 while ( optind < argc )
string_add(&file_list, argv[optind++]);
161 cerr <<
"Error: No model or image files specified!" << endl;
169 cerr <<
"Error: Input file not read!" << endl;
179 cerr <<
"Error: No model was read!\n" << endl;
194 if ( maskfile.
length() ) {
196 if ( pmask == NULL ) {
197 cerr <<
"Error: No mask image was read!\n" << endl;
203 if ( templfile.
length() ) {
206 cerr <<
"Error: No template image was read!\n" << endl;
209 for ( i=0, mp=
model; mp; mp = mp->
next, i++ )
218 vector<double> prob(2*nfit);
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.
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.
Library routines to count components in maps.
vector< double > model_occupancy_distribution(Bmodel *model, double cutoff, int nfit, long &ncomp, vector< double > &prob, double &R)
Calculates the occupancy distribution of models.
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)
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
int model_kill(Bmodel *model)
Deallocates all memory in the list.
General image parameter class.
Header file for reading and writing atomic model files.
Utilities for timing functions.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
int write_model(Bstring &filename, Bmodel *model)
Writes model parameters.
vector< string > split(const string &s)
Splits a string on whitespace.
int main(int argc, char **argv)
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Header file for 2D and 3D image I/O.
int ps_model_occupancy(Bmodel *model, double cutoff, int bins, int nfit, vector< double > &distrib, vector< double > &prob, double R, Bstring &filename)
Generates a postscript plot for a model occupancy analysis.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
int model_refine_comp_for_occupancy(Bmodel *model, Bimage *pmask2, Bimage *ptemp, Bimage *pmask, double hires, double lores, double max_shift)
Refines component views and positions by cross-correlation.
Library routines used for model processing.
Bmodel * read_model(Bstring &filename)
int model_occupancy(Bmodel *model, Bimage *pmask, double mol_weight, double rho, double cutoff, int invert_flag)
Calculates the occupancy of components in a map.
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.
Header file for postscript tools dealing with models.
long model_replace_components(Bmodel *model, Bmodel *modref)
Replaces all components in a model with reference components.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.