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

Library routines to count components in maps. More...

#include "model_occupancy.h"
#include "binomial.h"
#include "ps_plot.h"
#include "img_combine.h"
#include "model_extract_build.h"
#include "model_compare.h"
#include "model_util.h"
#include "math_util.h"
#include "utilities.h"
#include "linked_list.h"

Functions

double component_coverage (Bimage *p, int img_num, Bcomponent *comp, double threshold)
 
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. More...
 
vector< double > model_occupancy_distribution (Bmodel *model, double cutoff, int nfit, long &ncomp, vector< double > &prob, double &R)
 Calculates the occupancy distribution of models. More...
 
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. More...
 

Variables

int verbose
 

Detailed Description

Library routines to count components in maps.

Author
Daniel Nemecek and Bernard Heymann
Date
Created: 20091202
Modified: 20151110

Function Documentation

◆ component_coverage()

double component_coverage ( Bimage p,
int  img_num,
Bcomponent comp,
double  threshold 
)

◆ model_occupancy()

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.

Author
Daniel Nemecek and Bernard Heymann
Parameters
*modelmodel structure to be modified.
*pmask
mol_weightmolecular weight to determine threshold.
rhoprotein density in Da/A3.
cutoffcoverage cutoff to use for assigning occupancy.
invert_flagflag to invert map density.
Returns
int 0.
The map must have positive density (higher values are considered density).
The coverage for a component is defined as the fraction of voxels within
a sphere around the component location that is above the threshold.
The threshold can be derived from the molecular weight or is taken as
the sum of the map average and standard deviation.
The radius of the sphere is taken from the component radius.

◆ model_occupancy_distribution()

vector< double > model_occupancy_distribution ( Bmodel model,
double  cutoff,
int  nfit,
long &  ncomp,
vector< double > &  prob,
double &  R 
)

Calculates the occupancy distribution of models.

Author
Daniel Nemecek and Bernard Heymann
Parameters
*modelmodel structure to be modified.
cutoffcoverage cutoff to determine occupancy.
nfitnumber of binomial curves to fit.
&ncompmaximum number of components in a model.
*probweight and probability array (2*nfit).
&Rpointer to fit residual.
Returns
vector<double>& occupancy distribution histogram and fits.
The component coverage must already be calculated and stored in the
FOM property of each component. A component is considered occupied
if its coverage exceeds the given cutoff value.
The distribution, error and fit array is set up with 3+nfit columns:
    Column1:    Distribution histogram
    Column2:    Standard deviations
    Column3:    Overall binomial fit curve (sum of remaining columns)
    Column4+:   nfit individual binomial curves

◆ model_refine_comp_for_occupancy()

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.

Author
Daniel Nemecek and Bernard Heymann
Parameters
*modelmodel.
*pmask2mask for the input image.
*ptempdensity template.
*pmaskcross-correlation mask.
hireshigh resolution limit for cross-correlation.
loreslow resolution limit for cross-correlation.
max_shiftmaximum shift in coordinates (angstrom).
Returns
int 0.
The density origin is positioned on the component.
The component views must already be set.
The density and search radii are derived from the radius of each component.
When a shift is out-of-range, returns to the initial position.
The size of the template determines the search area.

Variable Documentation

◆ verbose

int verbose
extern