IMP logo
IMP Reference Guide  2.11.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")
14 slab= IMP.npctransport.SlabWithCylindricalPore.setup_particle \
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()], "slab")
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 
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)
Upper bound harmonic function (non-zero when feature > mean)
static XYZR setup_particle(Model *m, ParticleIndex pi)
Definition: XYZR.h:48
Score particles based on how far outside a box they are.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
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:44
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)
Definition: Diffusion.h:50
VectorD< 3 > Vector3D
Definition: VectorD.h:395
Class to handle individual particles of a Model object.
Definition: Particle.h:41
Applies a PairScore to a Pair.
Definition: PairRestraint.h:29
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.