IMP  2.4.0
The Integrative Modeling Platform
display_log.py
1 ## \example display/display_log.py
2 # A simple example of how to use one of the IMP.display.LogOptimizerStates.
3 
4 import IMP.kernel
5 import IMP.display
6 import IMP.core
7 import IMP.container
8 
10 ps = IMP.core.create_xyzr_particles(m, 20, 5)
12 
13 # write it to a series of files, if the file name did not contain %1%, then
14 # it would concatenate the outputs into a single file instead. Concatenating the
15 # output can be quite useful with Pymol as that makes it less likely to crash.
17  m, IMP.display.ChimeraWriter("log_file.%1%.pym"))
18 # the logging occurs ever two frames
19 log.set_period(2)
21 g.set_name("my particles")
22 g.set_color(IMP.display.Color(1, 0, 0))
23 log.add_geometry(g)
24 
26 r.set_log_level(IMP.base.VERBOSE)
27 
29 o.set_scoring_function([r])
30 mv = IMP.core.BallMover(ps, 10)
31 o.add_mover(mv)
32 o.add_optimizer_state(log)
33 
34 o.optimize(1000)
A Monte Carlo optimizer.
Definition: MonteCarlo.h:45
Represent an RGB color.
Definition: Color.h:24
Write geometry to a Python file for Chimera to read.
Definition: ChimeraWriter.h:29
Various classes to hold sets of particles.
Display an IMP::SingletonContainer of IMP::core::XYZR particles as balls.
Definition: XYZR.h:149
Modify a set of continuous variables by perturbing them within a ball.
Store a kernel::ParticleIndexes.
Base functionality and abstract base classes for representation, scoring and sampling.
XYZRs create_xyzr_particles(kernel::Model *m, unsigned int num, Float radius, Float box_side=10)
Create a set of particles with random coordinates.
Basic functionality that is expected to be used by a wide variety of IMP users.
Prevent a set of particles and rigid bodies from inter-penetrating.
Output IMP model data in various file formats.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73