IMP logo
IMP Reference Guide  2.20.0
The Integrative Modeling Platform
slab.py
1 from __future__ import print_function
2 import IMP.npctransport
3 import IMP
4 import RMF
5 import IMP.rmf
6 import IMP.atom
7 
8 height = 20
9 radius = 20
10 k = 100
11 
12 m = IMP.Model()
13 p_slab = IMP.Particle(m, "slab")
15  p_slab, height, radius)
16 p = IMP.Particle(m)
19 d.set_radius(10)
20 d.set_coordinates_are_optimized(True)
24 r = IMP.core.PairRestraint(m, slabps, [p_slab.get_index(), p.get_index()],
25  "slab")
26 bb = IMP.algebra.BoundingBox3D(IMP.algebra.Vector3D(-100, -100, -100),
27  IMP.algebra.Vector3D(100, 100, 100))
29  bb)
30 bbr = IMP.core.SingletonRestraint(m, bbss, p.get_index(), "bb")
31 
32 nm = IMP.create_temporary_file_name("slab", ".rmf")
33 rmf = RMF.create_rmf_file(nm)
37 sg.set_was_used(True)
38 sgs = sg.get_components()
39 # silliness we have to do for now
40 IMP.rmf.add_static_geometries(rmf, [bbg]+sgs)
41 IMP.rmf.add_restraints(rmf, [bbr, r])
42 
43 os = IMP.rmf.SaveOptimizerState(m, rmf)
44 
46 bd.set_scoring_function([bbr, r])
47 bd.set_log_level(IMP.SILENT)
48 bd.add_optimizer_state(os)
49 bd.set_maximum_time_step(2000)
50 
51 bd.optimize(100)
52 print("File is", nm)
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:425
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.