|
This command file will run a LINUS simulation with secondary structure conformation weights from a previous simulation instead of the default weights which are:
============================================================
Conformation Weights
============================================================
RESIDUE HELIX SHEET TURN1 TURN2 COIL PII
1 ACE 0.000 0.000 0.000 0.000 1.000 0.000
2 MET 0.000 0.000 0.000 0.000 1.000 0.000
3 GLN 0.513 0.037 0.093 0.000 0.187 0.171
4 ILE 0.544 0.042 0.050 0.048 0.156 0.161
The user should make a copy of the conformation weights file in the working directory.
(The conformation weights file would be an output file from a previous LINUS run and it has a name such as *_006_001.SWT):
cp [filename].SWT weights
Make a copy of the command file below in your working directory and edit it appropriately.
To run a LINUS simulation with previous weights see the Example 3. section.
from pylinus_2_4 import linusSim, ran
def gen_seeds():
from random import uniform
s1 = long(uniform(1.0, ran.M1))
s2 = long(uniform(1.0, ran.M1))
s3 = long(uniform(1.0, ran.M1))
s4 = long(uniform(1.0, ran.M2))
s5 = long(uniform(1.0, ran.M2))
s6 = long(uniform(1.0, ran.M2))
return s1, s2, s3, s4, s5, s6
def run(file,seed=None,mlfile=None,wtsfile=None,msfile=None,
pmsfile=None,distfile=None):
if seed is None:
gen = apply(ran.generator, gen_seeds())
else:
gen = apply(ran.generator, seed)
sim = linusSim.Linus(file, gen)
sim.load_movelist(mlfile)
sim.set_simulation_parameters(numsave=100,
numcycle=5000)
sim.set_hbond_parameters(use_hbond=1)
sim.set_contact_parameters(use_contact=1)
sim.run()
if __name__ == "__main__":
try:
import psyco
except ImportError:
pass
else:
psyco.bind(run)
import sys, os
filename = sys.argv[1]
file = os.path.basename(filename)
basedir = os.getcwd()
wtsfile = os.path.abspath('weights')
#
# The loop below demonstrates how to launch multiple simulations
# from one command file.
# Increment the range to perform additional simulations
#
# Note that the "weights" file needs to be linked in each sub-directory
#
for i in range(5):
curdir = basedir + os.sep + 'sim_' + `i+1`
os.mkdir(curdir)
os.link(filename, curdir+os.sep+file)
os.link('weights', curdir+os.sep+'weights')
os.chdir(curdir)
run(file,wtsfile=wtsfile)
| |