IMP logo
IMP Reference Guide  2.6.0
The Integrative Modeling Platform
pmi/atomistic.py
1 ## \example pmi/atomistic.py
2 """This script shows how to simulate an atomic system with MD,
3 with a secondary structure elastic network to speed things up.
4 """
5 
6 import IMP
7 import RMF
8 import IMP.atom
9 import IMP.rmf
10 import IMP.pmi
11 import IMP.pmi.topology
12 import IMP.pmi.dof
13 import IMP.pmi.macros
15 
16 # Setup System and add a State
17 mdl = IMP.Model()
19 st1 = s.create_state()
20 
21 # Read sequences and create Molecules
23 gcp2 = st1.create_molecule("GCP2",sequence=seqs["GCP2_YEAST"],chain_id='A')
24 
25 # Add structure. This function returns a list of the residues that now have structure
26 a1 = gcp2.add_structure(IMP.pmi.get_example_path('data/gcp2.pdb'),
27  chain_id='A')
28 
29 # Add structured part representation and then build
30 gcp2.add_representation(a1,resolutions=[0])
31 print('building molecule')
32 hier = s.build()
33 
34 # add charmm restraints
35 print('adding restraints')
37 charmm.add_to_model()
38 
39 # add elastic network on secondary structure units
40 sses = IMP.pmi.io.parse_dssp(IMP.pmi.get_example_path('data/gcp2.dssp'),'A')
41 all_rs = []
42 for sse in sses['helix']+sses['beta']:
44  selection_tuples=sse,
45  strength=10.0,
46  dist_cutoff=5.0,
47  ca_only=True,
48  hierarchy=hier)
49  all_rs.append(er)
50  er.add_to_model()
51 
52 # seutp MD and run
54 md_ps = dof.setup_md(gcp2)
56  root_hier=hier,
57  crosslink_restraints = all_rs, #for visualizing SSEs in RMF
58  molecular_dynamics_sample_objects=md_ps,
59  molecular_dynamics_steps=5,
60  number_of_best_scoring_models=0, # set >0 to store best PDB files (but this is slow to do online)
61  number_of_frames=1, # increase number of frames to get better results!
62  global_output_directory='atomistic_output/')
63 rex.execute_macro()