Exemple #1
0
def create_test6():

    toehold_seq = "CTGC"
    toehold_seq2 = "CAT"
    domain_seq = "CATGCTAAC"

    # build complexes with domain-level information    
    toehold = Domain(name="toehold", sequence=toehold_seq, length=4)
    toehold2 = Domain(name="toehold", sequence=toehold_seq2, length=3)
    branch_migration = Domain(name="branch_migration", sequence=domain_seq, seq_length=9)

        
    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]
Exemple #3
0
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 create_test0B():

    toehold_seq = "CC"
    domain_seq = "CAAC"

    # build complexes with domain-level information
    toehold = Domain(name="toehold", sequence=toehold_seq, length=2)
    branch_migration = Domain(name="branch_migration",
                              sequence=domain_seq,
                              seq_length=4)

    incoming = branch_migration.C + toehold.C
    substrate = toehold + branch_migration

    #     start_complex = Complex(strands=[incoming, substrate], structure="..+..")
    #     stop_complex = Complex(strands=[incoming, substrate], structure="((+))")

    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_test2():

    top0 = "T"
    top1 = "G"
    top2 = "G"

    bottom0 = "C"
    bottom1 = "C"
    bottom2 = "A"

    # build complexes with domain-level information
    strand0 = Domain(name="toehold0", sequence=top0, length=1)
    strand1 = Domain(name="toehold1", sequence=top1, length=1)
    strand2 = Domain(name="toehold2", sequence=top2, length=1)

    strand3 = Domain(name="toehold3", sequence=bottom0, length=1)
    strand4 = Domain(name="toehold4", sequence=bottom1, length=1)
    strand5 = Domain(name="toehold5", sequence=bottom2, length=1)

    substrate = strand3 + strand4 + strand5
    invading = strand0 + strand1 + strand2

    #     start_complex = Complex(strands=[substrate, invading], structure="(..+..)")
    #     start_complex = Complex(strands=[substrate, invading], structure=".(.+.).")
    start_complex = Complex(strands=[substrate, invading], structure="..(+)..")
    stop_complex = Complex(strands=[substrate, invading], structure="...+...")

    return createOptions(start_complex, stop_complex, "First Passage Time")
def create_test2B():

    top0 = "T"
    top1 = "T"
    top2 = "T"

    bottom0 = "A"
    bottom1 = "A"
    bottom2 = "A"

    # build complexes with domain-level information
    strand0 = Domain(name="toehold0", sequence=top0, length=1)
    strand1 = Domain(name="toehold1", sequence=top1, length=1)
    strand2 = Domain(name="toehold2", sequence=top2, length=1)

    strand3 = Domain(name="toehold3", sequence=bottom0, length=1)
    strand4 = Domain(name="toehold4", sequence=bottom1, length=1)
    strand5 = Domain(name="toehold5", sequence=bottom2, length=1)

    substrate = strand3 + strand4 + strand5
    invading = strand0 + strand1 + strand2

    start_complex = Complex(strands=[substrate, invading], structure=".(.+.).")
    stop_complex = Complex(strands=[substrate, invading], structure="...+...")

    o1 = createOptions(start_complex, stop_complex, "First Passage Time")
    #     o1.join_concentration = 8
    #     o1.bimolecular_scaling = 777.0
    #     o1.DNA23Metropolis()

    return o1
Exemple #7
0
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]
Exemple #10
0
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 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 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
Exemple #13
0
    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 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 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 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 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)
Exemple #18
0
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 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]
Exemple #20
0
myMultistrand.setNumOfThreads(8)



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 = "CTCT"

# The actual main method
if __name__ == '__main__':
    toehold_dom = Domain(name="T", sequence=LONG_SEQT)
    base_dom = Domain(name="S2", sequence=LONG_SEQ2+LONG_SEQ2)
    input_dom = Domain(name="S5", sequence=LONG_SEQ5+LONG_SEQ5)
    output_dom = Domain(name="S6", sequence=LONG_SEQ6+LONG_SEQ6)

    input_strand = base_dom + toehold_dom + input_dom
    output_strand = output_dom + toehold_dom  + base_dom
    base_strand = toehold_dom.C + base_dom.C + toehold_dom.C

    gate_complex = Complex(strands=[base_strand, output_strand], structure = ".((+.))")
    input_complex = Complex(strands=[input_strand], structure="...")
    intermediate_complex = Complex(strands=[base_strand, output_strand, input_strand], structure = "(((+.).+.))")
    output_complex = Complex(strands=[output_strand], structure="...")

    success_stop_condition = StopCondition(
        Options.STR_SUCCESS, [(intermediate_complex, Options.looseMacrostate, 6)])
    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