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
display/basic_geometry.py
This example shows how to write basic geometric primitives to a file with color and name.
1
## \example display/basic_geometry.py
2
## This example shows how to write basic geometric primitives to a file with color and name.
3
4
import
IMP.display
5
6
# or IMP.display.ChimeraWriter
7
# if using chimera, make sure there is a %1% in the name to support multiple frames
8
name=IMP.create_temporary_file_name(
"example"
,
".py"
)
9
print
"File name is"
, name
10
w=
IMP.display.PymolWriter
(name)
11
12
bb=
IMP.algebra.BoundingBox3D
(
IMP.algebra.Vector3D
(0,0,0),
13
IMP.algebra.Vector3D
(100, 100, 100))
14
# we could skip the outer loop if we only have one frame
15
for
f
in
range(0,10):
16
w.set_frame(f)
17
g=
IMP.display.BoundingBoxGeometry
(bb)
18
g.set_name(
"bb"
)
19
w.add_geometry(g)
20
for
i
in
range(0,10):
21
p=
IMP.algebra.get_random_vector_in
(bb)
22
g=
IMP.display.SphereGeometry
(
IMP.algebra.Sphere3D
(p, 10))
23
# give each a distinctive color
24
g.set_color(
IMP.display.get_display_color
(i))
25
g.set_name(str(i))
26
# add it to the file
27
w.add_geometry(g)