IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
slab.py
2import IMP
3import RMF
4import IMP.rmf
5import IMP.atom
6
7height = 20
8radius = 20
9k = 100
10
11m = IMP.Model()
12p_slab = IMP.Particle(m, "slab")
14 p_slab, height, radius)
15p = IMP.Particle(m)
18d.set_radius(10)
19d.set_coordinates_are_optimized(True)
23r = IMP.core.PairRestraint(m, slabps, [p_slab.get_index(), p.get_index()],
24 "slab")
26 IMP.algebra.Vector3D(100, 100, 100))
28 bb)
29bbr = IMP.core.SingletonRestraint(m, bbss, p.get_index(), "bb")
30
31nm = IMP.create_temporary_file_name("slab", ".rmf")
32rmf = RMF.create_rmf_file(nm)
36sg.set_was_used(True)
37sgs = sg.get_components()
38# silliness we have to do for now
40IMP.rmf.add_restraints(rmf, [bbr, r])
41
43
45bd.set_scoring_function([bbr, r])
46bd.set_log_level(IMP.SILENT)
47bd.add_optimizer_state(os)
48bd.set_maximum_time_step(2000)
49
50bd.optimize(100)
51print("File is", nm)
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Class to handle individual particles of a Model object.
Definition Particle.h:45
Simple Brownian dynamics simulator.
static Diffusion setup_particle(Model *m, ParticleIndex pi, Float D)
Setup the particle with the specified diffusion coefficient.
Definition Diffusion.h:76
static Hierarchy setup_particle(Model *m, ParticleIndex pi, ParticleIndexesAdaptor children=ParticleIndexesAdaptor())
Create a Hierarchy of level t by adding the needed attributes.
static Mass setup_particle(Model *m, ParticleIndex pi, Float mass)
Definition Mass.h:48
Upper bound harmonic function (non-zero when feature > mean).
Applies a PairScore to a Pair.
Applies a SingletonScore to a Singleton.
static XYZR setup_particle(Model *m, ParticleIndex pi)
Definition XYZR.h:48
static SlabWithCylindricalPore setup_particle(Model *m, ParticleIndex pi, double thickness, double radius)
Periodically dump the state of all associated objects into the RMF file.
VectorD< 3 > Vector3D
Definition VectorD.h:407
Functionality for loading, creating, manipulating and scoring atomic structures.
Simulation of transport through the Nuclear Pore Complex.
Support for the RMF file format for storing hierarchical molecular data and markup.
void add_static_geometries(RMF::FileHandle parent, const display::GeometriesTemp &r)
Add geometries, assuming they do not move between frames.
void add_restraints(RMF::FileHandle fh, const Restraints &hs)
void add_hierarchies(RMF::FileHandle fh, const atom::Hierarchies &hs)
std::string create_temporary_file_name(std::string prefix="imp_temp", std::string suffix="")
Create a temporary file.