IMP
2.0.0
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
IMP
IMP Documentation
Application Index
Argument Index
Class Examples
Modeling of GroEL with cnmultifit
Modeling of 3sfd with EMageFit
EMageFit protocol
EMageFit scripts and tools
Factory Index
Determination of a Nup133 structure with FoXS
Function Examples
Example design discussion
Developer Guide
Change History
Installation
Introduction
Mailing lists
Multithreaded evaluation using OpenMP
Integrative docking utility programs
Docking of PCSK9 with idock
Dependencies between objects
Module Index
Modeling of 3sfd with multifit
Deprecated List
Modules
Namespaces
Classes
Files
Examples
algebra/geometry.py
algebra/grid_space.py
atom/assess_dope.py
atom/brownian_statistics.py
atom/cg_pdb.py
atom/charmm_forcefield.py
atom/charmm_forcefield_verbose.py
atom/dope_and_excluded_volume.cpp
atom/load_protein_restrain_bonds.py
atom/markers.py
atom/molecular_hierarchy.py
atom/rigid_brownian_dynamics.py
atom/score_protein_with_ligand.py
atom/structure_from_sequence.py
base/log.py
container/bipartite_nonbonded_interactions.py
container/connectivity.py
container/filter_close_pairs.py
container/nonbonded_interactions.py
container/restrain_in_sphere.py
core/connectivity_restraint.py
core/cover_particles.py
core/custom_hierarchy.py
core/excluded_volume.py
core/incremental_mc.py
core/ms_connectivity_restraint.py
core/optimize_balls.py
core/pair_restraint.py
core/randomize_rigid_body.py
core/restrain_diameter.py
core/restrain_minimum_distance.py
core/rigid_bodies.py
core/rigid_collisions.py
core/symmetry.py
core/XYZ_Decorator.py
core/XYZR_Decorator.py
display/basic_geometry.py
display/display_log.py
display/displaying_ensembles.py
display/show_particles_as_spheres.py
domino/custom_filter.py
domino/domino_approach.py
domino/interactive.py
domino/interactive_with_containers.py
domino/marina_party.py
domino/merge_tree.py
domino/multiscale.py
domino/restraint_cache.py
domino/rigid_body_excluded_volume.py
domino/save_assignments.py
domino/six_particles_optimization.py
em/analyze_convergence.py
em/cube.py
em/fit_restraint.py
em/generate_density_map_of_fixed_dimension.py
em/local_fitting.py
em/pdb2density.py
em2d/clustering_of_pdb_models.py
em2d/collision_cross_section.py
em2d/em_images_conversion.py
em2d/optimize_em2d_with_montecarlo.py
example/range_restriction.py
gsl/simplex.py
kernel/basic_optimization.py
kernel/chain.py
kernel/dependency_graph.py
kernel/dock_with_crosslinks.py
kernel/graph.py
kernel/nup84.py
kernel/setup.py
kernel/write_a_restraint.py
kernel/write_an_optimizer_state.py
kmeans/kmeans_example.py
misc/decay.py
modeller/imp_restraints_in_modeller.py
modeller/load_modeller_model.py
modeller/modeller_restraints_in_imp.py
modules/rotamer/examples/rotamer_pdb.py
parallel/local_distance.py
parallel/tasks.py
restrainer/basic_display.py
restrainer/basic_setup.py
restrainer/em_restraint.py
restrainer/nup84_complex_in_bead_representation.py
restrainer/rigid_body_and_excluded_volume_restraint.py
restrainer/saxs_restraint.py
restrainer/simple_connectivity_on_molecules.py
restrainer/simple_connectivity_on_rigid_bodies.py
restrainer/simple_diameter.py
restrainer/simple_distance.py
restrainer/simple_em_fit.py
restrainer/simple_excluded_volume.py
rmf/geometry.py
rmf/link.py
rmf/multiresolution.py
rmf/pdb.py
rmf/simulation.py
rotamer/rotamer_pdb.py
saxs/profile.py
saxs/profile_fit.py
statistics/kmeans.py
statistics/write_a_metric.py
restrainer/simple_em_fit.py
This example shows how to create simple
IMP::em::FitRestraint
.
1
## \example restrainer/simple_em_fit.py
2
## This example shows how to create simple IMP::em::FitRestraint.
3
##
4
5
#-- File: simple_em_fit.py --#
6
7
import
IMP
8
import
IMP.atom
9
import
IMP.restrainer
10
11
imp_model =
IMP.Model
()
12
13
# Create particle point 1
14
p1 =
IMP.Particle
(imp_model)
15
p1.add_attribute(
IMP.FloatKey
(
"x"
), 12,
True
)
16
p1.add_attribute(
IMP.FloatKey
(
"y"
), 12,
True
)
17
p1.add_attribute(
IMP.FloatKey
(
"z"
), 12,
True
)
18
p1.add_attribute(
IMP.FloatKey
(
"radius"
), 1.0)
19
p1.add_attribute(
IMP.FloatKey
(
"mass"
), 1.0)
20
p1.add_attribute(
IMP.FloatKey
(
"protein"
), 1.0)
21
p1.add_attribute(
IMP.FloatKey
(
"id"
), 1.0)
22
23
# Create particle point 2
24
p2 =
IMP.Particle
(imp_model)
25
p2.add_attribute(
IMP.FloatKey
(
"x"
), 15,
True
)
26
p2.add_attribute(
IMP.FloatKey
(
"y"
), 6,
True
)
27
p2.add_attribute(
IMP.FloatKey
(
"z"
), 6,
True
)
28
p2.add_attribute(
IMP.FloatKey
(
"radius"
), 1.0)
29
p2.add_attribute(
IMP.FloatKey
(
"mass"
), 1.0)
30
p2.add_attribute(
IMP.FloatKey
(
"protein"
), 1.0)
31
p2.add_attribute(
IMP.FloatKey
(
"id"
), 1.0)
32
33
# Create particle point 3
34
p3 =
IMP.Particle
(imp_model)
35
p3.add_attribute(
IMP.FloatKey
(
"x"
), 6,
True
)
36
p3.add_attribute(
IMP.FloatKey
(
"y"
), 15,
True
)
37
p3.add_attribute(
IMP.FloatKey
(
"z"
), 15,
True
)
38
p3.add_attribute(
IMP.FloatKey
(
"radius"
), 1.0)
39
p3.add_attribute(
IMP.FloatKey
(
"mass"
), 1.0)
40
p3.add_attribute(
IMP.FloatKey
(
"protein"
), 1.0)
41
p3.add_attribute(
IMP.FloatKey
(
"id"
), 1.0)
42
43
mp =
IMP.atom.Hierarchy.setup_particle
(p1)
44
mp =
IMP.atom.Hierarchy.setup_particle
(p2)
45
mp =
IMP.atom.Hierarchy.setup_particle
(p3)
46
47
particles = []
48
particles.append(p1)
49
particles.append(p2)
50
particles.append(p3)
51
52
mhs = IMP.atom.Hierarchies()
53
mhs.append(mp)
54
55
dmap = IMP.restrainer.load_em_density_map (
56
IMP.restrainer.get_example_path
(
"in.mrc"
), 1.0, 3.0)
57
58
se = IMP.restrainer.create_simple_em_fit(mhs, dmap)
59
60
r = se.get_restraint()
61
62
imp_model.add_restraint(r)