def test0(unusedargs): o1 = standardOptions() dissociation(o1, "CCCCCATTAAC") o1.simulation_mode = Literals.first_passage_time return o1
def simulationYurke(trialsIn): stdOptions = standardOptions(simMode=Literals.first_passage_time, trials=trialsIn) stdOptions.simulation_time = A_TIME_OUT stdOptions.DNA23Metropolis() stdOptions.temperature = 25.0 domS = Domain(sequence="ACTAATCCTCAGATCCAGCTAGTGTC", name="d_S") domD = Domain(sequence="A", name="d_A") domT = Domain(sequence="CGTACT", name="d_T") strandQ = Strand(domains=[domS, domD]) strandT = Strand(domains=[domT, domS]) strandS = strandT.C complexStart = Complex(strands=[strandQ, strandS, strandT], structure="(.+)(+).") complexEndS = Complex(strands=[strandQ], structure="..") complexEndF = Complex(strands=[strandT], structure="..") # # ALT_SUCCESS is dissociation stopSuccess = StopCondition(Literals.success, [(complexEndS, Literals.dissoc_macrostate, 3)]) stopFailed = StopCondition(Literals.alt_success, [(complexEndF, Literals.dissoc_macrostate, 3)]) stdOptions.start_state = [complexStart] stdOptions.stop_conditions = [stopSuccess, stopFailed] return stdOptions
def doSims(numTraj=2): o1 = standardOptions() o1.simulation_mode = Options.firstStep o1.num_simulations = numTraj o1.output_interval = 1 o1.simulation_time = ATIME_OUT myComplex1 = makeComplex(["GTCACTGCTTTT"], "............") myComplex2 = makeComplex(["GTCACTGC", "GCAGTGAC"], ".(((((((+))))))).") o1.start_state = [myComplex1, myComplex2] # myComplex = makeComplex(["GTCACTGCTTTT","GTCACTGC","GCAGTGAC"], "..(.........+).((((((+))))))..") # o1.start_state = [myComplex] # no stop conditions, just timeout. o1.initial_seed = time.time() * 1000000 # o1. initial_seed = 1501710503137097 s = SimSystem(o1) s.start() printTrajectory(o1)
def doReactionAssociation(arguments, output=True): stdOptions = standardOptions() stdOptions.simulation_mode = Literals.trajectory stdOptions.num_simulations = arguments[0] stdOptions.temperature = arguments[1] stdOptions.join_concentration = arguments[2] seq = arguments[3] hybridization(stdOptions, seq, doFirstPassage=True) if len(arguments) > 4: stdOptions.sodium = arguments[4] stdOptions.magnesium = arguments[5] if output: stdOptions.output_interval = 1 stdOptions.simulation_time = A_TIME_OUT stdOptions.simulation_mode = Literals.trajectory i = 65 for state in stdOptions.start_state: for strand in state.strand_list: strand.id = i i += 1 return stdOptions
def simulationFlamm2000(trialsIn): seq = "GGCCCCTTTGGGGGCCAGACCCCTAAAGGGGTC" structStart = "................................." struct0 = "((((((((((((((.....))))))))))))))" struct1 = "((((((....)))))).((((((....))))))" stdOptions = standardOptions(simMode=Literals.trajectory, trials=trialsIn, tempIn=37.0) stdOptions.substrate_type = Literals.substrateRNA stdOptions.gt_enable = 1 stdOptions.simulation_time = A_TIME_OUT stdOptions.DNA23Metropolis() stemdomain1 = Domain(name="stemdomain1", sequence=seq) strand = Strand(name="top", domains=[stemdomain1]) startComplex = Complex(strands=[strand], structure=structStart) successComplex0 = Complex(strands=[strand], structure=struct0) successComplex1 = Complex(strands=[strand], structure=struct1) # Stop when the exact full duplex is achieved. stopSuccess0 = StopCondition( Literals.success, [(successComplex0, Literals.exact_macrostate, 0)]) stopSuccess1 = StopCondition( Literals.alt_success, [(successComplex1, Literals.exact_macrostate, 0)]) stdOptions.start_state = [startComplex] stdOptions.stop_conditions = [stopSuccess0, stopSuccess1] return stdOptions
def create_setup(num_traj, strand_seq): options = standardOptions("First Step", GLOBAL_TEMPERATURE, num_traj, ATIME_OUT) hybridization(options, strand_seq, num_traj) setSaltGao2006(options) return options
def inspectionSim(inputs): o1 = standardOptions() o1.rate_method = self.options.rate_method o1.start_state = inputs[0] return o1
def doSims(strandSeq, numTraj=2): curr = time.time() o1 = standardOptions(tempIn=36.95) o1.num_simulations = numTraj o1.output_time = 0.0004 # output every .4 ms o1.simulation_time = 0.35 # unit: second o1.gt_enable = 1 o1.substrate_type = Literals.substrateRNA o1.simulation_mode = Literals.trajectory o1.cotranscriptional = True # enables the strand growing on the 3' end. onedomain = Domain(name="mydomain", sequence=strandSeq) top = Strand(name="top", domains=[onedomain]) startTop = Complex(strands=[top], structure=".") o1.start_state = [startTop] o1.DNA23Arrhenius() # o1.initial_seed = 1777+6 s = SimSystem(o1) s.start() printTrajectory(o1) print "Exe time is " + str(time.time() - curr)
def simulationYurke2(trialsIn): stdOptions = standardOptions(simMode=Literals.first_passage_time, trials=trialsIn) stdOptions.simulation_time = A_TIME_OUT stdOptions.DNA23Metropolis() domS = Domain(sequence="ACTAATCCTCAGATCCAGCTAGTGTC", name="d_S") domD = Domain(sequence="A", name="d_A") domT = Domain(sequence="CGTACT", name="d_T") strandQ = Strand(domains=[domS, domD]) strandT = Strand(domains=[domT, domS]) strandS = strandT.C # complexEndS = Complex(strands=[strandQ], structure="..") complexEndF = Complex(strands=[strandT], structure="..") complexEndFC = Complex(strands=[strandQ, strandS], structure="(.+).") complexAttached = Complex(strands=[strandQ, strandS, strandT], structure="**+*(+)*") stopSuccess = StopCondition( Literals.success, [(complexAttached, Literals.loose_macrostate, 1)]) stdOptions.start_state = [complexEndF, complexEndFC] stdOptions.stop_conditions = [stopSuccess] stdOptions.join_concentration = 0.0001 # 100 microMolar return stdOptions
def test1(unusedargs): o1 = standardOptions() hybridization(o1, "CCC") o1.simulation_mode = Literals.first_passage_time return o1
def getOptions(trials): o = standardOptions(Options.firstStep, TEMPERATURE, trials, ATIME_OUT) hybridization(o, strand_seq, trials) setSaltGao2006(o) return o
def getOptions(trials): o = standardOptions(Literals.first_step, TEMPERATURE, trials, ATIME_OUT) hybridization(o, strand_seq, trials) setSaltGao2006(o) o.DNA23Metropolis() return o
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
def getOptions(trials): o = standardOptions(Options.firstStep, TEMPERATURE, trials, ATIME_OUT) hybridization(o, strand_seq, trials) setSaltGao2006(o) # setArrheniusConstantsDNA23(o) setArrParams(o, 96) return o
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
def doSims(strandSeq, numTraj=2): o1 = standardOptions() o1.simulation_mode = Options.trajectory o1.num_simulations = numTraj o1.output_interval = 1 o1.simulation_time = ATIME_OUT SHORT_SEQ1 = "ACCTCT" SHORT_SEQ2 = "TCTTTA" SHORT_SEQ7 = "ACATCC" SHORT_SEQ5 = "TACTAC" SHORT_SEQ6 = "ACCATT" SHORT_SEQT = "CTCT" LONG_SEQ2 = "CCAAACAAAACCTAT" LONG_SEQ5 = "AACCACCAAACTTAT" LONG_SEQ6 = "CCTAACACAATCACT" # some ive made up, but these shouldn't make much difference LONG_SEQ7 = "CCACAAAACAAAACT" LONG_SEQ1 = "CATCCATTCAACTAT" LONG_SEQT = SHORT_SEQT CL_LONG_S18 = "TCTTCTAACAT" CL_LONG_S5 = "CCACCAAACTT" CL_LONG_S6 = "TAACACAATCA" CL_LONG_S29 = "CCAATACTCCT" CL_LONG_S53 = "TATCTAATCTC" CL_LONG_S44 = "AAACTCTCTCT" CL_LONG_SEQT = "TCT" CLAMP_SEQ = "CA" SHORT_GATE_A_SEQ = [SHORT_SEQ1, SHORT_SEQ2, SHORT_SEQ5, SHORT_SEQ7, SHORT_SEQT] SHORT_GATE_B_SEQ = [SHORT_SEQ2, SHORT_SEQ5, SHORT_SEQ6, SHORT_SEQ7, SHORT_SEQT] LONG_GATE_A_SEQ = [LONG_SEQ1, LONG_SEQ2, LONG_SEQ5, LONG_SEQ7, LONG_SEQT] LONG_GATE_B_SEQ = [LONG_SEQ2, LONG_SEQ5, LONG_SEQ6, LONG_SEQ7, LONG_SEQT] CL_LONG_GATE_A_SEQ = [CL_LONG_S44, CL_LONG_S18, CL_LONG_S5, CL_LONG_S29, CL_LONG_SEQT, CLAMP_SEQ] CL_LONG_GATE_B_SEQ = [CL_LONG_S53, CL_LONG_S5, CL_LONG_S6, CL_LONG_S29, CL_LONG_SEQT, CLAMP_SEQ] clamped_gate_output_leak(o1, CL_LONG_GATE_A_SEQ, 10) o1.initial_seed = 1777 s = SimSystem(o1) s.start() printTrajectory(o1)
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
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
def genOptions(trialsIn, experiment_type=NORMAL): # NB: Time out MUST be a float stdOptions = standardOptions( Options.firstStep, expTemp(experiment_type), trials=trialsIn, timeOut=0.00001) stdOptions.temperature = expTemp(experiment_type) stdOptions.sodium = expSodium(experiment_type) stdOptions.magnesium = expMagnesium(experiment_type) stdOptions.DNA23Metropolis() #setArrheniusConstantsDNA23(stdOptions) changeComplex(stdOptions, experiment_type) return stdOptions
def getOptions(trials, material, temperature=25.0, sodium=1.0): o = standardOptions(Literals.first_step, 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
def genOptions(trialsIn, gateA, sel, supersample=25, gateB=None): stdOptions = standardOptions(Options.firstStep, tempIn=45.0, trials=trialsIn, timeOut=ATIME_OUT) if gateB == None: getExperiment(sel)(stdOptions, gateA, trialsIn, supersample) else: getExperiment(sel)(stdOptions, gateA, gateB, trialsIn, supersample) stdOptions.DNA23Metropolis() return stdOptions
def simulationRickettsia(trialsIn): stdOptions = standardOptions(simMode=Literals.first_passage_time, trials=trialsIn) stdOptions.simulation_time = A_TIME_OUT stdOptions.DNA23Metropolis() stdOptions.temperature = 25.0 stdOptions.magnesium = 0.0125 stdOptions.sodium = 0.1 dom_a = Domain(sequence="ATTCAA", name="a") # length 6 dom_b = Domain(sequence="GCGACACCGTGGACGTGC", name="b") # length 18 dom_c = Domain(sequence="ACCCAC", name="c") # length 6 dom_x = Domain(sequence="GGT", name="x") # length 3 dom_y = Domain(sequence="AAC", name="y") # length 3 strand_H1 = Strand(domains=[dom_a, dom_b, dom_c, dom_b.C, dom_x.C]) strand_H2 = Strand(domains=[dom_y.C, dom_b.C, dom_a.C, dom_b, dom_c.C]) strand_A = Strand(domains=[dom_b.C, dom_a.C]) strand_B = Strand(domains=[dom_x, dom_b, dom_y]) strand_R = Strand(domains=[dom_x, dom_b, dom_y]) H1 = Complex(strands=[strand_H1], structure=".(.).", name="H1") H2 = Complex(strands=[strand_H2], structure=".(.).", name="H2") # state1 = Complex(strands=[strand_H1, strand_R, strand_A], structure="((.)*+*(.+))") # domain x does not have to be bound state2 = Complex(strands=[strand_H1, strand_R, strand_A], structure="((.((+)).+))", name="state2") state3 = Complex(strands=[strand_H1, strand_R, strand_H2, strand_A], structure="(((((+))(+)(.))+))") # state4 = Complex(strands=[strand_H1, strand_R, strand_H2, strand_A], structure="(((((+)((+)).))+))", name = "state4") state5 = Complex(strands=[strand_H1, strand_R, strand_H2, strand_A], structure="((((.+.((+)).))+))", name="state5") # state6 = Complex(strands=[strand_H1, strand_H1, strand_R, strand_H2, strand_A], structure="((((.+((.)*+*((+)))))+))") # domain x does not have to be bound # state6 = Complex(strands=[strand_H1, strand_H1, strand_R, strand_H2, strand_A], structure="((((.+((.).+.((+)))))+))", name = "state6") # state7 = Complex(strands=[strand_H1, strand_H1, strand_R, strand_H2, strand_A], structure="((((.+((.((+))*+*))))+))", name = "state7") stopFailure = StopCondition(Literals.failure, [(state2, Literals.dissoc_macrostate, 0)]) stopSuccess = StopCondition(Literals.success, [(state5, Literals.loose_macrostate, 6)]) stdOptions.start_state = [state3] stdOptions.stop_conditions = [stopSuccess, stopFailure] stdOptions.join_concentration = 0.001 return stdOptions
def doExperiment(trials): # complexes seqOutput = "CTACTTTCACCCTACGTCTCCAACTAACTTACGG" seqSignal = "CCACATACATCATATTCCCTCATTCAATACCCTACG" seqBackbone = "TGGAGACGTAGGGTATTGAATGAGGGCCGTAAGTT" # output + signal + backbone complex_dotparen = "." * 10 + "(" * (len(seqOutput) - 10) complex_dotparen += "+" + "." * 16 + "(" * (len(seqSignal) - 16) complex_dotparen += "+" + "." * 6 + ")" * (len(seqBackbone) - 6) myGate = makeComplex([seqOutput, seqSignal, seqBackbone], complex_dotparen) seqFuel = "CCTACGTCTCCAACTAACTTACGGCCCTCATTCAATACCCTACG" myFuel = makeComplex([seqFuel], "." * len(seqFuel)) myLeakedSignal = makeComplex([seqSignal], "." * len(seqSignal)) for x in [myGate, myFuel]: setBoltzmann(x, trials, supersample=10) # stopping states # the failed state is when the fuel releases again # the success state is when the leaked signal is observed. # we use dissocMacrostate - this only checks the presence of strands in the complex, and # does not depend on dotparens structure. successStopping = StopCondition( Options.STR_SUCCESS, [(myLeakedSignal, Options.dissocMacrostate, 0)]) failedStopping = StopCondition(Options.STR_FAILURE, [(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
def getOptions( trials, settings ): #start_complex_top, start_complex_bot, success_stop_condition, failed_stop_condition options = standardOptions("First Step", TEMPERATURE, settings.trials, ATIME_OUT) hybridization(options, settings.mySeq, settings.trials) setSaltGao2006(options) options.output_interval = 1 # print every state, ever return options
def doSims(strandSeq, numTraj=2): o1 = standardOptions() o1.num_simulations = numTraj o1.output_interval = 1 hybridization(o1, strandSeq) o1.initial_seed = 1777 s = SimSystem(o1) s.start() printTrajectory(o1)
def simulationHairpin(trialsIn, reverse): stdOptions = standardOptions(simMode=Literals.trajectory, trials=trialsIn) # stdOptions.JSDefault() stdOptions.DNA23Metropolis() stdOptions.simulation_time = A_TIME_OUT stdOptions.temperature = 50.0 if reverse: hairpinopening(stdOptions, HAIRPIN_STEM, HAIRPIN_LOOP) else: hairpinclosing(stdOptions, HAIRPIN_STEM, HAIRPIN_LOOP) return stdOptions
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
def genOptions(trialsIn, select): stdOptions = standardOptions(Options.firstStep, tempIn=23.0, trials=trialsIn, timeOut=0.1) stdOptions.sodium = expSodium(select) stdOptions.magnesium = expMagnesium(select) stdOptions.join_concentration = 5e-9 # set the DNA23 parameters setArrheniusConstantsDNA23(stdOptions) machinek2014(stdOptions, select, trialsIn) return stdOptions
def genOptions(trialsIn, selector): stdOptions = standardOptions(Literals.first_step, tempIn=23.0, trials=trialsIn, timeOut=100.0) stdOptions.sodium = 0.05 stdOptions.magnesium = 12.5e-3 stdOptions.join_concentration = 5e-9 stdOptions.simulation_time = 5.0 stdOptions.DNA23Metropolis() ravan(stdOptions, trialsIn, selector) return stdOptions
def getOptions(arguments): o = standardOptions() o.simulation_mode = Literals.trajectory o.num_simulations = 80 o.temperature = 30.0 o.simulation_time = 0.0000001 endComplex = arguments[0] stopSuccess = StopCondition(Literals.success, [(endComplex, Literals.exact_macrostate, 0)]) o.stop_conditions = [stopSuccess] return o