IMP logo
IMP Reference Guide  2.17.0
The Integrative Modeling Platform
rigid_brownian_dynamics.py
1 ## \example atom/rigid_brownian_dynamics.py
2 # This example shows how to run brownian dynamics with rigid bodies.
3 
4 import IMP.atom
5 import IMP.core
6 import IMP.algebra
7 import IMP.display
8 import sys
9 
10 IMP.setup_from_argv(sys.argv, "rigid brownian dynamics")
11 
12 
13 def create_rigid_body(m, name):
16  prb.set_coordinates_are_optimized(True)
17  prb.set_name(name + " rb")
19  ph.set_name(name)
20  for i in range(0, 2):
21  for j in range(0, 2):
22  for k in range(0, 2):
26  i, j, k) * 10.0,
27  10))
28  ph.add_child(IMP.atom.Fragment.setup_particle(d))
30  prb.add_member(d)
31  d.set_name(name + str(i) + str(j) + str(k))
33  d.set_rotational_diffusion_coefficient(
34  d.get_rotational_diffusion_coefficient() * 100)
35  return prb, ph
36 
37 
38 def display(i, w, hs):
39  w.set_frame(i)
40  for h in hs:
42  w.add_geometry(g)
43 
44 
45 m = IMP.Model()
46 IMP.set_log_level(IMP.SILENT)
47 
48 rb0, h0 = create_rigid_body(m, "first")
49 rb1, h1 = create_rigid_body(m, "second")
50 rb1.set_reference_frame(IMP.algebra.ReferenceFrame3D(
52 
55  m, rb0.get_rigid_members() + rb1.get_rigid_members()), 1, 3)
56 
59 
61 
63 bd.set_scoring_function(sf)
64 bd.set_time_step(10000)
65 
66 nm = IMP.create_temporary_file_name("rigid_bd", ".pym")
67 nm = "rigid.pym"
69 for i in range(0, 100):
70  display(i, w, [h0, h1])
71  bd.optimize(10)
Simple 3D transformation class.
static RigidBodyDiffusion setup_particle(Model *m, ParticleIndex pi)
All diffusion coefficients are determined from the radius.
Definition: Diffusion.h:103
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
static Fragment setup_particle(Model *m, ParticleIndex pi)
Definition: Fragment.h:67
static XYZR setup_particle(Model *m, ParticleIndex pi)
Definition: XYZR.h:48
Create a scoring function on a list of restraints.
A reference frame in 3D.
static Molecule setup_particle(Model *m, ParticleIndex pi)
Definition: Molecule.h:37
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:73
Simple Brownian dynamics simulator.
Store a list of ParticleIndexes.
static Mass setup_particle(Model *m, ParticleIndex pi, Float mass)
Definition: Mass.h:48
void set_log_level(LogLevel l)
Set the current global log level.
Basic functionality that is expected to be used by a wide variety of IMP users.
General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP...
VectorD< 3 > Vector3D
Definition: VectorD.h:421
Prevent a set of particles and rigid bodies from inter-penetrating.
Class to handle individual particles of a Model object.
Definition: Particle.h:41
Write a CGO file with the geometry.
Definition: PymolWriter.h:34
Restraint * create_distance_restraint(const Selection &n0, const Selection &n1, double x0, double k, std::string name="Distance%1%")
Output IMP model data in various file formats.
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.
Select hierarchy particles identified by the biological name.
Definition: Selection.h:70
static RigidBody setup_particle(Model *m, ParticleIndex pi, ParticleIndexesAdaptor ps)
Definition: rigid_bodies.h:174
Display an IMP::atom::Hierarchy particle as balls.
std::string create_temporary_file_name(std::string prefix="imp_temp", std::string suffix="")
Create a temporary file.