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

Functions to calculate a 3D map from atomic coordinates. More...

#include "molecule_to_map.h"
#include "scatter.h"
#include "Complex.h"
#include "UnitCell.h"
#include "linked_list.h"
#include "utilities.h"
#include <fstream>

Macros

#define MAXSID   1024
 
#define MAXSCAT   100
 
#define MAXRAD   100
 

Functions

int mol_to_image (Bmolgroup *molgroup, Bimage *p, Batomtype *atompar, double resolution, double Bfactor, int wrap, int gextype)
 
int mol_to_structure_factors (Bmolgroup *molgroup, Bimage *p, Batomtype *atompar, double resolution, int wrap, double Bfactor)
 
Bimageimg_from_molecule (Bmolgroup *molgroup, Vector3< double > origin, Vector3< long > size, Vector3< double > sampling, double resolution, double Bfactor, int wrap, int gextype, int spacegroup, UnitCell unit_cell)
 Calculates a 3D density map from a set of atomic coordinates. More...
 
int compare_mol_map (Bmolgroup *molgroup, Bimage *pcalc, Bimage *p)
 Compares reference and calculated maps and calculates an occupancy for every atom in the molecule set. More...
 
Bimageimg_sf_from_molecule (Bmolgroup *molgroup, Vector3< double > origin, Vector3< long > size, Vector3< double > sampling, double resolution, int spacegroup, UnitCell unit_cell, int wrap, double Bfactor, Bstring &paramfile)
 Calculates a 3D set of structure factors from a set of atomic coordinates. More...
 
double one_sf (Bmolgroup *molgroup, Bimage *p, long i, double s, double scale, double *scat)
 
double * get_potential_curves (Batomtype *atompar, double interval)
 
double * get_scattering_curves (Batomtype *atompar, double Bfactor, double recip_interval, long &nscat)
 
map< string, vector< double > > get_scattering_curves (map< string, Bcomptype > &types, double Bfactor, double recip_interval)
 

Variables

int verbose
 

Detailed Description

Functions to calculate a 3D map from atomic coordinates.

Author
Bernard Heymann
Date
Created: 19970914
Modified: 20210216

Macro Definition Documentation

◆ MAXRAD

#define MAXRAD   100

◆ MAXSCAT

#define MAXSCAT   100

◆ MAXSID

#define MAXSID   1024

Function Documentation

◆ compare_mol_map()

int compare_mol_map ( Bmolgroup molgroup,
Bimage pcalc,
Bimage p 
)

Compares reference and calculated maps and calculates an occupancy for every atom in the molecule set.

Parameters
*molgroupset of molecules with atomic coordinates.
*pcalcmap calculated from the set of molecules.
*preference map.
Returns
int 0.

◆ get_potential_curves()

double * get_potential_curves ( Batomtype atompar,
double  interval 
)

◆ get_scattering_curves() [1/2]

double * get_scattering_curves ( Batomtype atompar,
double  Bfactor,
double  recip_interval,
long &  nscat 
)

◆ get_scattering_curves() [2/2]

map< string, vector< double > > get_scattering_curves ( map< string, Bcomptype > &  types,
double  Bfactor,
double  recip_interval 
)

◆ img_from_molecule()

Bimage * img_from_molecule ( Bmolgroup molgroup,
Vector3< double >  origin,
Vector3< long >  size,
Vector3< double >  sampling,
double  resolution,
double  Bfactor,
int  wrap,
int  gextype,
int  spacegroup,
UnitCell  unit_cell 
)

Calculates a 3D density map from a set of atomic coordinates.

Parameters
*molgroupset of molecules with atomic coordinates.
origin3-valued origin vector (angstrom).
size3-valued size vector (voxels).
samplingsampling/voxel size (angstrom/voxel).
resolutionresolution (angstrom).
Bfactorglobal B-factor to use, if 0, use individual atom B-factors
wrapwrapping flag.
gextypetype of gaussian used: 0 = single, 1 = atomic potential
spacegroupcrystal space group.
unit_cell6-valued vector of unit cell parameters.
Returns
Bimage* the new map.
A 3D map is calculated from atomic coordinates by placing a gaussian
sphere at each set of atomic coordinates. The resolution is set as
twice the sigma coefficient of the gaussian function. The amplitude
of the gaussian function is set so that the total density calculated
equals the atomic mass. The resultant map therefore has the density
units of Dalton/voxel.
The statistics of the new image is calculated.

◆ img_sf_from_molecule()

Bimage * img_sf_from_molecule ( Bmolgroup molgroup,
Vector3< double >  origin,
Vector3< long >  size,
Vector3< double >  sampling,
double  resolution,
int  spacegroup,
UnitCell  unit_cell,
int  wrap,
double  Bfactor,
Bstring paramfile 
)

Calculates a 3D set of structure factors from a set of atomic coordinates.

Parameters
*molgroupset of molecules with atomic coordinates.
origin3-valued origin vector (voxels).
size3-valued size vector (voxels).
samplingsampling/voxel size (angstrom/voxel).
resolutionresolution (angstrom).
spacegroupcrystal space group.
unit_cell6-valued vector of unit cell parameters.
wrap0=cut atoms outside box, 1=wrap coordinates within unit cell.
Bfactorconstant for decay curve.
&paramfileparameter file with scattering coefficients.
Returns
Bimage* the new structure factors.
All structure factors within a given resolution are calculated from
all the selected atomic coordinates. The coordinates are fractionalized
to fit into the given size box. If the size of the box is not given,
it defaults to:
    x_size = (max(x_coor) - min(x_coor)) / x_sampling
The atomic scattering profiles are read from the STAR database as the
amplitudes and B-factors of reciprocal space gaussians. For each profile,
a lookup table is calculated to speed up further calculations.
The statistics of the new image is calculated.

◆ mol_to_image()

int mol_to_image ( Bmolgroup molgroup,
Bimage p,
Batomtype atompar,
double  resolution,
double  Bfactor,
int  wrap,
int  gextype 
)

◆ mol_to_structure_factors()

int mol_to_structure_factors ( Bmolgroup molgroup,
Bimage p,
Batomtype atompar,
double  resolution,
int  wrap,
double  Bfactor 
)

◆ one_sf()

double one_sf ( Bmolgroup molgroup,
Bimage p,
long  i,
double  s,
double  scale,
double *  scat 
)

Variable Documentation

◆ verbose

int verbose
extern