[e40e335] | 1 | #!/usr/bin/env python
|
---|
| 2 | # minimization.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 | conjugate gradient.
|
---|
| 9 | """
|
---|
| 10 | # Adds the source directory to Python's search path.
|
---|
| 11 | import sys
|
---|
| 12 | sys.path.append('../..')
|
---|
| 13 | import smmp, universe, protein
|
---|
| 14 |
|
---|
| 15 | # Initialize the Universe to T=300K with the ECEPP/3 force field, no solvent
|
---|
| 16 | # term (st = 0) and the sub directory SMMP/ as library path. Except for the
|
---|
| 17 | # solvent term, these are the default values. Alternatively, we could have
|
---|
| 18 | # written
|
---|
| 19 | # myUniverse = universe.Universe(st=0)
|
---|
| 20 | # to get the same result.
|
---|
| 21 | myUniverse = universe.Universe(T=300, ff = 'ecepp3', st = 0, libdir ='SMMP/')
|
---|
| 22 | # Create a new protein object from the sequence file ../enkefa.seq and
|
---|
| 23 | # set the dihedral angles according to the values given in ../enkefa.var.
|
---|
| 24 | p = protein.Protein('../enkefa.seq', '../enkefa.var')
|
---|
| 25 | # Make myUniverse aware of p.
|
---|
| 26 | myUniverse.add(p)
|
---|
| 27 | typeOfMinimization = 1
|
---|
| 28 | maxNumberOfIterations = 10000
|
---|
| 29 | desiredPrecision = 1.0e-9
|
---|
| 30 |
|
---|
| 31 | smmp.minim(typeOfMinimization, maxNumberOfIterations, desiredPrecision)
|
---|