The script shows a couple experiments with trying to visualize an ensembe of structures. The ensemble is fairly tight on the assembly scale, but there is significant variation between the location and orientation of the individual proteins (which were modeled as rigid bodies). To save space, the models have had their sidechain atoms removed.
19 def read(m, beyond_file):
22 for i
in range(0, beyond_file):
25 "ensemble/aligned-" + str(i) +
".pdb")
40 def add_markers(h, c, w):
41 """Add markers to a the passed conformation. The marker locations are chosen
42 pretty thoughtlessly and don't really illustrate the technique well."""
43 def add_marker(s, name):
60 return nm[nm.find(
'-') + 1:nm.rfind(
'.')]
63 def add_axis(h, c, w, chain_colors):
64 """Add a coordinate axis to show the relative orientation of the protein"""
68 g.set_name(get_nice_name(h) +
"_orient")
76 def add_skeleton(h, c, r, w, chain_colors):
77 """Show the connectivity skeleton of the conformation to give an idea of
78 how things are layed out"""
83 d = ps.evaluate((hc0, hc1),
None)
87 mp = .5 * (d0.get_coordinates() + d1.get_coordinates())
89 Cylinder(Segment(d0.get_coordinates(), mp), r))
94 g.set_name(get_nice_name(h) +
"_skel")
97 Cylinder(Segment(d1.get_coordinates(), mp), r))
102 g.set_name(get_nice_name(h) +
"_skel")
115 ps.set_log_level(IMP.base.SILENT)
118 print "creating rigid bodies"
122 base_chains[c.get_id()] = c
124 for i, h
in enumerate(hs):
135 hc, base_chains[c.get_id()])
142 for i, c
in enumerate(chains):
147 chain_colors[id] = color
157 residue_index=237).get_selected_particles(
160 residue_index=237).get_selected_particles()[0]).get_z()))
161 print "adding markers",
162 for i, h
in enumerate(hso):
170 for i, h
in enumerate(hs[1:]):
171 add_axis(h,
None, w, chain_colors)
176 print "adding skeleton",
177 for i, h
in enumerate(hs[1:]):
178 add_skeleton(h,
None, 1, w, chain_colors)