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

 

linus.py

This is the main calling program for running a LINUS simulation. The user should edit the "parameter section" to set the number of cycles and frequency of saving structures as well as turning on/off components of the scoring function. Any of the default parameter values may be changed by adding an appropriate entry from the list of parameters (with different values) to the appropriate argument list in linus.py. These parameter entries in linus.py will override the default values.

For example, to turn off H-bonds between sidechain and backbone but include H-bonds between backbone atoms the set_hbond_parameters arguments should be:


    sim.set_hbond_parameters(use_hbond=1,
                           use_sidechain_hbond=0)

The following is a minimal linus.py file. Make a copy of this file in your working directory and edit it appropriately. To run a LINUS simulation see the Examples section. Other examples of LINUS run files may be examined by clicking on a menu item to the left.


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]

    run(filename)

Additional notes on linus.py :

gen_seeds generates seed values for the random number generator which utilizes multiple recursive sequences. (P. L'Ecuyer, ``Good Parameter Sets for Combined Multiple Recursive Random Number Generators'', Operations Research, 47, 1 (1999), 159--164; a longer version is available on the web at http://www.iro.umontreal.ca/~lecuyer/myftp/papers/combmrg2.ps)

psyco is the JIT compiler which is used if available.