Home Linus Helper Programs Examples File Descriptions Index

Sample LINUS Run Files

 

Minimal Run File

Multiple Simulation Run File

Read Weights Run File

Read Mesostate Run File

All Options Run File


LINUS

 

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 
=====================================
HELIX   SHEET   TURN1   TURN2    COIL
0.250   0.250   0.125   0.125   0.250
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_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)
    sim.read_weights_from_file('weights')
#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)
#
# 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(1):
        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)