Bsoft 2.1.4
Bernard's software package
mg_multiple.cpp File Reference

Selection of single particle parameters from multiple files for classification. More...

#include "mg_processing.h"
#include "mg_img_proc.h"
#include "mg_select.h"
#include "mg_particle_select.h"
#include "rwmg.h"
#include "Matrix.h"
#include "linked_list.h"
#include "utilities.h"

Functions

long project_check_same_number_particles (Bproject *project_list)
 
Bprojectproject_multi_merge (Bstring *file_list, int fom_index, int flags)
 Merges multiple projects. More...
 
long project_multi_add (Bproject *project, Bstring *file_list, int fom_index)
 Merges multiple projects with an existing one. More...
 
Bprojectproject_multi_add_particles (Bstring *file_list)
 Adds particles from a list of projects to the first one. More...
 
long project_multi_adjust_FOM (Bproject *project_list, int fom_index)
 Adjusts FOM to the avergae of the first project. More...
 
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. More...
 
long project_multi_selection_stats (Bproject *project_list)
 Counts particle assignment distributions using selection arrays. More...
 
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. More...
 
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. More...
 
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. More...
 
long project_multi_selection_compare (Bproject *project1, Bproject *project2)
 Calculates the number of selections that are the same. More...
 

Variables

int verbose
 

Detailed Description

Selection of single particle parameters from multiple files for classification.

Author
Bernard Heymann
Date
Created: 20010319
Modified: 20220831

Function Documentation

◆ project_check_same_number_particles()

long project_check_same_number_particles ( Bproject project_list)

◆ project_multi_add()

long project_multi_add ( Bproject project,
Bstring file_list,
int  fom_index 
)

Merges multiple projects with an existing one.

Parameters
*projectproject to add/merge to.
*file_listlinked list of parameter file names.
fom_indexindex of FOM to select on.
Returns
long selected particles.
The selected particles are merged with existing ones.
Requirement: The project component ID's must correspond.

◆ project_multi_add_particles()

Bproject * project_multi_add_particles ( Bstring file_list)

Adds particles from a list of projects to the first one.

Parameters
*file_listlinked list of parameter file names.
Returns
Bproject* project with renumbered particles.
The particles from other files are added to existing ones in the first file.
Where project component ID's correspond the particles are added,
otherwise new components are added.
Particles are renumbered and the references to old particle files removed.

◆ project_multi_adjust_FOM()

long project_multi_adjust_FOM ( Bproject project_list,
int  fom_index 
)

Adjusts FOM to the avergae of the first project.

Parameters
*project_listlinked list of project structures with all parameters.
fom_indexindex of FOM to select on.
Returns
long number of particles selected.
Requirement: The project structures must be of identical form.

◆ project_multi_merge()

Bproject * project_multi_merge ( Bstring file_list,
int  fom_index,
int  flags 
)

Merges multiple projects.

Parameters
*file_listlinked list of parameter file names.
fom_indexindex of FOM to select on.
flagsflags: 1=rec, 2=template, 4=reset.
Returns
Bproject* merged project.
The selected particles are merged.
Requirement: The project component ID's must correspond.
If bit 2 of the flag is set (2), it signifies a template and the FOM's of the template
are set to zero.

◆ project_multi_select_best_FOM()

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.

Parameters
*project_listlinked list of project structures with all parameters.
fom_cutFOM cutoff to eliminate bad particles.
fom_indexindex of FOM to select on.
fom_def_flagflag to adjust the cutoff for defocus.
Returns
long number of particles selected.
The orientation parameters for each particle is selected from
the file with the highest FOM. The selection flag gets the number 
of the file from which the particle was selected, with the first
file getting the number 1. If the best FOM is under the cutoff,
the selection flag is set to zero. The selected orientation
parameters are written into the first micrograph parameter
structure.
Requirement: The project structures must be of identical form.

◆ project_multi_select_low_difference()

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.

Parameters
*project1first project structure with all parameters.
*project2second project structure with all parameters.
*symsymmetry.
origin_errcutoff to accept origins (pixels).
view_errcutoff to accept views (radians).
angle_errcutoff to accept rotation angles (radians).
mag_errcutoff to accept magnifications (fraction).
Returns
long number of particles selected.
The error is calculated between parameters. 
Requirement: The origin, view and rotation angle (or Euler angle), 
    and magnification arrays in the micrographs must be defined.

◆ project_multi_select_low_rmsd()

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.

Parameters
*project1first project structure with all parameters.
*project2second project structure with all parameters.
*symsymmetry.
origin_rmsdcutoff to accept origins (pixels).
view_rmsdcutoff to accept views (radians).
angle_rmsdcutoff to accept rotation angles (radians).
mag_rmsdcutoff to accept magnifications (fraction).
flag0=RMSD, 1=MSD
Returns
long number of particles selected.
The error is calculated between parameters. 
Requirement: The origin, view and rotation angle (or Euler angle), 
    and magnification arrays in the micrographs must be defined.

◆ project_multi_select_low_variance()

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.

Parameters
*project_listlinked list of project structures with all parameters.
*symsymmetry.
origin_devcutoff to accept origins (pixels).
view_devcutoff to accept views (radians).
angle_devcutoff to accept rotation angles (radians).
mag_devcutoff to accept magnifications (fraction).
Returns
long number of particles selected.
The standard deviations of particle parameters are calculated as 
follows:
    origin_std = sqrt(var(origin_x) + var(origin_y))
    view_std = sqrt(var(view_x) + var(view_y) + var(view_z))
    angle_std = sqrt(var(angle))
    size_std = sqrt(var(magnification))
Requirement: The origin, view and rotation angle (or Euler angle), 
    and magnification arrays in the micrographs must be defined.

◆ project_multi_selection_compare()

long project_multi_selection_compare ( Bproject project1,
Bproject project2 
)

Calculates the number of selections that are the same.

Parameters
*project1first project structure with all parameters.
*project2second project structure with all parameters.
Returns
long number of particles selections the same.

◆ project_multi_selection_stats()

long project_multi_selection_stats ( Bproject project_list)

Counts particle assignment distributions using selection arrays.

Parameters
*project_listlinked list of project structures with all parameters.
Returns
long number of particles selected.
Requirement: The project structures must be of identical form.

Variable Documentation

◆ verbose

int verbose
extern