home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.20.2
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
lib
IMP
bayesianem
version 2.20.2
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
4
import
IMP.isd.gmm_tools
5
import
sys
6
7
gmmfile=sys.argv[1]
8
mdl=
IMP.Model
()
9
ps=[]
10
IMP.isd.gmm_tools.decorate_gmm_from_text
(gmmfile,ps,mdl)
11
12
13
maxmass=max([
IMP.atom.Mass
(p).
get_mass
()
for
p
in
ps])
14
15
for
p
in
ps:
16
g=
IMP.core.Gaussian
(p)
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)
IMP::isd.gmm_tools
Tools for handling Gaussian Mixture Models.
Definition:
gmm_tools.py:1
IMP::atom::Mass
Add mass to a particle.
Definition:
Mass.h:23
IMP::atom::get_mass
double get_mass(ResidueType c)
Get the mass from the residue type.
IMP::core::Gaussian
Definition:
core/Gaussian.h:57
IMP::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
Model.h:86
IMP::isd.gmm_tools.decorate_gmm_from_text
def decorate_gmm_from_text
read the output from write_gmm_to_text, decorate as Gaussian and Mass
Definition:
gmm_tools.py:23
IMP::isd
Inferential scoring building on methods developed as part of the Inferential Structure Determination ...