|
This command file for running a LINUS simulation will perform multiple simulations.
Each simulation output will be in a new subdirectory; sim_1, sim_2, sim_3, etc.
The user should edit the "range" to set the number simulations to be run. In the example below five simulations will be run.
for i in range(5):
Make a copy of this file in your working directory and edit it appropriately.
To run a LINUS simulation see the Examples section.
from pylinus_1_0 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):
if seed is None:
gen = apply(ran.generator, gen_seeds())
else:
gen = apply(ran.generator, seed)
sim = linusSim.Linus(file, gen)
#Beginning of parameter section
sim.set_simulation_parameters(numsave=100,
numcycle=5000)
sim.set_hbond_parameters(use_hbond=1,
use_sidechain_hbond=1)
sim.set_contact_parameters(use_contact=1)
#End of parameter section
sim.run()
if __name__ == "__main__":
try:
import psyco
except ImportError:
pass
else:
psyco.bind(run)
import sys, os
filename = sys.argv[1]
basedir = os.getcwd()
file = os.path.basename(filename)
for i in range(5):
curdir = basedir + os.sep + 'sim_' + `i+1`
os.mkdir(curdir)
os.link(filename, curdir+os.sep+file)
os.chdir(curdir)
run(file)
| |