IMP logo
IMP Reference Guide  2.22.0
The Integrative Modeling Platform
gaussians2ellipsoids.py
1 #Use this to produce a chimera command file that when opened with chimera displays the components of the input GMM as ellipsoids
2 import IMP
3 import IMP.isd
5 import sys
6 
7 gmmfile=sys.argv[1]
8 mdl=IMP.Model()
9 ps=[]
11 
12 
13 maxmass=max([IMP.atom.Mass(p).get_mass() for p in ps])
14 
15 for p in ps:
17  gg=g.get_gaussian()
18  rf=gg.get_reference_frame()
19  tr=rf.get_transformation_to()
20  c=tr.get_translation()
21  r=tr.get_rotation()
22  q=r.get_quaternion()
23  v=gg.get_variances()
24  mass=IMP.atom.Mass(p).get_mass()
25  nm=mass/maxmass
26  cl=(nm,1-nm,0)
27  transp=1.0
28  s=('shape ellipsoid radius %f,%f,%f qrotation %f,%f,%f,%f center %f,%f,%f color %f,%f,%f,%f\n')%(v[0]/10,v[1]/10,v[2]/10,q[1],q[2],q[3],q[0],c[0],c[1],c[2],cl[0],cl[1],cl[2],1.0)
29  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 ...