IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
pmi/atomistic.py

This script shows how to simulate an atomic system with MD, with a secondary structure elastic network to speed things up.

## \example pmi/atomistic.py
"""This script shows how to simulate an atomic system with MD,
with a secondary structure elastic network to speed things up.
"""
import IMP
import IMP.atom
import IMP.rmf
import IMP.pmi
import sys
IMP.setup_from_argv(sys.argv, "Simulation of an atomic system")
if IMP.get_check_level() >= IMP.USAGE_AND_INTERNAL:
print("This example is too slow to test in debug mode - run without")
print("internal tests enabled")
sys.exit(0)
# Setup System and add a State
mdl = IMP.Model()
st1 = s.create_state()
# Read sequences and create Molecules
gcp2 = st1.create_molecule("GCP2", sequence=seqs["GCP2_YEAST"], chain_id='A')
# Add structure. This function returns a list of the residues that now
# have structure
a1 = gcp2.add_structure(IMP.pmi.get_example_path('data/gcp2.pdb'),
chain_id='A')
# Add structured part representation and then build
gcp2.add_representation(a1, resolutions=[0])
print('building molecule')
hier = s.build()
# add charmm restraints
print('adding restraints')
charmm.add_to_model()
# add elastic network on secondary structure units
sses = IMP.pmi.io.parse_dssp(IMP.pmi.get_example_path('data/gcp2.dssp'), 'A',
name_map={'A': 'GCP2'})
all_rs = []
for sse in sses['helix']+sses['beta']:
selection_tuples=sse,
strength=10.0,
dist_cutoff=5.0,
ca_only=True,
hierarchy=hier)
all_rs.append(er)
er.add_to_model()
# setup MD and run
md_ps = dof.setup_md(gcp2)
mdl,
root_hier=hier,
molecular_dynamics_sample_objects=md_ps,
molecular_dynamics_steps=5,
# set >0 to store best PDB files (but this is slow to do online)
number_of_best_scoring_models=0,
# increase number of frames to get better results!
number_of_frames=1,
global_output_directory='atomistic_output/')
rex.execute_macro()
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Simplify creation of constraints and movers for an IMP Hierarchy.
A macro to help setup and run replica exchange.
Definition macros.py:164
A dictionary-like wrapper for reading and storing sequence data.
Represent the root node of the global IMP.atom.Hierarchy.
Functionality for loading, creating, manipulating and scoring atomic structures.
Create movers and set up constraints for PMI objects.
parse_dssp(dssp_fn, limit_to_chains='', name_map=None)
Read a DSSP file, and return secondary structure elements (SSEs).
Protocols for sampling structures and analyzing them.
Definition macros.py:1
Restraints for keeping correct stereochemistry.
Set of Python classes to create a multi-state, multi-resolution IMP hierarchy.
Python classes to represent, score, sample and analyze models.
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.
Support for the RMF file format for storing hierarchical molecular data and markup.
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.
CheckLevel get_check_level()
Get the current audit mode.
Definition exception.h:80