[e40e335] | 1 | #!/usr/bin/env python
|
---|
| 2 | # annealing.py
|
---|
| 3 | #
|
---|
| 4 | # Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann,
|
---|
| 5 | # Jan H. Meinke, Sandipan Mohanty
|
---|
| 6 | #
|
---|
| 7 | """Minimize the energy of met-enkaphalin starting from a given structure using
|
---|
| 8 | simulated annealing. In simulated annealing the temperature of a Monte Carlo
|
---|
| 9 | simulation is slowly reduced from Tmax to Tmin.
|
---|
| 10 | """
|
---|
| 11 | # Adds the source directory to Python's search path.
|
---|
| 12 | import sys
|
---|
| 13 | sys.path.append('../..')
|
---|
| 14 | import smmp, universe, protein
|
---|
| 15 |
|
---|
| 16 | # Initialize the Universe to T=300K with the ECEPP/3 force field, no solvent
|
---|
| 17 | # term (st = 0) and the sub directory SMMP/ as library path. Except for the
|
---|
| 18 | # solvent term, these are the default values. Alternatively, we could have
|
---|
| 19 | # written
|
---|
| 20 | # myUniverse = universe.Universe(st=0)
|
---|
| 21 | # to get the same result.
|
---|
| 22 | myUniverse = universe.Universe(T=300, ff = 'ecepp2', st = 0, libdir ='SMMP/')
|
---|
| 23 | # Create a new protein object from the sequence file ../enkefa.seq and
|
---|
| 24 | # set the dihedral angles according to the values given in ../enkefa.var.
|
---|
| 25 | p = protein.Protein('../enkefa.seq', '../enkefa.ann')
|
---|
| 26 | # Make myUniverse aware of p.
|
---|
| 27 | myUniverse.add(p)
|
---|
| 28 | seed = 81236
|
---|
| 29 | smmp.sgrnd(seed)
|
---|
| 30 |
|
---|
| 31 | Tmin = 100
|
---|
| 32 | Tmax = 1000
|
---|
| 33 | equilibrationSweeps = 100
|
---|
| 34 | sweeps = 100000
|
---|
| 35 | measurementInterval = 1000
|
---|
| 36 | randomStart = 1
|
---|
| 37 | smmp.anneal(equilibrationSweeps, sweeps, measurementInterval, Tmax, Tmin, randomStart)
|
---|