コード例 #1
0
def first_step_simulation(form_f):
 
    strand_seq = form_f['sequence']
 
    print ("Running first step mode simulations for %s (with Boltzmann sampling)..." % (strand_seq))
        
    def getOptions(trials):
         
        o = standardOptions(tempIn=float(form_f['temperature']), timeOut=A_TIME_OUT) 
        
        o.num_simulations = TRIALS
        hybridization(o, strand_seq, trials)
        o.sodium = form_f['sodium']
        o.magnesium = form_f['magnesium']
        o.concentration = 1.0E-9
        
        if "RNA" == form_f['substrate']:
            o.substrate_type = Literals.substrateRNA
        
        return o
    
    MergeSimSettings.max_trials = MAX_TRIALS
    
    myMultistrand = MergeSim()
    myMultistrand.setOptionsFactory1(getOptions, TRIALS)
    myMultistrand.setTerminationCriteria(int(form_f["trajectories"]))
    myMultistrand.settings.timeOut = max(WALL_TIME_TIMEOUT, form_f["trajectories"])
    myMultistrand.run()
    
    return myMultistrand
コード例 #2
0
def computeHittingTimes(settings, reverse=False):

    myMultistrand = MergeSim()
    myMultistrand.setNumOfThreads(NUM_PROCESS)

    if settings.type == enum_yurke2:
        myMultistrand.setOptionsFactory1(simulationYurke2, settings.nTrials)

    if settings.type == enum_bonnet:
        myMultistrand.setOptionsFactory2(simulationHairpin, settings.nTrials,
                                         reverse)

    if settings.type == enum_flamm:
        myMultistrand.setOptionsFactory1(simulationFlamm2000, settings.nTrials)

    if settings.type == enum_yurke:
        myMultistrand.setOptionsFactory1(simulationYurke, settings.nTrials)

    if settings.type == enum_rickettsia:
        myMultistrand.setOptionsFactory1(simulationRickettsia,
                                         12 * settings.nTrials)
        myMultistrand.setTerminationCriteria(terminationCount=settings.nTrials)

    if settings.type == enum_bonnet or settings.type == enum_yurke2:
        myMultistrand.setPassageMode()  # using the pre-set success / fail

    if settings.type == enum_flamm or settings.type == enum_yurke or settings.type == enum_rickettsia:
        # non-first stepping mode, no need to store trajectory information
        myMultistrand.setPassageMode()

    myMultistrand.run()

    return myMultistrand.results
コード例 #3
0
def first_passage_association(strand_seq, trials, concentration, T=20.0):

    thisMS = MergeSim()
    thisMS.setNumOfThreads(8)
    print "Running first passage time simulations for association of %s at %s..." % (
        strand_seq, concentration_string(concentration))

    def getOptions(trials):

        o = standardOptions(Literals.first_passage_time, TEMPERATURE, trials,
                            ATIME_OUT)

        hybridization(o, strand_seq, trials, True)
        setSaltGao2006(o)
        o.join_concentration = concentration
        o.DNA23Metropolis()

        return o

    thisMS.setOptionsFactory1(getOptions, trials)
    thisMS.setPassageMode()
    thisMS.run()

    return thisMS
コード例 #4
0
def first_step_simulation(strand_seq, trials, T=20.0):

    myMS = MergeSim()
    myMS.setNumOfThreads(8)
    print(
        "Running first step mode simulations for %s (with Boltzmann sampling)..."
        % (strand_seq))

    def getOptions(trials):

        o = standardOptions(Literals.first_step, TEMPERATURE, trials,
                            ATIME_OUT)
        hybridization(o, strand_seq, trials)
        setSaltGao2006(o)
        o.DNA23Metropolis()

        return o

    myMS.setOptionsFactory1(getOptions, trials)
    myMS.setFirstStepMode()  # ensure the right results object is set.
    #     myMultistrand.setLeakMode()
    myMS.setTerminationCriteria(terminationCount=trials)
    myMS.run()
    return myMS