IMP logo
IMP Reference Guide  2.6.0
The Integrative Modeling Platform
IMP.isd.gmm_tools Namespace Reference

Tools for handling Gaussian Mixture Models. More...

Detailed Description

Tools for handling Gaussian Mixture Models.

Functions

def decorate_gmm_from_text
 read the output from write_gmm_to_text, decorate as Gaussian and Mass More...
 
def draw_points
 given some points (and optional transform), write them to chimera 'bild' format colors flag only applies to ellipses, otherwise it'll be weird More...
 
def fit_dirichlet_gmm_to_points
 fit a GMM to some points. More...
 
def fit_gmm_to_points
 fit a GMM to some points. More...
 
def write_gmm_to_map
 write density map from GMM. More...
 
def write_gmm_to_text
 write a list of gaussians to text. More...
 
def write_sklearn_gmm_to_map
 write density map directly from sklearn GMM (kinda slow) More...
 

Function Documentation

def IMP.isd.gmm_tools.decorate_gmm_from_text (   in_fn,
  ps,
  mdl,
  transform = None,
  radius_scale = 1.0,
  mass_scale = 1.0 
)

read the output from write_gmm_to_text, decorate as Gaussian and Mass

Note
This function is only available in Python.

Definition at line 22 of file gmm_tools.py.

def IMP.isd.gmm_tools.draw_points (   pts,
  out_fn,
  trans = IMP.algebra.get_identity_transformation_3d(),
  use_colors = False 
)

given some points (and optional transform), write them to chimera 'bild' format colors flag only applies to ellipses, otherwise it'll be weird

Note
This function is only available in Python.

Definition at line 135 of file gmm_tools.py.

def IMP.isd.gmm_tools.fit_dirichlet_gmm_to_points (   points,
  n_components,
  mdl,
  ps = [],
  num_iter = 100,
  covariance_type = 'full',
  mass_multiplier = 1.0 
)

fit a GMM to some points.

Will return core::Gaussians. if no particles are provided, they will be created

points: list of coordinates (python) n_components: number of gaussians to create mdl: IMP Model ps: list of particles to be decorated. if empty, will add num_iter: number of EM iterations covariance_type: covar type for the gaussians. options: 'full', 'diagonal', 'spherical' init_centers: initial coordinates of the GMM force_radii: fix the radii (spheres only) force_weight: fix the weights mass_multiplier: multiply the weights of all the gaussians by this value

Note
This function is only available in Python.

Definition at line 312 of file gmm_tools.py.

def IMP.isd.gmm_tools.fit_gmm_to_points (   points,
  n_components,
  mdl,
  ps = [],
  num_iter = 100,
  covariance_type = 'full',
  min_covar = 0.001,
  init_centers = [],
  force_radii = -1.0,
  force_weight = -1.0,
  mass_multiplier = 1.0 
)

fit a GMM to some points.

Will return the score and the Akaike score. Akaike information criterion for the current model fit. It is a measure of the relative quality of the GMM that takes into account the parsimony and the goodness of the fit. if no particles are provided, they will be created

points: list of coordinates (python) n_components: number of gaussians to create mdl: IMP Model ps: list of particles to be decorated. if empty, will add num_iter: number of EM iterations covariance_type: covar type for the gaussians. options: 'full', 'diagonal', 'spherical' min_covar: assign a minimum value to covariance term. That is used to have more spherical shaped gaussians init_centers: initial coordinates of the GMM force_radii: fix the radii (spheres only) force_weight: fix the weights mass_multiplier: multiply the weights of all the gaussians by this value dirichlet: use the DGMM fitting (can reduce number of components, takes longer)

Note
This function is only available in Python.

Definition at line 224 of file gmm_tools.py.

def IMP.isd.gmm_tools.write_gmm_to_map (   to_draw,
  out_fn,
  voxel_size,
  bounding_box = None,
  origin = None 
)

write density map from GMM.

input can be either particles or gaussians

Note
This function is only available in Python.

Definition at line 80 of file gmm_tools.py.

def IMP.isd.gmm_tools.write_gmm_to_text (   ps,
  out_fn 
)

write a list of gaussians to text.

must be decorated as Gaussian and Mass

Note
This function is only available in Python.

Definition at line 62 of file gmm_tools.py.

def IMP.isd.gmm_tools.write_sklearn_gmm_to_map (   gmm,
  out_fn,
  apix = 0,
  bbox = None,
  dmap_model = None 
)

write density map directly from sklearn GMM (kinda slow)

Note
This function is only available in Python.

Definition at line 113 of file gmm_tools.py.