def first_step_simulation(strand_seq, trials, temperature, material="DNA"): print( "Running first step mode simulations for %s (with Boltzmann sampling)..." % (strand_seq)) def getOptions(trials, material): o = standardOptions(Options.firstPassageTime, temperature, trials, timeOut=100.0) dissociation(o, strand_seq, trials) # o.DNA23Metropolis() setArrheniusConstantsDNA23(o) # unreleased parameterization return o myMultistrand.setNumOfThreads(8) myMultistrand.setOptionsFactory2(getOptions, trials, material) myMultistrand.setTerminationCriteria(200) myMultistrand.setPassageMode() myMultistrand.run() return myMultistrand.results # this is a first passage rate object
def first_step_simulation(strand_seq, trials, T=20.0, material="DNA"): print( "Running first step mode simulations for %s (with Boltzmann sampling)..." % (strand_seq)) def getOptions(trials, material): o = standardOptions(Options.firstStep, tempIn=25.0, trials=200, timeOut=0.1) hybridization(o, strand_seq, trials) o.DNA23Metropolis() return o myMultistrand.setNumOfThreads(4) myMultistrand.setOptionsFactory2(getOptions, trials, material) myMultistrand.setTerminationCriteria(100) myMultistrand.setLeakMode() myMultistrand.run() return myMultistrand.results # this is a first step rate object
def first_step_simulation(strand_seq, trials, T=25, material="DNA"): print( "Running first step mode simulations for %s (with Boltzmann sampling)..." % (strand_seq)) # Using domain representation makes it easier to write secondary structures. onedomain = Domain(name="onedomain", sequence=strand_seq) gdomain = Domain(name="gdomain", sequence="TTTT") top = Strand(name="top", domains=[onedomain]) bot = top.C dangle = Strand(name="Dangle", domains=[onedomain, gdomain]) duplex_complex = Complex(strands=[top, bot], structure="(+)") invader_complex = Complex(strands=[dangle], structure="..") duplex_invaded = Complex(strands=[dangle, bot], structure="(.+)") # Declare the simulation complete if the strands become a perfect duplex. success_stop_condition = StopCondition( Options.STR_SUCCESS, [(duplex_invaded, Options.exactMacrostate, 0)]) failed_stop_condition = StopCondition( Options.STR_FAILURE, [(duplex_complex, Options.dissocMacrostate, 0)]) for x in [duplex_complex, invader_complex]: x.boltzmann_count = trials x.boltzmann_sample = True # the first argument has to be trials. def getOptions(trials, material, duplex_complex, dangle, success_stop_condition, failed_stop_condition): o = Options(simulation_mode="First Step", substrate_type=material, rate_method="Metropolis", num_simulations=trials, simulation_time=ATIME_OUT, temperature=T) o.start_state = [duplex_complex, dangle] o.stop_conditions = [success_stop_condition, failed_stop_condition] # FD: The result of this script depend significantly on JS or DNA23 parameterization. # o.JSMetropolis25() # o.DNA23Metropolis() setArrheniusConstantsDNA23(o) return o myMultistrand.setOptionsFactory6(getOptions, trials, material, duplex_complex, invader_complex, success_stop_condition, failed_stop_condition) myMultistrand.run() myFSR = myMultistrand.results # Now determine the reaction model parameters from the simulation results. # myFSR = FirstStepRate(dataset, 5e-9) print myFSR
def first_step_simulation(strand_seq, trials, temperature=25.0, sodium=1.0, material="DNA"): print( "Running first step mode simulations for %s (with Boltzmann sampling)..." % (strand_seq)) def getOptions(trials, material, temperature=25.0, sodium=1.0): o = standardOptions(Options.firstStep, tempIn=temperature, trials=200, timeOut=1.0) o.sodium = sodium hybridization(o, strand_seq, trials) o.DNA23Metropolis() # setArrParams(o, 92) # the best DNA23 parameter set return o myMultistrand.setNumOfThreads(6) myMultistrand.setOptionsFactory4(getOptions, trials, material, temperature, sodium) myMultistrand.setTerminationCriteria(500) myMultistrand.setLeakMode() myMultistrand.run() return myMultistrand.results # this is a first step rate object
def first_step_simulation(strand_seq, num_traj, rate_method_k_or_m="Metropolis", concentration=50e-9): print "Running first step mode simulations for %s (with Boltzmann sampling)..." % (strand_seq) myMultistrand.setOptionsFactory2(create_setup, num_traj, strand_seq) myMultistrand.run() return FirstStepRate(myMultistrand.results, CONCENTRATION)
def computeRate(select, trials): myMultistrand.setOptionsFactory2(genOptions, trials, select) myMultistrand.setTerminationCriteria(5) myMultistrand.setLeakMode() # the new leak object -- faster bootstrapping. myMultistrand.run() myFSR = myMultistrand.results low, high = myFSR.doBootstrap() return myFSR.k1()
def computeRate(trialsIn, experiment_type=NORMAL): myMultistrand.setOptionsFactory2(genOptions, trialsIn, experiment_type) # use the new leak rates class for memory efficiency myMultistrand.setLeakMode() myMultistrand.run() results = myMultistrand.results print results # see above - no alternative success conditions defined confidence = Bootstrap(results, computek1=True) print confidence # return results, confidence
def run_distribution(seq): myMultistrand.setNumOfThreads(8) myMultistrand.setOptionsFactory4(setup_options, numOfPaths, seq, 2 * math.exp(-5.06 / RT), None) myMultistrand.run() eq_dict = {} for end_state in myMultistrand.endStates: for cmplx in end_state: if cmplx[4] in eq_dict: count = eq_dict[cmplx[4]][1] eq_dict[cmplx[4]][1] = count + 1 else: eq_dict[cmplx[4]] = [cmplx[5], 1] return eq_dict
def first_step_simulation(strand_seq, trials, T=20.0): print ("Running first step mode simulations for %s (with Boltzmann sampling)..." % (strand_seq)) def getOptions(trials): o = standardOptions(Options.firstStep, TEMPERATURE, trials, ATIME_OUT) hybridization(o, strand_seq, trials) setSaltGao2006(o) return o myMultistrand.setOptionsFactory1(getOptions, trials) myMultistrand.setFirstStepMode() # ensure the right results object is set. myMultistrand.run() return myMultistrand.results
def first_passage_association(strand_seq, trials, concentration, T=20.0): print "Running first passage time simulations for association of %s at %s..." % (strand_seq, concentration_string(concentration)) def getOptions(trials): o = standardOptions(Options.firstPassageTime, TEMPERATURE, trials, ATIME_OUT) hybridization(o, strand_seq, trials, True) setSaltGao2006(o) o.join_concentration = concentration return o myMultistrand.setOptionsFactory1(getOptions, trials) myMultistrand.setPassageMode() myMultistrand.run() return myMultistrand.results
def getRates(): myMultistrand.run() rates = SeesawRates(myMultistrand.results) print rates return rates
def runExperiment(trialsIn, gateA, sel, gateB=None, supersample=25): myMultistrand.setOptionsFactory5(genOptions, trialsIn, gateA, sel, supersample, gateB) myMultistrand.run()
[(myFuel, Options.dissocMacrostate, 0)]) # options stdOptions = standardOptions(trials=trials) stdOptions.start_state = [myGate, myFuel] stdOptions.stop_conditions = [successStopping, failedStopping] # buffer and temperature stdOptions.sodium = 0.05 stdOptions.magnesium = 0.0125 ## believed to be 11.5 mM effectively -- using 12.5 mM anyway stdOptions.temperature = 25 # can run at higher temperature to increase leak rate. # rate model stdOptions.DNA23Metropolis() #setArrheniusConstantsDNA23(stdOptions) stdOptions.simulation_time = 10.0 return stdOptions # actually calling multistrand myMultistrand.setOptionsFactory1(doExperiment, 5 * 20 * 4) myMultistrand.setTerminationCriteria(terminationCount=6) myMultistrand.setLeakMode() myMultistrand.run()