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.
13 def read(m, beyond_file):
16 for i
in range(0,beyond_file):
31 def add_markers(h, c, w):
32 """Add markers to a the passed conformation. The marker locations are chosen
33 pretty thoughtlessly and don't really illustrate the technique well."""
34 def add_marker(s, name):
50 return nm[nm.find(
'-')+1:nm.rfind(
'.')]
52 def add_axis(h, c, w, chain_colors):
53 """Add a coordinate axis to show the relative orientation of the protein"""
57 g.set_name(get_nice_name(h)+
"_orient")
64 def add_skeleton(h, c, r, w, chain_colors):
65 """Show the connectivity skeleton of the conformation to give an idea of
66 how things are layed out"""
71 d= ps.evaluate((hc0, hc1),
None)
75 mp= .5*(d0.get_coordinates()+d1.get_coordinates())
81 g.set_name(get_nice_name(h)+
"_skel")
88 g.set_name(get_nice_name(h)+
"_skel")
100 ps.set_log_level(IMP.base.SILENT)
103 print "creating rigid bodies"
107 base_chains[c.get_id()]=c
109 for i, h
in enumerate(hs):
125 for i,c
in enumerate(chains):
130 chain_colors[id]=color
140 residue_index=237).get_selected_particles()[0]).get_z(),
142 residue_index=237).get_selected_particles()[0]).get_z()))
143 print "adding markers",
144 for i,h
in enumerate(hso):
151 for i,h
in enumerate(hs[1:]):
152 add_axis(h,
None, w, chain_colors)
157 print "adding skeleton",
158 for i,h
in enumerate(hs[1:]):
159 add_skeleton(h,
None, 1, w, chain_colors)