14 sys.argv,
"Experiments with trying to visualize an ensemble of structures")
23def read(m, beyond_file):
26 for i
in range(0, beyond_file):
29 "ensemble/aligned-" + str(i) +
".pdb")
42def add_markers(h, c, w):
43 """Add markers to a the passed conformation. The marker locations are chosen
44 pretty thoughtlessly and don't really illustrate the technique well."""
45 def add_marker(s, name):
62 return nm[nm.find(
'-') + 1:nm.rfind(
'.')]
65def add_axis(h, c, w, chain_colors):
66 """Add a coordinate axis to show the relative orientation of the protein"""
70 g.set_name(get_nice_name(h) +
"_orient")
78def add_skeleton(h, c, r, w, chain_colors):
79 """Show the connectivity skeleton of the conformation to give an idea of
80 how things are laid out"""
85 d = ps.evaluate_index(h.get_model(),
86 (hc0.get_particle_index(),
87 hc1.get_particle_index()),
None)
91 mp = .5 * (d0.get_coordinates() + d1.get_coordinates())
93 Cylinder(Segment(d0.get_coordinates(), mp), r))
98 g.set_name(get_nice_name(h) +
"_skel")
101 Cylinder(Segment(d1.get_coordinates(), mp), r))
106 g.set_name(get_nice_name(h) +
"_skel")
120ps.set_log_level(IMP.SILENT)
123print(
"creating rigid bodies")
127 base_chains[c.get_id()] = c
129for i, h
in enumerate(hs):
140 hc, base_chains[c.get_id()])
146for i, c
in enumerate(chains):
150 chain_colors[id] = color
160 h, chain=
'I', residue_index=237).get_selected_particles()[0]).get_z())
161print(
"adding markers", end=
' ')
162for i, h
in enumerate(hso):
168print(
"adding axis", end=
' ')
170for i, h
in enumerate(hs[1:]):
171 add_axis(h,
None, w, chain_colors)
176print(
"adding skeleton", end=
' ')
177for i, h
in enumerate(hs[1:]):
178 add_skeleton(h,
None, 1, w, chain_colors)
Class for storing model, its restraints, constraints, and particles.
Class to handle individual particles of a Model object.
Represent a cylinder in 3D.
Simple implementation of segments in 3D.
Select all CA ATOM records.
Store info for a chain of a protein.
static const IMP::core::HierarchyTraits & get_traits()
Get the molecular hierarchy HierarchyTraits.
static Hierarchy setup_particle(Model *m, ParticleIndex pi, ParticleIndexesAdaptor children=ParticleIndexesAdaptor())
Create a Hierarchy of level t by adding the needed attributes.
void destroy(Hierarchy d)
Delete the Hierarchy.
Hierarchies get_by_type(Hierarchy mhd, GetByType t)
Gather all the molecular particles of a certain level in the hierarchy.
Select hierarchy particles identified by the biological name.
Upper bound harmonic function (non-zero when feature > mean).
Apply a score to a fixed number of close pairs from the two sets.
Return the hierarchy leaves under a particle.
A score on the distance between the surfaces of two spheres.
Display an IMP::core::XYZR particle as a ball.
A decorator for a particle with x,y,z coordinates.
Write a CGO file with the geometry.
Display a reference frame.
Functionality for loading, creating, manipulating and scoring atomic structures.
IMP::core::RigidBody create_rigid_body(const Hierarchies &h, std::string name=std::string("created rigid body"))
Rigidify a molecule or collection of molecules.
IMP::core::RigidBody create_compatible_rigid_body(Hierarchy h, Hierarchy reference)
Rigidify a molecule or collection of molecules.
Hierarchy read_pdb(TextInput input, Model *model, PDBSelector *selector=get_default_pdb_selector(), bool select_first_model=true)
Read all the molecules in the first model of the PDB file.
Hierarchy create_simplified_along_backbone(Hierarchy input, int num_res, bool keep_detailed=false, Model *m=nullptr)
Output IMP model data in various file formats.
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.
Color get_display_color(unsigned int i)
Color get_interpolated_rgb(const Color &a, const Color &b, double f)
Return a color interpolated between a and b in RGB space.
void set_log_level(LogLevel l)
Set the current global log level.
void set_check_level(CheckLevel tf)
Control runtime checks in the code.
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.