def placeMismatchInOutput(self, position): mismatched_strands = self.placeMismatchInDomain( position, self.output_domain.sequence) self.output_strand = mismatched_strands[0] + \ self.toehold_domain + self.base_domain self.gate_output_complex = Complex( strands=[self.base_strand, self.output_strand], structure=".((+...))") self.output_complex = Complex(strands=[self.output_strand], structure='.' * len(self.output_strand.sequence))
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 ravan(options, trialsIn, selector): # we only allow first step mode at this point. if PENG_YIN == True: RAVAN_H1 = "GCTTGAGATGTTAGGGAGTAGTGCTCCAATCACAACGCACTACTCCCTAACATC" RAVAN_H2 = "AGGGAGTAGTGCGTTGTGATTGGAAACATCTCAAGCTCCAATCACAACGCACTA" RAVAN_H3 = "GTTGTGATTGGAGCTTGAGATGTTGCACTACTCCCTAACATCTCAAGCTCCAAT" RAVAN_I = "GCACTACTCCCTAACATCTCAAGC" strand_H1 = Strand(name="H1", sequence=RAVAN_H1) strand_H2 = Strand(name="H2", sequence=RAVAN_H2) strand_H3 = Strand(name="H3", sequence=RAVAN_H3) strand_I = Strand(name="I", sequence=RAVAN_I) dotparen_H1 = "." * len(RAVAN_H1) dotparen_H2 = "." * len(RAVAN_H2) dotparen_H3 = "." * len(RAVAN_H3) dotparen_I = "." * len(RAVAN_I) """ No special secondary structure, just a hack to make a connected complex composed of the correct set of strands """ dotparen_I_H1 = '(' + ("." * (len(RAVAN_I) - 1)) + "+" + ')' + ("." * (len(RAVAN_H1) - 1)) dotparen_I_H1_H2 = '(' + ("." * (len(RAVAN_I) - 1)) + "+" + ')' + ("." * (len(RAVAN_H1) - 2)) + "(" + "+" + ")" + ("." * (len(RAVAN_H2) - 1)) dotparen_H1_H2_H3 = '(' + ("." * (len(RAVAN_H1) - 1)) + "+" + ')' + ("." * (len(RAVAN_H2) - 2)) + '(' + "+" + ')' + ("." * (len(RAVAN_H3) - 1)) if selector == 0: target_complex = Complex(strands=[strand_H1], structure=dotparen_H1) complex_trigger = Complex(strands=[strand_I], structure=dotparen_I) success_complex = Complex(strands=[strand_I, strand_H1], structure=dotparen_I_H1) if selector == 1: target_complex = Complex(strands=[strand_I, strand_H1], structure=dotparen_I_H1) complex_trigger = Complex(strands=[strand_H2], structure=dotparen_H2) success_complex = Complex(strands=[strand_I, strand_H1, strand_H2], structure=dotparen_I_H1_H2) if selector == 2: target_complex = Complex(strands=[strand_I, strand_H1, strand_H2], structure=dotparen_I_H1_H2) complex_trigger = Complex(strands=[strand_H3], structure=dotparen_H3) success_complex = Complex(strands=[strand_H1, strand_H2, strand_H3], structure=dotparen_H1_H2_H3) setBoltzmann(complex_trigger, trialsIn) setBoltzmann(target_complex, trialsIn) stopSuccess = StopCondition(Literals.success, [(success_complex, Literals.dissoc_macrostate, 0)]) stopFailed = StopCondition(Literals.failure, [(complex_trigger, Literals.dissoc_macrostate, 0)]) # actually set the intial and stopping states options.start_state = [complex_trigger, target_complex] options.stop_conditions = [stopSuccess, stopFailed]
def _redefineMismatchedComplexes(self): # Redefine complexes # print "Warning: one of these complexes will be invalid! Must replace" self.threshold_free_waste_complex = Complex( strands=[self.base_dom_strand], structure='.' * len(self.base_dom_strand.sequence)) self.gate_output_complex = Complex( strands=[self.base_strand, self.output_strand], structure=".((((+.))))") self.gate_fuel_complex = Complex( strands=[self.base_strand, self.fuel_strand], structure=".((((+.))))") self.gate_input_complex = Complex( strands=[self.base_strand, self.input_strand], structure="((((.+)))).") self.threshold_complex = Complex( strands=[self.threshold_base, self.base_dom_strand], structure="..(((+)))") self.input_complex = Complex(strands=[self.input_strand], structure='.' * len(self.input_strand.sequence)) self.fuel_complex = Complex(strands=[self.fuel_strand], structure='.' * len(self.fuel_strand.sequence)) self.output_complex = Complex(strands=[self.output_strand], structure='.' * len(self.output_strand.sequence))
def placeMismatchInInputWire(self, position): mismatched_strands = self.placeMismatchInDomain( position, self.base_domain.sequence) # So now the input strand has a 'C' in the designated position recog_len = len(self.base_domain.sequence) # Place a mismatch in the input wire self.input_strand = mismatched_strands[0] + \ self.toehold_domain + self.input_domain # make the new base strand have a 'C-C' mismatch self.base_strand = self.toehold_domain.C + \ mismatched_strands[1] + self.toehold_domain.C # we want to keep our the gate self.base_domain = mismatched_strands[1].C # Update the relevant strands and complexes to take the mismatch into account # Use the convention of always adding 5' to 3' # Setup stuff for this type of gate self.fuel_strand = self.fuel_domain + self.toehold_domain + self.base_domain self.output_strand = self.output_domain + \ self.toehold_domain + self.base_domain # We do want the threshold to still act well!! self.threshold_base = self.input_partial.C + self.toehold_domain.C + \ mismatched_strands[0].C self.base_dom_strand = Strand(name="base strand", domains=[mismatched_strands[0]]) self._redefineMismatchedComplexes() self.gate_input_complex = Complex( strands=[self.base_strand, self.input_strand], structure="((.(.+).)).")
def placeMismatchInFuelWireBase(self, position): # alter the base domain, as per usual mismatched_strands = self.placeMismatchInDomain( position, self.base_domain.sequence) # So now the input strand has a 'C' in the designated position # Get the standard recognition domain length recog_len = len(self.base_domain.sequence) self.fuel_strand = self.fuel_domain + \ self.toehold_domain + mismatched_strands[0] # make the new base strand have a 'C-C' mismatch with the fuel self.base_strand = self.toehold_domain.C + \ mismatched_strands[1] + self.toehold_domain.C # we want to keep our the gate - as above, the complement for the prime in most places! self.base_domain = mismatched_strands[1].C # Update the relevant strands and complexes to take the mismatch into account # Use the convention of always adding 5' to 3' # Setup stuff for this type of gate self.input_strand = self.base_domain + self.toehold_domain + self.input_domain self.output_strand = self.output_domain + \ self.toehold_domain + self.base_domain # We do want the threshold to still act well!! self.threshold_base = self.input_partial.C + self.toehold_domain.C + \ mismatched_strands[0].C self.base_dom_strand = Strand(name="base strand", domains=[mismatched_strands[0]]) self._redefineMismatchedComplexes() self.gate_fuel_complex = Complex( strands=[self.base_strand, self.fuel_strand], structure=".(.((+.)).)")
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 first_step_simulation(strand_seq, trials, T=25, material="DNA"): print ("Running %i first step mode simulations for %s (with Boltzmann sampling)..." % (trials, 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.unimolecular_scaling = 5.0e6; o.bimolecular_scaling = 1.4e6; return o myOptions = getOptions(trials,material, duplex_complex, invader_complex, success_stop_condition, failed_stop_condition) s = SimSystem(myOptions) s.start() print "debug_mac2 finished running."
def create_options(): print "creating options..." d1 = Domain(name="d1", sequence="GTTGGTTTGTGTTTGGTGGG") s1 = Strand(name="s1", domains=[d1]) c1 = Complex(name="c1", strands=[s1], structure=".") c2 = Complex(name="c2", strands=[s1.C], structure=".") c3 = Complex(name="c3", strands=[s1, s1.C], structure="(+)") sc_rev = StopCondition("REVERSE", [(c1, 2, 0), (c2, 2, 0)]) sc_for = StopCondition("END", [(c3, 4, 6)]) o = Options(simulation_mode = 'First Step', num_simulations = 100, simulation_time = 0.5, start_state = [RestingState("1", [c1]), RestingState("2", [c2])], stop_conditions = [sc_rev, sc_for]) #o.initial_seed = random.SystemRandom().randrange(-2147483648, 2147483647) print "finished options. creating simsystem..." #print o.interface return o
def create_test8(): toehold_seq = "CTGC" domain_seq = "CATGCTACAG" # build complexes with domain-level information toehold = Domain(name="toehold", sequence=toehold_seq, length=6) branch_migration = Domain(name="branch_migration", sequence=domain_seq, seq_length=25) dangle = Domain(name="branch_migration", sequence="T", seq_length=1) incoming = toehold + branch_migration.C + toehold.C start_complex = Complex(strands=[incoming], structure="(.)") stop_complex = Complex(strands=[incoming], structure="...") return createOptions(start_complex, stop_complex, "First Passage Time")
def create_test0(): toehold_seq = "CCCC" domain_seq = "CATTAAC" # build complexes with domain-level information toehold = Domain(name="toehold", sequence=toehold_seq, length=4) branch_migration = Domain(name="branch_migration", sequence=domain_seq, seq_length=7) incoming = branch_migration.C + toehold.C substrate = toehold + branch_migration start_complex = Complex(strands=[incoming, substrate], structure="((+))") stop_complex = Complex(strands=[incoming, substrate], structure="..+..") return createOptions(start_complex, stop_complex, "First Passage Time")
def create_test3(): strand_seq = "CTGA" num_traj = 10 # Essentially, creates the options object and prepares to simulate the hybridization of the strand and its complement. onedomain = Domain(name="itall", sequence=strand_seq) top = Strand(name="top", domains=[onedomain]) bot = top.C # Note that the structure is specified to be single stranded, but this will be over-ridden when Boltzmann sampling is turned on. start_complex_top = Complex(strands=[top], structure=".") start_complex_bot = Complex(strands=[bot], structure=".") start_complex_top.boltzmann_count = num_traj start_complex_bot.boltzmann_count = num_traj start_complex_top.boltzmann_sample = True start_complex_bot.boltzmann_sample = True # Turns Boltzmann sampling on for this complex and also does sampling more efficiently by sampling 'num_traj' states. # Stop when the exact full duplex is achieved. (No breathing!) success_complex = Complex(strands=[top, bot], structure="(+)") success_stop_condition = StopCondition( "SUCCESS", [(success_complex, Literals.exact_macrostate, 0)]) # Declare the simulation unproductive if the strands become single-stranded again. failed_complex = Complex(strands=[top], structure=".") failed_stop_condition = StopCondition( "FAILURE", [(failed_complex, Literals.dissoc_macrostate, 0)]) o = Options(simulation_mode="First Step", parameter_type="Nupack", substrate_type="DNA", rate_method="Metropolis", num_simulations=num_traj, simulation_time=1.0, dangles="Some", temperature=273.15 + 25.0, rate_scaling="Calibrated", useArrRates=True, verbosity=0) o.start_state = [start_complex_top, start_complex_bot] o.stop_conditions = [success_stop_condition, failed_stop_condition] return o
def __init__(self, input_sequence, base_sequence, output_sequence, fuel_sequence, toehold_sequence): count_str = str(NormalSeesawGate.Gate_Count) self.input_domain = Domain(name="input_domain_" + count_str, sequence=input_sequence) self.base_domain = Domain(name="base_domain_" + count_str, sequence=base_sequence) self.output_domain = Domain(name="output_domain_" + count_str, sequence=output_sequence) self.fuel_domain = Domain(name="fuel_domain_" + count_str, sequence=fuel_sequence) self.toehold_domain = Domain(name="toehold_domain_" + count_str, sequence=toehold_sequence) # Use the convention of always adding 5' to 3' # Setup stuff for this type of gate self.input_strand = self.base_domain + self.toehold_domain + self.input_domain self.fuel_strand = self.fuel_domain + self.toehold_domain + self.base_domain self.base_strand = self.toehold_domain.C + \ self.base_domain.C + self.toehold_domain.C self.output_strand = self.output_domain + \ self.toehold_domain + self.base_domain self.input_partial = Domain( name="partial", sequence=self.input_domain.sequence[:SEESAW_DELTA]) self.threshold_base = self.input_partial.C + self.toehold_domain.C + \ self.base_domain.C self.base_dom_strand = Strand(name="base strand", domains=[self.base_domain]) self.threshold_free_waste_complex = Complex( strands=[self.base_dom_strand], structure='.' * len(self.base_dom_strand.sequence)) self.gate_output_complex = Complex( strands=[self.base_strand, self.output_strand], structure=".((+.))") self.gate_fuel_complex = Complex( strands=[self.base_strand, self.fuel_strand], structure=".((+.))") self.gate_input_complex = Complex( strands=[self.base_strand, self.input_strand], structure="((.+)).") self.threshold_complex = Complex( strands=[self.threshold_base, self.base_dom_strand], structure="..(+)") self.input_complex = Complex(strands=[self.input_strand], structure='.' * len(self.input_strand.sequence)) self.fuel_complex = Complex(strands=[self.fuel_strand], structure='.' * len(self.fuel_strand.sequence)) self.output_complex = Complex(strands=[self.output_strand], structure='.' * len(self.output_strand.sequence)) NormalSeesawGate.Gate_Count += 1
def create_test6B(): toehold_seq = "CCC" toehold_seq2 = "TTT" domain_seq = "AA" # build complexes with domain-level information toehold = Domain(name="toehold", sequence=toehold_seq, length=3) toehold2 = Domain(name="toehold", sequence=toehold_seq2, length=3) branch_migration = Domain(name="branch_migration", sequence=domain_seq, seq_length=2) incoming = toehold2.C + branch_migration.C + toehold.C substrate = toehold + branch_migration + toehold2 start_complex = Complex(strands=[incoming, substrate], structure="(.(+).)") stop_complex = Complex(strands=[incoming, substrate], structure="...+...") return createOptions(start_complex, stop_complex, "First Passage Time")
def hairpinopening(options, stemSeq, loopSeq, myTrials=0): # Using domain representation makes it easier to write secondary structures. stemdomain1 = Domain(name="stemdomain1", sequence=stemSeq) loopdomain = Domain(name="loopdomain", sequence=loopSeq) stemdomain2 = stemdomain1.C strand = Strand(name="top", domains=[stemdomain1, loopdomain, stemdomain2]) start_complex = Complex(strands=[strand], structure="(.)") success_complex = Complex(strands=[strand], structure="...") # N.B.: myTrials input signature is considered "default", # but in no circumstance will we enable Boltzmann sampling # Stop when the exact full duplex is achieved. stopSuccess = StopCondition( Literals.success, [(success_complex, Literals.exact_macrostate, 0)]) options.start_state = [start_complex] options.stop_conditions = [stopSuccess]
def create_setup(trials, toehold_seq, toehold_seq2, domain_seq): # build complexes with domain-level information toehold = Domain(name="toehold", sequence=toehold_seq, length=len(toehold_seq2)) toehold_2 = Domain(name="toehold", sequence=toehold_seq2, length=len(toehold_seq2)) branch_migration = Domain(name="branch_migration", sequence=domain_seq, seq_length=len(domain_seq)) incoming = branch_migration.C + toehold.C substrate = toehold + branch_migration + toehold_2 incumbent = Strand(name="incumbent", domains=[toehold_2.C, branch_migration.C]) # Note that "+" is used to indicate strand breaks. # So the initial structures represent the incoming strand bound by its toehold, # and we'll see that either it completes strand displacement, or it dissociates. start_complex = Complex(strands=[incoming, substrate, incumbent], structure=".(+)((+))") stop_complex = Complex(strands=[incoming, substrate, incumbent], structure="((+))(+).") full_sc = StopCondition("CLOSED", [(stop_complex, Literals.exact_macrostate, 0)]) o1 = Options(simulation_mode="First Passage Time", parameter_type="Nupack", substrate_type="DNA", temperature=273.15 + 25.0, num_simulations=trials, simulation_time=0.0001, rate_scaling='Calibrated', verbosity=0, start_state=[start_complex], stop_conditions=[full_sc]) return o1
def dissociation(options, mySeq, myTrials=0): # Using domain representation makes it easier to write secondary structures. onedomain = Domain(name="itall", sequence=mySeq) top = Strand(name="top", domains=[onedomain]) bot = top.C # Note that the structure is specified to be single stranded, but this will be over-ridden when Boltzmann sampling is turned on. duplex = Complex(strands=[top, bot], structure="(+)") # Turns Boltzmann sampling on for this complex and also does sampling more efficiently by sampling 'trials' states. if (myTrials > 0): setBoltzmann(duplex, myTrials) # Stop when the strands fall apart. successComplex = Complex(strands=[top], structure=".") stopSuccess = StopCondition( Options.STR_SUCCESS, [(successComplex, Options.dissocMacrostate, 0)]) options.start_state = [duplex] options.stop_conditions = [stopSuccess]
def create_test4(): toehold_t = "CTGC" toehold_dd = "CATATC" domain_R = "CATTAAC" # build complexes with domain-level information toehold = Domain(name="toehold", sequence=toehold_t, length=6) toehold_2 = Domain(name="toehold", sequence=toehold_dd, length=6) branch_migration = Domain(name="branch_migration", sequence=domain_R, seq_length=7) incoming = branch_migration.C + toehold.C substrate = toehold + branch_migration # Note that "+" is used to indicate strand breaks. # So the initial structures represent the incoming strand bound by its toehold, # and we'll see that either it completes strand displacement, or it dissociates. start_complex = Complex(strands=[incoming, substrate], structure=".(+).") stop_complex = Complex(strands=[incoming, substrate], structure="..+..") full_sc = StopCondition("CLOSED", [(stop_complex, msUtil.Dissoc_Macrostate, 2)]) return createOptions(start_complex, stop_complex, "First Passage Time")
def makeComplex(seq, dotparen): strandList = [] for seq in seq: onedomain = Domain(name="domain" + str(makeComplex.counter), sequence=seq) makeComplex.counter += 1 onestrand = Strand(domains=[onedomain]) strandList.append(onestrand) return Complex(strands=strandList, structure=dotparen)
def threewayDisplacement(options, toeholdSeq, domainSeq, doFirstPassage=False, myTrials=0, mySuperSample=1): toeholdDomain = Domain(name="toehold", sequence=toeholdSeq) disDomain = Domain(name="displacement", sequence=domainSeq) topS = Strand(name="top", domains=[disDomain]) invaderS = Strand(name="invader", domains=[disDomain, toeholdDomain]) botS = invaderS.C startComplex = Complex(strands=[topS, botS], structure="(+.)") invaderComplex = Complex(strands=[invaderS], structure="..") successComplex = Complex(strands=[botS, invaderS], structure="((+))") if (myTrials > 0): setBoltzmann(startComplex, myTrials, mySuperSample) setBoltzmann(invaderComplex, myTrials, mySuperSample) # stop when the invasion is complete, or when the invader dissociates stopSuccess = StopCondition( Literals.success, [(successComplex, Literals.dissoc_macrostate, 0)]) # Declare the simulation unproductive if the invader becomes single-stranded again. stopFailed = StopCondition( Literals.failure, [(invaderComplex, Literals.dissoc_macrostate, 0)]) # set the starting and stopping conditions options.start_state = [startComplex, invaderComplex] if doFirstPassage: options.stop_conditions = [stopSuccess] else: options.stop_conditions = [stopFailed, stopSuccess]
def create_test9(): seq0 = "GTGT" seq1 = "T" # build complexes with domain-level information branch = Domain(name="toehold0", sequence=seq0, length=3) toehold = Domain(name="toehold1", sequence=seq1, length=1) ghost = Domain(name="toeholdG", sequence="T", length=1) substrate = toehold + branch left = toehold.C + ghost right = branch.C + ghost # Note that "+" is used to indicate strand breaks. # So the initial structures represent the incoming strand bound by its toehold, # and we'll see that either it completes strand displacement, or it dissociates. start_complex = Complex(strands=[right, left, substrate], structure="(.+(.+))") stop_complex = Complex(strands=[left, right, substrate], structure="..+..+..") return createOptions(start_complex, stop_complex, "First Passage Time")
def hybridization(options, mySeq, myTrials=0, doFirstPassage=False): # Using domain representation makes it easier to write secondary structures. onedomain = Domain(name="itall", sequence=mySeq) top = Strand(name="top", domains=[onedomain]) bot = top.C # Note that the structure is specified to be single stranded, but this will be over-ridden when Boltzmann sampling is turned on. startTop = Complex(strands=[top], structure=".") startBot = Complex(strands=[bot], structure=".") # Turns Boltzmann sampling on for this complex and also does sampling more efficiently by sampling 'trials' states. if (myTrials > 0): setBoltzmann(startTop, myTrials) setBoltzmann(startBot, myTrials) # Stop when the exact full duplex is achieved. success_complex = Complex(strands=[top, bot], structure="(+)") stopSuccess = StopCondition( Options.STR_SUCCESS, [(success_complex, Options.exactMacrostate, 0)]) # Declare the simulation unproductive if the strands become single-stranded again. failed_complex = Complex(strands=[top], structure=".") stopFailed = StopCondition(Options.STR_FAILURE, [(failed_complex, Options.dissocMacrostate, 0)]) options.start_state = [startTop, startBot] # Point the options to the right objects if not doFirstPassage: options.stop_conditions = [stopSuccess, stopFailed] else: options.stop_conditions = [stopSuccess]
def makeComplex(sequences, dotparen, ids=None): strandList = [] for i in range(len(sequences)): onedomain = Domain(name="domain" + str(makeComplex.counter), sequence=sequences[i]) makeComplex.counter += 1 onestrand = Strand(domains=[onedomain]) strandList.append(onestrand) if not ids == None: onestrand.id = ids[i] onestrand.name = "a_" + str(ids[i]) return Complex(strands=strandList, structure=dotparen)
def helper_create_Multistrand_options(self, sequence, time, count): """ helper """ s1 = Strand("test_strand1", str(sequence), None) c1 = Complex(1, "start", [s1], "." * len(sequence)) o = Options() o.simulation_mode = Constants.SIMULATION_MODE['Python Module'] o.use_stop_states = False o.num_simulations = count o.simulation_time = time o.start_state = [c1] o.dangles = Constants.DANGLES['All'] o.rate_method = Constants.RATEMETHOD['Kawasaki'] o.bimolecular_scaling = 1.0 o.unimolecular_scaling = 1.0 o.temperature = 37.0 o.boltzmann_sample = False return o
def doSims(strandSeq, numTraj=2): curr = time.time() o1 = standardOptions(tempIn=36.95) o1.num_simulations = numTraj o1.output_time = 0.0004 # 0.2 ms output o1.simulation_time = 0.52 # 10 ms 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="itall", sequence="GGAACCGUCUCCCUCUGCCAAAAGGUAGAGGGAGAUGGAGCAUCUCUCUCUACGAAGCAGAGAGAGACGAAGG") # onedomain = Domain(name="itall", sequence="GGAACCGTCTCCCTCTGCCAAAAGGTAGAGGGAGATGGAGCATCTCTCTCTACGAAGCAGAGAGAGACGAAGG") # onedomain = Domain(name="itall", sequence="GGAACCGTCTCCCTCTGCCAAAAGGTAGAGGGAGATGGAGCATCTCTCTCTACGAAGCAGAGAGAGACGAAGGGGAACCGTCTCCCTCTGCCAAAAGGTAGAGGGAGATGGAGCATCTCTCTCTACGAAGCAGAGAGAGACGAAGG") # onedomain = Domain(name="itall", sequence="ATTCCGGTTGATCCTGCCGGAGGTCATTGCTATTGGGGTCCGATTTAGCCATGCTAGTTGCACGAGTTCATACTCGTGGCGAAAAGCTCAGTAACACGTGGCCAAACTACCCTACAGAGAACGATAACCTCGGGAAACTGAGGCTAATAGTTCATACGGGAGTCATGCTGGAATGCCGACTCCCCGAAACGCTCAGGCGCTGTAGGATGTGGCTGCGGCCGATTAGGTAGACGGTGGGGTAACGGCCCACCGTGCCGATAATCGGTACGGGTTGTGAGAGCAAGAGCCCGGAGACGGAATCTGAGACAAGATTCCGGGCCCTACGGGGCGCAGCAGGCGCGAAACCTTTACACTGCACGCAAGTGCGATAAGGGGACCCCAAGTGCGAGGGCATATAGTCCTCGCTTTTCTCGACCGTAAGGCGGTCGAGGAATAAGAGCTGGGCAAGACCGGTGCCAGCCGCCGCGGTAATACCGGCAGCTCAAGTGATGACCGATATTATTGGGCCTAAAGCGTCCGTAGCCGGCCACGAAGGTTCATCGGGAAATCCGCCAGCTCAACTGGCGGGCGTCCGGTGAAAACCACGTGGCTTGGGACCGGAAGGCTCGAGGGGTACGTCCGGGGTAGGAGTGAAATCCCGTAATCCTGGACGGACCACCGATGGCGAAAGCACCTCGAGAAGACGGATCCGACGGTGAGGGACGAAAGCTAGGGTCTCGAACCGGATTAGATACCCGGGTAGTCCTAGCTGTAAACGATGCTCGCTAGGTGTGACACAGGCTACGAGCCTGTGTTGTGCCGTAGGGAAGCCGAGAAGCGAGCCGCCTGGGAAGTACGTCCGCAAGGATGAAACTTAAAGGAATTGGCGGGGGAGCACTACAACCGGAGGAGCCTGCGGTTTAATTGGACTCAACGCCGGACATCTCACCAGCTCCGACTACAGTGATGACGATCAGGTTGATGACCTTATCACGACGCTGTAGAGAGGAGGTGCATGGCCGCCGTCAGCTCGTACCGTGAGGCGTCCTGTTAAGTCAGGCAACGAGCGAGACCCGCACTTCTAATTGCCAGCAGCAGTTTCGACTGGCTGGGTACATTAGAAGGACTGCCGCTGCTAAAGCGGAGGAAGGAACGGGCAACGGTAGGTCAGTATGCCCCGAATGAGCTGGGCTACACGCGGGCTACAATGGTCGAGACAATGGGTTGCTATCTCGAAAGAGAACGCTAATCTCCTAAACTCGATCGTAGTTCGGATTGAGGGCTGAAACTCGCCCTCATGAAGCTGGATTCGGTAGTAATCGCATTTCAATAGAGTGCGGTGAATACGTCCCTGCTCCTTGCACACACCGCCCGTCAAAGCACCCGAGTGAGGTCCGGATGAGGCCACCACACGGTGGTCGAATCTGGGCTTCGCAAGGGGGCTTAAGTCGTAACAAGGTAGCCGTAGGGGAATCTGCGGCTGGATCACCTCCTG") # onedomain = Domain(name="itall", sequence="ATTCCGGTTGATCCTGCCGGAGGTCATTGCTATTGGGGTCCGATTTAGCCATGCTAGTTGCACGAGTTCATACTCGTGGCGAAAAGCTCAGTAACACGTGGCCAAACTACCCTACAGAGAACGATAACCTCGGGAAACTGAGGCTAATAGTTCATACGGGAGTCATGCTGGAATGCCGACTCCCCGAAACGCTCAGGCGCTGTAGGATGTGGCTGCGGCCGATTAGGTAGACGGTGGGGTAACGGCCCACCGTGCCGATAATCGGTACGGGTTGTGAGAGCAAGAGCCCGGAGACGGAATCTGAGACAAGATTCCGGGCCCTA") #CGGGGCGCAGCAGGCGCGAAACCTTTACACTGCACGCAAGTGCGATAAGGGGACCCCAAGTGCGAGGGCATATAGTCCTCGCTTTTCTCGACCGTAAGGCGGTCGAGGAATAAGAGCTGGGCAAGACCGGTGCCAGCCGCCGCGGTAATACCGGCAGCTCAAGTGATGACCGATATTATTGGGCCTAAAGCGTCCGTAGCCGGCCACGAAGGTTCATCGGGAAATCCGCCAGCTCAACTGGCGGGCGTCCGGTGAAAACCACGTGGCTTGGGACCGGAAGGCTCGAGGGGTACGTCCGGGGTAGGAGTGAAATCCCGTAATCCTGGACGGACCACCGATGGCGAAAGCACCTCGAGAAGACGGATCCGACGGTGAGGGACGAAAGCTAGGGTCTCGAACCGGATTAGATACCCGGGTAGTCCTAGCTGTAAACGATGCTCGCTAGGTGTGACACAGGCTACGAGCCTGTGTTGTGCCGTAGGGAAGCCGAGAAGCGAGCCGCCTGGGAAGTACGTCCGCAAGGATGAAACTTAAAGGAATTGGCGGGGGAGCACTACAACCGGAGGAGCCTGCGGTTTAATTGGACTCAACGCCGGACATCTCACCAGCTCCGACTACAGTGATGACGATCAGGTTGATGACCTTATCACGACGCTGTAGAGAGGAGGTGCATGGCCGCCGTCAGCTCGTACCGTGAGGCGTCCTGTTAAGTCAGGCAACGAGCGAGACCCGCACTTCTAATTGCCAGCAGCAGTTTCGACTGGCTGGGTACATTAGAAGGACTGCCGCTGCTAAAGCGGAGGAAGGAACGGGCAACGGTAGGTCAGTATGCCCCGAATGAGCTGGGCTACACGCGGGCTACAATGGTCGAGACAATGGGTTGCTATCTCGAAAGAGAACGCTAATCTCCTAAACTCGATCGTAGTTCGGATTGAGGGCTGAAACTCGCCCTCATGAAGCTGGATTCGGTAGTAATCGCATTTCAATAGAGTGCGGTGAATACGTCCCTGCTCCTTGCACACACCGCCCGTCAAAGCACCCGAGTGAGGTCCGGATGAGGCCACCACACGGTGGTCGAATCTGGGCTTCGCAAGGGGGCTTAAGTCGTAACAAGGTAGCCGTAGGGGAATCTGCGGCTGGATCACCTCCTG") onedomain = Domain( name="itall", sequence= "ATTCCGGTTGATCCTGCCGGAGGTCATTGCTATTGGGGTCCGATTTAGCCATGCTAGTTGCACGAGTTCATACTCGTGGCGAAAAGCTCAGTAACACGTGGCCAAACTACCCTACAGAGAACGATAACCTCGGGAAACTGAGGCTAATAGTTCATACGGGAGTCATGCTGGAATGCCGACTCCCCGAAACGCTCAGGCGCTGTAGGATGTGGCTGCGGCCGATTAGGTAGACGGTGGGGTAACGGCCCACCGTGCCGATAATCGGTACGGGTTGTGAGAGCAAGAGCCCGGAGACGGAATCTGAGACAAGATTCCGGGCCCTACGGGGCGCAGCAGGCGCGAAACCTTTACACTGCACGCAAGTGCGATAAGGGGACCCCAAGTGCGAGGGCATATAGTCCTCGCTTTTCTCGACCGTAAGGCGGTCGAGGAATAAGAGCTGGGCAAGACCGGTGCCAGCCGCCGCGGTAATACCGGCAGCTCAAGTGATGA" ) #CCGATATTATTGGGCCTAAAGCGTCCGTAGCCGGCCACGAAGGTTCATCGGGAAATCCGCCAGCTCAACTGGCGGGCGTCCGGTGAAAACCACGTGGCTTGGGACCGGAAGGCTCGAGGGGTACGTCCGGGGTAGGAGTGAAATCCCGTAATCCTGGACGGACCACCGATGGCGAAAGCACCTCGAGAAGACGGATCCGACGGTGAGGGACGAAAGCTAGGGTCTCGAACCGGATTAGATACCCGGGTAGTCCTAGCTGTAAACGATGCTCGCTAGGTGTGACACAGGCTACGAGCCTGTGTTGTGCCGTAGGGAAGCCGAGAAGCGAGCCGCCTGGGAAGTACGTCCGCAAGGATGAAACTTAAAGGAATTGGCGGGGGAGCACTACAACCGGAGGAGCCTGCGGTTTAATTGGACTCAACGCCGGACATCTCACCAGCTCCGACTACAGTGATGACGATCAGGTTGATGACCTTATCACGACGCTGTAGAGAGGAGGTGCATGGCCGCCGTCAGCTCGTACCGTGAGGCGTCCTGTTAAGTCAGGCAACGAGCGAGACCCGCACTTCTAATTGCCAGCAGCAGTTTCGACTGGCTGGGTACATTAGAAGGACTGCCGCTGCTAAAGCGGAGGAAGGAACGGGCAACGGTAGGTCAGTATGCCCCGAATGAGCTGGGCTACACGCGGGCTACAATGGTCGAGACAATGGGTTGCTATCTCGAAAGAGAACGCTAATCTCCTAAACTCGATCGTAGTTCGGATTGAGGGCTGAAACTCGCCCTCATGAAGCTGGATTCGGTAGTAATCGCATTTCAATAGAGTGCGGTGAATACGTCCCTGCTCCTTGCACACACCGCCCGTCAAAGCACCCGAGTGAGGTCCGGATGAGGCCACCACACGGTGGTCGAATCTGGGCTTCGCAAGGGGGCTTAAGTCGTAACAAGGTAGCCGTAGGGGAATCTGCGGCTGGATCACCTCCTG") top = Strand(name="top", domains=[onedomain]) startTop = Complex(strands=[top], structure=".") o1.start_state = [startTop] setArrParams(o1, 92) # o1.initial_seed = 1777+6 s = SimSystem(o1) s.start() printTrajectory(o1) print "Exe time is " + str(time.time() - curr)
def create_setup(seed): # build complexes with domain-level information toehold_seq = "GTGGGT" bm_design_B = "ACCGCACGTCACTCACCTCG" toehold_extra = "TTT" toehold = Domain(name="toehold", sequence=toehold_seq, length=6) branch_migration_B = Domain(name="bm_B", sequence=bm_design_B, seq_length=20) substrate_B = toehold + branch_migration_B incumbent_B = Strand(name="incumbent", domains=[branch_migration_B.C]) incoming_B = substrate_B.C start_complex_B1 = Complex( strands=[incoming_B, substrate_B, incumbent_B], structure= "..(.((.....)).).....((((((+))))))((((((((((((((((((((+))))))))))))))))))))" ) o2 = Options() o2.simulation_mode = 0x0080 # trajectory mode o2.current_seed = 20 o2.initial_seed = seed o2.num_simulations = 1 o2.simulation_time = 0.0001 o2.temperature = 37.0 o2.dangles = 1 o2.start_state = [start_complex_B1] o2.output_interval = 1 o2.JSDefault() return o2
def setup_options(trials, seq, concentration): """ setup_options( seq ) creates an Options object using the sequence passed as a single domain with initially unpaired structure. """ d = Domain(name="initial", sequence=seq, length=len(seq)) s = Strand(domains=[d]) c = Complex(strands=[s], structure=".") o = Options(simulation_mode="Normal", parameter_type="Nupack", substrate_type="DNA", num_sims=trials, sim_time=0.008, start_state=[c]) o.DNA23Metropolis() o.temperature = 310.15 o.join_concentration = concentration return o
def changeComplex(options, expirement_type=NORMAL, trials=500): # Easiest to use full dot paren here # See SI Document for these sequences and lengths! toehold_length = 7 h_length = 15 helper = Strand(name="Helper_AAq", sequence="TTTCCTAATCCCAATCAACACCTTTCCTA") produce_bot = Strand( name="Produce_BOT_CApAq", sequence="GTAAAGACCAGTGGTGTGAAGATAGGAAAGGTGTTGATTGGGATTAGGAAACC") ap = Strand(name="ap", sequence="CATCACTATCAATCATACATGGTTTCCTATCTTCACACCACTGG") aq = Strand(name="aq", sequence="CATCACTATCAATCATACATGGTTTCCTAATCCCAATCAACACC") # Offset of two to account for clamp domains produce_struct = "." * toehold_length + "(" * ( len(produce_bot.sequence) - toehold_length) + "+" + '.' * (toehold_length + h_length - 2) + ')' * ( len(ap.sequence) - toehold_length - h_length + 2) + "+" + '.' * ( toehold_length + h_length) + ')' * (len(ap.sequence) - toehold_length - h_length) if expirement_type == WITHOUT_GG: ap = Strand(name="ap", sequence="CATCACTATCAATCATACATTTTCCTATCTTCACACCACTGG") # bot, aq, ap # Offsets due to a) clamp domains b) two b.p. removal produce_struct = "." * toehold_length + "(" * ( len(produce_bot.sequence) - toehold_length) + "+" + '.' * ( toehold_length + h_length - 2) + ')' * ( len(ap.sequence) - toehold_length - h_length + 4) + "+" + '.' * (toehold_length + h_length - 2) + ')' * ( len(ap.sequence) - toehold_length - h_length + 2) elif expirement_type == WITHOUT_G: ap = Strand(name="ap", sequence="CATCACTATCAATCATACATGTTTCCTATCTTCACACCACTGG") # bot, aq, ap # Offsets due to a) clamp domains b) one b.p. removal produce_struct = "." * toehold_length + "(" * ( len(produce_bot.sequence) - toehold_length) + "+" + '.' * ( toehold_length + h_length - 2) + ')' * ( len(ap.sequence) - toehold_length - h_length + 3) + "+" + '.' * (toehold_length + h_length - 1) + ')' * ( len(ap.sequence) - toehold_length - h_length + 1) elif expirement_type == HELPER_WITHOUT_CC: # only modify helper sequence here - remove the two 3' most 'C'. helper = Strand(name="Helper_AAq", sequence="TTTCCTAATCCCAATCAACACCTTTTA") # No change required elsewhere - we check for the release of strands rather than the complicated # leak complex formed for simplicity. We should really check for ANY free strands here i.e. Ap OR Aq # but it is hard to imagine a mechanism which results in the release of Ap in this simulation produce_complex = Complex(name="produce", strands=[produce_bot, aq, ap], structure=produce_struct) helper_complex = Complex(name="helper", strands=[helper], structure='.' * len(helper.sequence)) leak_complex = Complex(name="leak", strands=[aq], structure='.' * len(aq.sequence)) if trials > 0: setBoltzmann(produce_complex, trials, 75) setBoltzmann(helper_complex, trials, 75) success_stop_cond = StopCondition( Literals.success, [(leak_complex, Options.dissoc_macrostate, 0)]) # the leak has failed if we end up with our initial complexes again. # check if we end up with a free helper complex failure_stop_cond = StopCondition( Literals.failure, [(helper_complex, Options.dissoc_macrostate, 0)]) options.start_state = [produce_complex, helper_complex] options.stop_conditions = [success_stop_cond, failure_stop_cond]
def machinek2014(options, selector, trialsIn): # we only allow first step mode at this point. # these are the sequences we need to build the dot-parens incumbent = "" target = "" invader = "" toeholdSelect = selector / 12 mismatchSelect = selector % 12 positionSelector = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14] mismatchSelect = positionSelector[mismatchSelect] # decide on toehold sequence toeholdSeq = "ATGTGG" # 6 nt toehold option if toeholdSelect == 1: toeholdSeq = "ATGTGGA" # 7 nt toehold option if toeholdSelect == 2: toeholdSeq = "ATGTGGAGGG" # 10 nt toehold option # determine the incumbent, target and invader sequences # FD: copy-pasting supplementary Table 6 directly if mismatchSelect == 0 or mismatchSelect == 2 or mismatchSelect == 12 or mismatchSelect == 14: incumbent = "TGGTGTTTGTGGGTGTGGTGAGTTTGAGGTTGA" target = "CCCTCCACATTCAACCTCAAACTCACC" if mismatchSelect == 0: # perfect invader = "GGTGAGTTTGAGGTTGA" if mismatchSelect == 2: invader = "GGTGAGTTTGAGGTTCA" if mismatchSelect == 12: invader = "GGTGACTTTGAGGTTGA" if mismatchSelect == 14: invader = "GGTCAGTTTGAGGTTGA" if mismatchSelect == 3: incumbent = "TGGTGTTTGTGGGTGTGGTGAGTTTGAGGTGAT" target = "CCCTCCACATATCACCTCAAACTCACC" invader = "GGTGAGTTTGAGGTCAT" if mismatchSelect == 4: incumbent = "TGGTGTTTGTGGGTGTGGTGAGTTTGAGTGAGT" target = "CCCTCCACATACTCACTCAAACTCACC" invader = "GGTGAGTTTGAGTCAGT" if mismatchSelect == 5: incumbent = "TGGTGTTTGTGGGTGTGGTGAGTTTGATGAGGT" target = "CCCTCCACATACCTCATCAAACTCACC" invader = "GGTGAGTTTGATCAGGT" if mismatchSelect == 6: incumbent = "TGGTGTTTGTGGGTGTGGTGAGTTTGTGAAGGT" target = "CCCTCCACATACCTTCACAAACTCACC" invader = "GGTGAGTTTGTCAAGGT" if mismatchSelect == 7: incumbent = "TGGTGTTTGTGGGTGTGGTGAGTTTTGAGAGGT" target = "CCCTCCACATACCTCTCAAAACTCACC" invader = "GGTGAGTTTTCAGAGGT" if mismatchSelect == 8: incumbent = "TGGTGTTTGTGGGTGTGGTGAGTTTGATGAGGT" target = "CCCTCCACATACCTCATCAAACTCACC" invader = "GGTGAGTTTCATGAGGT" if mismatchSelect == 9: incumbent = "TGGTGTTTGTGGGTGTGGTGAGTTGATTGAGGT" target = "CCCTCCACATACCTCAATCAACTCACC" invader = "GGTGAGTTCATTGAGGT" if mismatchSelect == 10: incumbent = "TGGTGTTTGTGGGTGTGGTGAGTGATTTGAGGT" target = "CCCTCCACATACCTCAAATCACTCACC" invader = "GGTGAGTCATTTGAGGT" invader = invader + toeholdSeq # set up the actual complexes strandIncumbent = Strand(name="incumbent", sequence=incumbent) strandTarget = Strand(name="target", sequence=target) strandInvader = Strand(name="invader", sequence=invader) intialDotParen = '.' * 16 + '(' * 17 + "+" + '.' * 10 + ')' * 17 intialInvaderDotParen = '.' * len(invader) successDotParen = '.' * 33 initialComplex = Complex(strands=[strandIncumbent, strandTarget], structure=intialDotParen) initialInvader = Complex(strands=[strandInvader], structure=intialInvaderDotParen) successComplex = Complex(strands=[strandIncumbent], structure=successDotParen) # Turns Boltzmann sampling on for this complex and also does sampling more efficiently by sampling 'trials' states. if (trialsIn > 0): setBoltzmann(initialComplex, trialsIn) setBoltzmann(initialInvader, trialsIn) initialComplex.boltzmann_supersample = 25 initialInvader.boltzmann_supersample = 25 stopSuccess = StopCondition( Options.STR_SUCCESS, [(successComplex, Options.dissocMacrostate, 0)]) stopFailed = StopCondition(Options.STR_FAILURE, [(initialComplex, Options.dissocMacrostate, 0)]) # actually set the intial and stopping states options.start_state = [initialComplex, initialInvader] options.stop_conditions = [stopSuccess, stopFailed]
def __init__(self, input_sequence, base_sequence, output_sequence, fuel_sequence, toehold_sequence, clamp_sequence="CG"): count_str = str(ClampedSeesawGate.Gate_Count) + '_Cl ' self.input_domain = Domain(name="input_domain_" + count_str, sequence=input_sequence) self.base_domain = Domain(name="base_domain_" + count_str, sequence=base_sequence) self.output_domain = Domain(name="output_domain_" + count_str, sequence=output_sequence) self.fuel_domain = Domain(name="fuel_domain_" + count_str, sequence=fuel_sequence) self.toehold_domain = Domain(name="toehold_domain_" + count_str, sequence=toehold_sequence) self.clamp_domain = Domain(name="clamp_domain_" + count_str, sequence=clamp_sequence) # Use the convention of always adding 5' to 3' # Setup stuff for this type of gate # Clamp domain setup - add clamp domains either side of each recognition domain self.input_strand = self.clamp_domain + self.base_domain + self.clamp_domain + \ self.toehold_domain + self.clamp_domain + self.input_domain + self.clamp_domain self.fuel_strand = self.clamp_domain + self.fuel_domain + self.clamp_domain + \ self.toehold_domain + self.clamp_domain + self.base_domain + self.clamp_domain self.base_strand = self.clamp_domain.C + self.toehold_domain.C + self.clamp_domain.C + \ self.base_domain.C + self.clamp_domain.C + \ self.toehold_domain.C + self.clamp_domain.C self.output_strand = self.clamp_domain + self.output_domain + self.clamp_domain + \ self.toehold_domain + self.clamp_domain + self.base_domain + self.clamp_domain self.input_partial = Domain( name="partial", sequence=self.input_domain.sequence[:SEESAW_DELTA]) self.threshold_base = self.input_partial.C + self.clamp_domain.C + \ self.toehold_domain.C + self.clamp_domain + \ self.base_domain.C + self.clamp_domain self.base_dom_strand = self.clamp_domain + self.base_domain + self.clamp_domain self.gate_output_complex = Complex( strands=[self.base_strand, self.output_strand], structure="..(((((+..)))))") self.gate_fuel_complex = Complex( strands=[self.base_strand, self.fuel_strand], structure="..(((((+..)))))") self.gate_input_complex = Complex( strands=[self.base_strand, self.input_strand], structure="(((((..+)))))..") self.threshold_complex = Complex( strands=[self.threshold_base, self.base_dom_strand], structure="...(((+)))") self.input_complex = Complex(strands=[self.input_strand], structure='.' * len(self.input_strand.sequence)) self.fuel_complex = Complex(strands=[self.fuel_strand], structure='.' * len(self.fuel_strand.sequence)) self.output_complex = Complex(strands=[self.output_strand], structure='.' * len(self.output_strand.sequence)) ClampedSeesawGate.Gate_Count += 1