IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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
3import IMP
4import IMP.isd
6import sys
7
8gmmfile = sys.argv[1]
9mdl = IMP.Model()
10ps = []
12
13
14maxmass = max([IMP.atom.Mass(p).get_mass() for p in ps])
15
16for p in ps:
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)
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Add mass to a particle.
Definition Mass.h:23
Tools for handling Gaussian Mixture Models.
Definition gmm_tools.py:1
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
Definition gmm_tools.py:22
Inferential scoring building on methods developed as part of the Inferential Structure Determination ...