9 from __future__
import print_function
20 def read(m, beyond_file):
23 for i
in range(0, beyond_file):
26 "ensemble/aligned-" + str(i) +
".pdb")
41 def add_markers(h, c, w):
42 """Add markers to a the passed conformation. The marker locations are chosen
43 pretty thoughtlessly and don't really illustrate the technique well."""
44 def add_marker(s, name):
61 return nm[nm.find(
'-') + 1:nm.rfind(
'.')]
64 def add_axis(h, c, w, chain_colors):
65 """Add a coordinate axis to show the relative orientation of the protein"""
69 g.set_name(get_nice_name(h) +
"_orient")
77 def add_skeleton(h, c, r, w, chain_colors):
78 """Show the connectivity skeleton of the conformation to give an idea of
79 how things are layed out"""
84 d = ps.evaluate((hc0, hc1),
None)
88 mp = .5 * (d0.get_coordinates() + d1.get_coordinates())
90 Cylinder(Segment(d0.get_coordinates(), mp), r))
95 g.set_name(get_nice_name(h) +
"_skel")
98 Cylinder(Segment(d1.get_coordinates(), mp), r))
103 g.set_name(get_nice_name(h) +
"_skel")
116 ps.set_log_level(IMP.base.SILENT)
119 print(
"creating rigid bodies")
123 base_chains[c.get_id()] = c
125 for i, h
in enumerate(hs):
136 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()[0]).get_z())
158 print(
"adding markers", end=
' ')
159 for i, h
in enumerate(hso):
165 print(
"adding axis", end=
' ')
167 for i, h
in enumerate(hs[1:]):
168 add_axis(h,
None, w, chain_colors)
173 print(
"adding skeleton", end=
' ')
174 for i, h
in enumerate(hs[1:]):
175 add_skeleton(h,
None, 1, w, chain_colors)
Return the hierarchy leaves under a particle.
Upper bound harmonic function (non-zero when feature > mean)
IMP::core::RigidBody create_compatible_rigid_body(Hierarchy h, Hierarchy reference)
Rigidify a molecule or collection of molecules.
void set_log_level(LogLevel l)
Set the current global log level.
void set_check_level(CheckLevel tf)
Control runtime checks in the code.
Represent a cylinder in 3D.
A score on the distance between the surfaces of two spheres.
Color get_interpolated_rgb(const Color &a, const Color &b, double f)
Return a color interpolated between a and b in RGB space.
Display a reference frame.
static Hierarchy setup_particle(kernel::Model *m, kernel::ParticleIndex pi, kernel::ParticleIndexesAdaptor children=kernel::ParticleIndexesAdaptor())
Hierarchies get_by_type(Hierarchy mhd, GetByType t)
std::string get_example_path(std::string file_name)
Return the path to installed example data for this module.
Color get_display_color(unsigned int i)
A decorator for a particle with x,y,z coordinates.
Class to handle individual model particles.
static const IMP::core::HierarchyTraits & get_traits()
Get the molecular hierarchy HierarchyTraits.
void destroy(Hierarchy d)
Delete the Hierarchy.
Simple implementation of segments in 3D.
Hierarchy create_simplified_along_backbone(Chain input, const IntRanges &residue_segments, bool keep_detailed=false)
IMP::core::RigidBody create_rigid_body(Hierarchy h)
Write a CGO file with the geometry.
Store info for a chain of a protein.
Select all CA ATOM records.
Output IMP model data in various file formats.
Functionality for loading, creating, manipulating and scoring atomic structures.
void read_pdb(base::TextInput input, int model, Hierarchy h)
Hierarchies get_leaves(const Selection &h)
Select hierarchy particles identified by the biological name.
Class for storing model, its restraints, constraints, and particles.
Display an IMP::core::XYZR particle as a ball.