|   | 
                                
 
This example LINUS run file contains all the available options with annotation.
 
Make a copy of this file in your working directory and edit appropriately for your case.
                         
                           
                          
                          
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
#Note extra msfile argument here
def run(file, seed=None, msfile=None):
    if seed is None:
        gen = apply(ran.generator, gen_seeds())
    else:
        gen = apply(ran.generator, seed)
        
    sim = linusSim.Linus(file, gen)
#Here is where the ms file is
    if msfile is not None:
        msfile = os.path.abspath(msfile)
        sim.load_mesostates(msfile)
    
#Beginning of parameter section 
#Default conformational weights = "smart move set"
    sim.set_weights("helix", 0.25,"all")
    sim.set_weights("strand", 0.25,"all")
    sim.set_weights("turn1", 0.125,"all")
    sim.set_weights("turn2", 0.125,"all")
    sim.set_weights("coil", 0.25,"all")
#Next command is only necessary if above do not total 1.0
    sim.normalize_weights()
#Save structures every 100 cycles
    sim.set_simulation_parameters(numsave=100, 
                                  numcycle=1000,
                                  write_rc=0,
#Set temperature to 25 degC with beta=2.0
# (a beta=2.8 is approximately 4 degC)
                                  beta=2.0, 
                                  updateweights=1, 
                                  trials=1, 
                                  reset_conformation=0)
    sim.set_hbond_parameters(use_hbond=1, 
                             hbond_distance=3.5,
                             hbond_probe=1.5,
                             hbond_score_short=0.5,
                             hbond_score_long=1.0,
                             hbond_torsion=140.0,
                             hbond_winmin=2,
                             hbond_winmax=6,
                             use_sidechain_hbond=1,
                             sidechain_hbond_distance=3.5,
                             sidechain_hbond_score=1.0,
                             sidechain_hbond_torsion=140.0,
                             use_hbs_local=0)
    sim.set_contact_parameters(use_contact=1, 
                               contact_probe=2.8, 
                               contact_scale=1.0,
                               contact_winmin=2,
                               contact_winmax=6)
    sim.set_torsion_parameters(use_torsion= 1,
                                torsion_penalty= 1.0)
    sim.set_chasa_parameters(use_chasa=0)
#Include next line only if there is a "weights" file
    sim.read_weights_from_file('weights')
#End of parameter section
#Run simulation in two stages with local interactions only in first
# and super-secondary structure interactions in second
#Weights and conformation from first stage carried over to second
    for delta in (6, 18):
        sim.set_hbond_parameters(hbond_winmax=delta)
        sim.set_contact_parameters(contact_winmax=delta)
        sim.run()
if __name__ == "__main__":
#Use JIT compiler if it is available
    try:
        import psyco
    except ImportError:
        pass
    else:
        psyco.bind(run)  
    import sys, os
#Name of PDB file
    filename = sys.argv[1]
#Look for name of ms file
    try:
        msfile = sys.argv[2]
#If no msfile label it None
    except IndexError:
        msfile = None
#If there is an msfile get full path
    else:
        msfile = os.path.abspath(msfile)
    basedir = os.getcwd()
#Full path of PDB file
    file = os.path.basename(filename)
#Do 5 separate simulations and put output of each in different 
# subdirector, sim_1, sim_2, etc.
#Each new simulation starts with default conformational weights (or from "weights" file)
# and structure in initial PDB file
    for i in range(5):
        curdir = basedir + os.sep + 'sim_' + `i+1`
        os.mkdir(curdir)
        os.link(filename, curdir+os.sep+file)
#Include next line only if there is a "weights" file
        os.link('weights', curdir+os.sep+'weights')
        os.chdir(curdir)
        run(file, msfile=msfile)
				  |   |