File: gb_example_writing_trajectory.py

package info (click to toggle)
openstructure 2.11.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 206,256 kB
  • sloc: cpp: 188,571; python: 36,686; ansic: 34,298; fortran: 3,275; sh: 312; xml: 146; makefile: 29
file content (42 lines) | stat: -rw-r--r-- 982 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from ost.mol.mm import *

"""
MM - Demo

!!!Requires OpenStructure to be compiled with MM-Support!!!

This demo should show the procedure of setting up a simulation and write
the results directly to disk.
"""


prot=io.LoadPDB('1CRN.pdb')

#set up the simulation
settings = Settings()
settings.integrator = LangevinIntegrator(310,1,0.002)
settings.add_gbsa = True
settings.forcefield = LoadCHARMMForcefield()
settings.nonbonded_cutoff = 8.0
settings.nonbonded_method = NonbondedMethod.CutoffNonPeriodic
settings.platform = Platform.CPU
settings.cpu_properties["CpuThreads"] = "2"

sim = Simulation(prot,settings)

#minimize it
sim.ApplySD(tolerance = 1.0, max_iterations = 200)

#create a trajectory observer and register it to the simulation
observer = TrajWriter(10,"gb_example_traj.pdb","gb_example_traj.dcd")
sim.Register(observer)

#run the simulation
sim.Steps(10000)

#Trajectory Observer needs to finalize, otherwise you might get a corrupt dcd file
observer.Finalize()