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