![]() |
Bsoft 2.1.4
Bernard's software package
|
Select particles. More...
Functions | |
int_float * | project_fom_order (Bproject *project, long &npart, int fom_index, int defocus_fit) |
int_float * | part_fom_order (Bparticle *partlist, long &npart, int fom_index) |
long | part_reset_selection (Bproject *project, int flag=0) |
Resets selection to all particles. More... | |
long | part_unset_selection (Bproject *project) |
Unsets selection to no particles. More... | |
long | part_invert_selection (Bproject *project) |
Inverts the selection. More... | |
long | part_select_micrograph (Bproject *project, Bstring &mgselect) |
Sets selection to the micrographs indicated. More... | |
long | part_select_micrographs_with_selected_particles (Bproject *project) |
Sets selection to the micrographs with selected particles. More... | |
long | part_consolidate_selection (Bproject *project, int number) |
Consolidates selected particles under one selection number. More... | |
long | part_set_selection (Bproject *project, int number) |
Selects one selection number and sets all others to zero. More... | |
long | part_set_sequential (Bproject *project) |
Sets selection numbers sequentially. More... | |
long | part_set_FOM (Bproject *project, int fom_index, double fom) |
Sets the FOM for all particles. More... | |
long | part_deselect_from_list (Bproject *project, Bstring list) |
Deselects particles with selection numbers from a list. More... | |
long | part_deselect (Bproject *project, int fom_index, double fommin, double fommax=1e30) |
Deselects particles below a given FOM cutoff. More... | |
long | part_deselect_redundant (Bparticle *partlist, double excl_dist, int part_select, int fom_index) |
Deselects particles overlapping with better ones. More... | |
long | part_deselect_redundant (Bproject *project, double excl_dist, int part_select, int fom_index) |
Deselects particles overlapping with better ones. More... | |
long | part_set_multi_maps (Bproject *project, int part_select, int nmaps) |
Sets selection for generating multiple maps. More... | |
long | part_set_filament_maps (Bproject *project) |
Generates a selection number from the group number for each filament. More... | |
long | part_reselect (Bproject *project, Bstring &tag, double reselect_min, double reselect_max) |
Reselects particles identified by an input STAR tag and between a minimum and maximum. More... | |
double | part_series_comparison (Bproject *project, Bsymmetry &sym, double angle_cutoff) |
A function to select particles based on comparison of the orientations within a series. More... | |
long | part_select_FOM_groups (Bproject *project, int ngroups, int fom_index, int defocus_fit) |
Selects groups of particles based on the FOM. More... | |
long | part_select_percentage (Bproject *project, double percentage, int fom_index, int defocus_fit) |
Selects a percentage of particles based on the FOM. More... | |
long | part_select_best (Bproject *project, long number, int fom_index, int defocus_fit) |
Selects the best particles based on the FOM. More... | |
long | part_select_FOM_avg_std (Bproject *project, double factor, int fom_index) |
Selects particles based on FOM average and standard deviation. More... | |
long | part_select_random (Bproject *project, long number) |
Selects a specific number of particles randomly. More... | |
long | part_select_random_fraction (Bproject *project, double fraction) |
Selects particles randomly based on a fraction of the total. More... | |
long | part_select_random_group (Bproject *project, long number) |
Selects groups randomly to give at least a number of particles. More... | |
long | part_select_random_filaments (Bproject *project, int nmaps) |
Generates a selection number from the group number for each filament. More... | |
long | part_select_bootstrap (Bproject *project, int number) |
Selects a given number of particles randomly with replacement. More... | |
long | part_select_random_within_view (Bproject *project, Bsymmetry &sym, double theta_step, double phi_step, int number) |
Selects a given number of particles within each view. More... | |
long | part_select_maxsmooth (Bproject *project, Bsymmetry &sym, double theta_step, double phi_step, double threshfrac, double sigma, int fom_index) |
Selects particles based on a smoothed maximum surface. More... | |
long | part_select_best_within_view (Bproject *project, Bsymmetry &sym, double theta_step, double phi_step, int number, int fom_index) |
Selects the best number of particles within each view. More... | |
long | part_select_to_group (Bproject *project) |
Transfer selection numbers to the group identifiers. More... | |
long | part_select_group (Bproject *project, int group) |
Selects particles with a given group identifier. More... | |
long | part_select_sets (Bproject *project, int size, int flag) |
Selects sets of particles, each set with the same size. More... | |
long | part_select_frames (Bproject *project, int frame_start, int frame_end) |
Select particles from frames in a series. More... | |
Bparticle * | project_selected_partlist (Bproject *project, int num_select, int bootstrap) |
List of particle images for reciprocal space reconstruction. More... | |
long | part_filament_direction (Bproject *project, double minpct) |
Checks the direction of particles associated with filaments. More... | |
long | part_filament_direction (Bproject *project, Bproject *project2, double minpct) |
Checks the direction of particles associated with filaments and compares with opposite filament direction. More... | |
long | part_view_select (Bproject *project, View view, double angle) |
Selects particles based on a distance from a reference view. More... | |
long | part_side_view_select (Bproject *project, double angle) |
Selects particles based on a distance from a side view. More... | |
long | part_euler_angle_select (Bproject *project, double *euler6) |
Selects particles based on Euler angle limits. More... | |
long | part_origin_select (Bproject *project, Vector3< double > origin, double distance) |
Selects particles based on the distance from the nominal origin. More... | |
long | part_set_first_view_in_series (Bproject *project) |
Sets all orientation parameters for a particle to the first in the set. More... | |
long | part_set_best_view_in_series (Bproject *project, int fom_index) |
Sets all orientation parameters for a particle to the best in the set. More... | |
long | part_select_series (Bproject *project, int size, int flag) |
Select series where all are already selected. More... | |
long | part_series_from_seed (Bproject *project, int flags) |
Calculates the locations of particles in a series from a seed. More... | |
double | part_fom_defocus_fit (Bproject *project, int fom_index, double &intercept, double &slope) |
Fits the particle FOMs as a function of the defocus. More... | |
double | part_fom_defocus_fit_deselect (Bproject *project, int fom_index, double cutoff) |
Deselects particles below a given FOM cutoff, adjusted for the defocus. More... | |
long | part_select_closest_to_focus (Bproject *project) |
Deselects all particles except those from micrographs closest to focus. More... | |
long | part_select_furthest_from_focus (Bproject *project) |
Deselects all particles except those from micrographs furthest from focus. More... | |
long | part_delete_deselected (Bproject *project) |
Deletes deselected particles and renumber the remaining. More... | |
long | part_delete_deselected (Bparticle **partlist) |
Deletes deselected particles and renumber the remaining. More... | |
long | part_fix_defocus (Bproject *project, double max_dev) |
Resets defocus values for particles thata are too far off. More... | |
vector< pair< Bparticle *, double > > | project_part_sort (Bproject *project, Bstring tag) |
Sorts the Particles by a selected parameter. More... | |
Select particles.
long part_consolidate_selection | ( | Bproject * | project, |
int | number | ||
) |
Consolidates selected particles under one selection number.
*project | project parameter structure with all parameters. |
number | new selection number (1 if < 1). |
long part_delete_deselected | ( | Bparticle ** | partlist | ) |
Deletes deselected particles and renumber the remaining.
**partlist | particle parameter structure. |
The old list is deallocated.
long part_delete_deselected | ( | Bproject * | project | ) |
Deletes deselected particles and renumber the remaining.
*project | parameter structure with all parameters. |
long part_deselect | ( | Bproject * | project, |
int | fom_index, | ||
double | fommin, | ||
double | fommax | ||
) |
Deselects particles below a given FOM cutoff.
*project | parameter structure with all parameters. |
fom_index | index of FOM value to test for. |
fommin | minimum threshold for deselection. |
fommax | maximum threshold for deselection. |
Deselects particles with selection numbers from a list.
*project | parameter structure with all parameters. |
list | comma-separated list of selection numbers. |
long part_deselect_redundant | ( | Bparticle * | partlist, |
double | excl_dist, | ||
int | part_select, | ||
int | fom_index | ||
) |
Deselects particles overlapping with better ones.
*partlist | particle linked list. |
excl_dist | minimum distance between particles. |
part_select | initial selection number (-1 means all >0). |
fom_index | index of FOM value to test for. |
long part_deselect_redundant | ( | Bproject * | project, |
double | excl_dist, | ||
int | part_select, | ||
int | fom_index | ||
) |
Deselects particles overlapping with better ones.
*project | parameter structure with all parameters. |
excl_dist | minimum distance between particles. |
part_select | initial selection number (-1 means all >0). |
fom_index | index of FOM value to test for. |
long part_euler_angle_select | ( | Bproject * | project, |
double * | euler6 | ||
) |
Checks the direction of particles associated with filaments and compares with opposite filament direction.
*project | project structure with all parameters. |
*project2 | second project structure with opposite filamant directions. |
minpct | minimum percentage. |
The selected particles associated with a filament is checked for their in-plane direction. If the percentage of particles exceed the minimum desired, the particles with the corresponding direction are selected, and the rest deselected.
long part_filament_direction | ( | Bproject * | project, |
double | minpct | ||
) |
Checks the direction of particles associated with filaments.
*project | project structure with all parameters. |
minpct | minimum percentage. |
The selected particles associated with a filament is checked for their in-plane direction. If the percentage of particles exceed the minimum desired, the particles with the corresponding direction are selected, and the rest deselected.
long part_fix_defocus | ( | Bproject * | project, |
double | max_dev | ||
) |
Resets defocus values for particles thata are too far off.
*project | parameter structure with all parameters. |
max_dev | maximum defocus difference allowed. |
double part_fom_defocus_fit | ( | Bproject * | project, |
int | fom_index, | ||
double & | intercept, | ||
double & | slope | ||
) |
Fits the particle FOMs as a function of the defocus.
*project | parameter structure with all parameters. |
fom_index | index of FOM value to test for. |
&intercept | fit intercept. |
&slope | fit slope. |
The FOM is fit as a linear function of the defocus average.
double part_fom_defocus_fit_deselect | ( | Bproject * | project, |
int | fom_index, | ||
double | cutoff | ||
) |
Deselects particles below a given FOM cutoff, adjusted for the defocus.
*project | parameter structure with all parameters. |
fom_index | index of FOM value to test for. |
cutoff | threshold for deselection. |
The FOM is fit as a linear function of the defocus average. Particles are deselected based on the adjusted FOM cutoff: adj_cut = slope * defocus + cut
long part_invert_selection | ( | Bproject * | project | ) |
Inverts the selection.
*project | project parameter structure with all parameters. |
Selects particles based on the distance from the nominal origin.
*project | project structure with all parameters. |
origin | nominal origin. |
distance | maximum distance to accept. |
Only particles already selected are subject to the test.
Reselects particles identified by an input STAR tag and between a minimum and maximum.
*project | parameter structure with all parameters. |
&tag | tag indicating which data to select on. |
reselect_min | minimum value. |
reselect_max | maximum value. |
Only particles already selected are subject to reselection.
long part_reset_selection | ( | Bproject * | project, |
int | flag | ||
) |
Resets selection to all particles.
*project | project parameter structure with all parameters. |
flag | flag to limit resetting: 1=all, 2=part. |
long part_select_best | ( | Bproject * | project, |
long | number, | ||
int | fom_index, | ||
int | defocus_fit | ||
) |
Selects the best particles based on the FOM.
*project | parameter structure with all parameters. |
number | number of particles. |
fom_index | which FOM value to select on. |
defocus_fit | flag to compensate for defocus. |
Particles are ranked according to the figure-of-merit and the desired percentage selected.
long part_select_best_within_view | ( | Bproject * | project, |
Bsymmetry & | sym, | ||
double | theta_step, | ||
double | phi_step, | ||
int | number, | ||
int | fom_index | ||
) |
Selects the best number of particles within each view.
*project | parameter structure with all parameters. |
*sym | symmetry structure. |
theta_step | angular step size from primary symmetry axis (radians). |
phi_step | angular step size around primary symmetry axis (radians). |
number | number within view to select. |
fom_index | which FOM value to select on. |
The best particles within each view is selected.
long part_select_bootstrap | ( | Bproject * | project, |
int | number | ||
) |
Selects a given number of particles randomly with replacement.
*project | parameter structure with all parameters. |
number | number to select. |
A random number between 1 and the number of selected particles is generated the given number of times. The selection value for the selected particle is incremented each time. A particle may therefore be selected more than once.
long part_select_closest_to_focus | ( | Bproject * | project | ) |
Deselects all particles except those from micrographs closest to focus.
*project | parameter structure with all parameters. |
long part_select_FOM_avg_std | ( | Bproject * | project, |
double | factor, | ||
int | fom_index | ||
) |
Selects particles based on FOM average and standard deviation.
*project | parameter structure with all parameters. |
factor | factor to multiply standard deviation with. |
fom_index | which FOM value to select on. |
Particles are selected using the average and standard deviation, with the level set as a function of difference from the average: selected > average + factor*std_dev Note the multiplying factor can be negative. Only particles already selected are subject to the test.
long part_select_FOM_groups | ( | Bproject * | project, |
int | ngroups, | ||
int | fom_index, | ||
int | defocus_fit | ||
) |
Selects groups of particles based on the FOM.
*project | parameter structure with all parameters. |
ngroups | number of groups of particles. |
fom_index | index of FOM value to select on. |
defocus_fit | flag to compensate for defocus. |
Particles are ranked according to the figure-of-merit and equal numbers are distributed to the requested number of particle groups. The particle group selections are then written into a selection array in the STAR data base, with the group with the best FOM's first. Only particles already selected are subject to the test.
long part_select_frames | ( | Bproject * | project, |
int | frame_start, | ||
int | frame_end | ||
) |
Select particles from frames in a series.
*project | parameter structure with all parameters. |
frame_start | first frame (starts at 1). |
frame_end | last frame. |
Particles in frames from a series in the same field-of-view are selected. Only particles that are already selected are considered.
long part_select_furthest_from_focus | ( | Bproject * | project | ) |
Deselects all particles except those from micrographs furthest from focus.
*project | parameter structure with all parameters. |
long part_select_group | ( | Bproject * | project, |
int | group | ||
) |
Selects particles with a given group identifier.
*project | parameter structure with all parameters. |
group | group identifier. |
long part_select_maxsmooth | ( | Bproject * | project, |
Bsymmetry & | sym, | ||
double | theta_step, | ||
double | phi_step, | ||
double | threshfrac, | ||
double | sigma, | ||
int | fom_index | ||
) |
Selects particles based on a smoothed maximum surface.
*project | parameter structure with all parameters. |
*sym | symmetry structure. |
theta_step | angular step size from primary symmetry axis (radians). |
phi_step | angular step size around primary symmetry axis (radians). |
threshfrac | fraction of maximum threshold. |
sigma | smoothing parameter: gaussian sigma. |
fom_index | which FOM value to select on. |
The best particles within each view is selected.
Sets selection to the micrographs indicated.
*project | project parameter structure with all parameters. |
&mgselect | string with selection. |
Only the micrograph selection fields are modified.
long part_select_micrographs_with_selected_particles | ( | Bproject * | project | ) |
Sets selection to the micrographs with selected particles.
*project | project parameter structure with all parameters. |
Only the micrograph selection fields are modified.
long part_select_percentage | ( | Bproject * | project, |
double | percentage, | ||
int | fom_index, | ||
int | defocus_fit | ||
) |
Selects a percentage of particles based on the FOM.
*project | parameter structure with all parameters. |
percentage | percentage of particles (0 - 100). |
fom_index | which FOM value to select on. |
defocus_fit | flag to compensate for defocus. |
Particles are ranked according to the figure-of-merit and the desired percentage selected.
long part_select_random | ( | Bproject * | project, |
long | number | ||
) |
Selects a specific number of particles randomly.
*project | parameter structure with all parameters. |
number | number to select. |
An array is set up for all selected particles. The given number of random elements is selected in the array and transfered as particle selections.
long part_select_random_filaments | ( | Bproject * | project, |
int | nmaps | ||
) |
Generates a selection number from the group number for each filament.
*project | parameter structure with all parameters. |
nmaps | number of maps to select for. |
long part_select_random_fraction | ( | Bproject * | project, |
double | fraction | ||
) |
Selects particles randomly based on a fraction of the total.
*project | parameter structure with all parameters. |
fraction | fraction of total to select. |
A random number between 0 and 1 is generated for each particle and if it is smaller than the given fraction, the particle is selected.
long part_select_random_group | ( | Bproject * | project, |
long | number | ||
) |
Selects groups randomly to give at least a number of particles.
*project | parameter structure with all parameters. |
number | number to select. |
A random number between 0 and 1 is generated for each particle and if it is smaller than the given fraction, the particle is selected.
long part_select_random_within_view | ( | Bproject * | project, |
Bsymmetry & | sym, | ||
double | theta_step, | ||
double | phi_step, | ||
int | number | ||
) |
Selects a given number of particles within each view.
*project | parameter structure with all parameters. |
*sym | symmetry structure. |
theta_step | angular step size from primary symmetry axis (radians). |
phi_step | angular step size around primary symmetry axis (radians). |
number | number within view to select. |
A random number between 1 and the number of selected particles is generated the given number of times. The selection value for the selected particle is incremented each time. A particle may therefore be selected more than once. This selection is meant to be used with the bootstrap reconstruction.
long part_select_series | ( | Bproject * | project, |
int | size, | ||
int | flag | ||
) |
Select series where all are already selected.
*project | parameter structure with all parameters. |
size | number of particles in each set. |
flag | flag to not count across mg or rec boundaries. |
This function selects those series where all the particles are already selected, and deselects the rest. Sets are selected with each series part of the same set.
long part_select_sets | ( | Bproject * | project, |
int | size, | ||
int | flag | ||
) |
Selects sets of particles, each set with the same size.
*project | parameter structure with all parameters. |
size | number of particles in each set. |
flag | flag to not count across mg or rec boundaries. |
Sets up sets of particles, each set identified as a number in the selection array.
long part_select_to_group | ( | Bproject * | project | ) |
Transfer selection numbers to the group identifiers.
*project | parameter structure with all parameters. |
A function to select particles based on comparison of the orientations within a series.
*project | parameter structure with all parameters. |
*sym | symmetry. |
angle_cutoff | angle cutoff value (radians). |
Only particles already selected are subject to the test.
long part_series_from_seed | ( | Bproject * | project, |
int | flags | ||
) |
Calculates the locations of particles in a series from a seed.
*project | micrograph project. |
flags | bit 1=invert z, bit 2=use original particle view. |
The seed particle locations is either in the zero-degree tilt 2D micrograph, or a 3D reconstruction. The latter also gives the z-coordinate, resulting in a better definition of the particle location. The project selection flag indicates micrograph or reconstruction.
long part_set_best_view_in_series | ( | Bproject * | project, |
int | fom_index | ||
) |
Sets all orientation parameters for a particle to the best in the set.
*project | parameter structure with all parameters. |
fom_index | index of FOM value to select on. |
This function uses the FOM to select the best orientation parameters for a particle in a set (typically a focal series) and sets all orientation parameters to the same values.
long part_set_filament_maps | ( | Bproject * | project | ) |
Generates a selection number from the group number for each filament.
*project | parameter structure with all parameters. |
long part_set_first_view_in_series | ( | Bproject * | project | ) |
Sets all orientation parameters for a particle to the first in the set.
*project | parameter structure with all parameters. |
This function sets the views of all the particles in the field-of-view to the views for the first micrograph.
long part_set_FOM | ( | Bproject * | project, |
int | fom_index, | ||
double | fom | ||
) |
Sets the FOM for all particles.
*project | project parameter structure with all parameters. |
fom_index | index of FOM value to set. |
fom | new FOM. |
long part_set_multi_maps | ( | Bproject * | project, |
int | part_select, | ||
int | nmaps | ||
) |
Sets selection for generating multiple maps.
*project | parameter structure with all parameters. |
part_select | initial selection number (-1 means all >0). |
nmaps | desired number of maps. |
Selected particles are sequentially assigned increasing integers up to desired number of maps (nmaps).
long part_set_selection | ( | Bproject * | project, |
int | number | ||
) |
Selects one selection number and sets all others to zero.
*project | project parameter structure with all parameters. |
number | selection number to keep. |
long part_set_sequential | ( | Bproject * | project | ) |
Sets selection numbers sequentially.
*project | project parameter structure with all parameters. |
long part_side_view_select | ( | Bproject * | project, |
double | angle | ||
) |
Selects particles based on a distance from a side view.
*project | project structure with all parameters. |
angle | angular distance from the side view. |
Only particles already selected are subject to the test.
long part_unset_selection | ( | Bproject * | project | ) |
Unsets selection to no particles.
*project | project parameter structure with all parameters. |
Selects particles based on a distance from a reference view.
*project | project structure with all parameters. |
view | central view to search for. |
angle | angular distance from the view. |
Only particles already selected are subject to the test.
Sorts the Particles by a selected parameter.
*project | project parameter structure. |
tag | parameter tag. |
List of particle images for reciprocal space reconstruction.
*project | image processing parameter structure. |
num_select | selection number from the selection column. |
bootstrap | flag to indicate a bootstrap reconstruction. |
An image is used in the reconstruction if its selection flag has been set. If the selection number is less than zero, all particles with selection flags greater than zero are used. If the selection number is zero or above, all particles with the selection flag set to the same number are used. A bootstrap reconstruction uses the particle selection to weigh each selected particle.