IMP logo
IMP Reference Guide  develop.6f18bfa751,2025/09/20
The Integrative Modeling Platform
gaussians2ellipsoids.py
1 # Use this to produce a chimera command file that when opened with chimera
2 # displays the components of the input GMM as ellipsoids
3 import IMP
4 import IMP.isd
6 import sys
7 
8 gmmfile = sys.argv[1]
9 mdl = IMP.Model()
10 ps = []
12 
13 
14 maxmass = max([IMP.atom.Mass(p).get_mass() for p in ps])
15 
16 for p in ps:
17  g = IMP.core.Gaussian(p)
18  gg = g.get_gaussian()
19  rf = gg.get_reference_frame()
20  tr = rf.get_transformation_to()
21  c = tr.get_translation()
22  r = tr.get_rotation()
23  q = r.get_quaternion()
24  v = gg.get_variances()
25  mass = IMP.atom.Mass(p).get_mass()
26  nm = mass / maxmass
27  cl = (nm, 1-nm, 0)
28  transp = 1.0
29  s = ('shape ellipsoid radius %f,%f,%f qrotation %f,%f,%f,%f '
30  'center %f,%f,%f color %f,%f,%f,%f\n') % (
31  v[0]/10, v[1]/10, v[2]/10, q[1], q[2], q[3], q[0], c[0],
32  c[1], c[2], cl[0], cl[1], cl[2], 1.0)
33  print(s)
Tools for handling Gaussian Mixture Models.
Definition: gmm_tools.py:1
Add mass to a particle.
Definition: Mass.h:23
double get_mass(ResidueType c)
Get the mass from the residue type.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
def decorate_gmm_from_text
read the output from write_gmm_to_text, decorate as Gaussian and Mass
Definition: gmm_tools.py:22
Inferential scoring building on methods developed as part of the Inferential Structure Determination ...