Пример #1
0
def create_design():
    # left staple
    stap_left_ss1 = sc.Domain(helix=1, forward=True, start=0, end=16)
    stap_left_ss0 = sc.Domain(helix=0, forward=False, start=0, end=16)
    stap_left = sc.Strand(domains=[stap_left_ss1, stap_left_ss0])

    # right staple
    stap_right_ss0 = sc.Domain(helix=0, forward=False, start=16, end=32)
    stap_right_ss1 = sc.Domain(helix=1, forward=True, start=16, end=32)
    stap_right = sc.Strand(domains=[stap_right_ss0, stap_right_ss1])

    # scaffold
    scaf_ss1_left = sc.Domain(helix=1, forward=False, start=0, end=16)
    scaf_ss0 = sc.Domain(helix=0, forward=True, start=0, end=32)
    loopout = sc.Loopout(length=3)
    scaf_ss1_right = sc.Domain(helix=1, forward=False, start=16, end=32)
    scaf = sc.Strand(domains=[scaf_ss1_left, scaf_ss0, loopout, scaf_ss1_right], is_scaffold=True)

    # whole design
    design = sc.Design(strands=[scaf, stap_left, stap_right], grid=sc.square)

    # deletions and insertions added to design so they can be added to both strands on a helix
    design.add_deletion(helix=0, offset=11)
    design.add_deletion(helix=0, offset=12)
    design.add_deletion(helix=0, offset=24)
    design.add_deletion(helix=1, offset=12)
    design.add_deletion(helix=1, offset=24)

    design.add_insertion(helix=0, offset=6, length=1)
    design.add_insertion(helix=0, offset=18, length=2)
    design.add_insertion(helix=1, offset=6, length=3)
    design.add_insertion(helix=1, offset=18, length=4)
    
    return design
Пример #2
0
def main():
    # helices
    helices = [sc.Helix(max_offset=48), sc.Helix(max_offset=48)]

    # left staple
    stap_left_ss1 = sc.Domain(helix=1, forward=True, start=8, end=24)
    stap_left_ss0 = sc.Domain(helix=0, forward=False, start=8, end=24)
    stap_left = sc.Strand(domains=[stap_left_ss1, stap_left_ss0])

    # right staple
    stap_right_ss0 = sc.Domain(helix=0, forward=False, start=24, end=40)
    stap_right_ss1 = sc.Domain(helix=1, forward=True, start=24, end=40)
    stap_right = sc.Strand(domains=[stap_right_ss0, stap_right_ss1])
    stap_right.set_modification_5p(mod.biotin_5p)

    # scaffold
    scaf_ss1_left = sc.Domain(helix=1, forward=False, start=8, end=24)
    scaf_ss0 = sc.Domain(helix=0, forward=True, start=8, end=40)
    loopout = sc.Loopout(length=3)
    scaf_ss1_right = sc.Domain(helix=1, forward=False, start=24, end=40)
    scaf = sc.Strand(domains=[scaf_ss1_left, scaf_ss0, loopout, scaf_ss1_right], is_scaffold=True)

    # whole design
    design = sc.DNADesign(helices=helices, strands=[scaf, stap_left, stap_right], grid=sc.square)

    # deletions and insertions added to design are added to both strands on a helix
    design.add_deletion(helix=1, offset=20)
    design.add_insertion(helix=0, offset=14, length=1)
    design.add_insertion(helix=0, offset=26, length=2)

    # also assigns complement to strands other than scaf bound to it
    design.assign_dna(scaf, 'AACGT' * 18)

    return design
Пример #3
0
def main():
    ss_f = sc.Domain(helix=0, forward=True, start=0, end=10)
    loop = sc.Loopout(length=5)
    ss_r = sc.Domain(helix=0, forward=False, start=0, end=10)
    hairpin = sc.Strand([ss_f, loop, ss_r])
    design = sc.DNADesign(strands=[hairpin], grid=sc.square)

    design.assign_dna(hairpin, 'AAAAACCCCCTGCAT')

    return design
Пример #4
0
def create_design() -> sc.Design:
    ss_f0 = sc.Domain(helix=0, forward=True, start=0, end=8)
    hairpin0 = sc.Loopout(length=5)
    ss_r0 = sc.Domain(helix=0, forward=False, start=0, end=8)

    crossover_like_loopout = sc.Loopout(length=5)
    ss_f1 = sc.Domain(helix=1, forward=True, start=0, end=8)

    long_range_loopout = sc.Loopout(length=10)
    ss_r2 = sc.Domain(helix=2, forward=False, start=16, end=24)
    hairpin2 = sc.Loopout(length=20)
    ss_f2 = sc.Domain(helix=2, forward=True, start=16, end=32)
    hairpin2_2 = sc.Loopout(length=1)
    ss_r2_2 = sc.Domain(helix=2, forward=False, start=24, end=32)

    strand = sc.Strand([
        ss_f0, hairpin0, ss_r0, crossover_like_loopout, ss_f1,
        long_range_loopout, ss_r2, hairpin2, ss_f2, hairpin2_2, ss_r2_2
    ])

    design = sc.Design(strands=[strand], grid=sc.square)
    t5 = 'TTTAC'
    t10 = 'TTTACTTACG'
    t20 = 'TTTTTTTTTTACGTTGCAGG'
    design.assign_dna(
        strand, f'ACGACGAC '
        f'{t5} '
        f'???????? '
        f'{t5} '
        f'GACGACGA '
        f'{t10} '
        f'CACGACGA '
        f'{t20} '
        f'???????? '
        f'ACGACGAC '
        f'T')

    return design
Пример #5
0
def main():
    # helices
    helices = [sc.Helix(max_offset=48), sc.Helix(max_offset=48)]

    # left staple
    stap_left_ss1 = sc.Domain(helix=1, forward=True, start=8, end=24)
    stap_left_ss0 = sc.Domain(helix=0, forward=False, start=8, end=24)
    stap_left = sc.Strand(domains=[stap_left_ss1, stap_left_ss0])

    # right staple
    stap_right_ss0 = sc.Domain(helix=0, forward=False, start=24, end=40)
    stap_right_ss1 = sc.Domain(helix=1, forward=True, start=24, end=40)
    stap_right = sc.Strand(domains=[stap_right_ss0, stap_right_ss1])

    # scaffold
    scaf_ss1_left = sc.Domain(helix=1, forward=False, start=8, end=24)
    scaf_ss0 = sc.Domain(helix=0, forward=True, start=8, end=40)
    loopout = sc.Loopout(length=3)
    scaf_ss1_right = sc.Domain(helix=1, forward=False, start=24, end=40)
    scaf = sc.Strand(
        domains=[scaf_ss1_left, scaf_ss0, loopout, scaf_ss1_right],
        is_scaffold=True)

    # geometry
    geometry = sc.Geometry(rise_per_base_pair=0.2,
                           helix_radius=1.2,
                           inter_helix_gap=1.0)

    # whole design
    design = sc.DNADesign(helices=helices,
                          strands=[scaf, stap_left, stap_right],
                          grid=sc.square,
                          geometry=geometry)

    # deletions and insertions added to design are added to both strands on a helix
    design.add_deletion(helix=1, offset=20)
    design.add_insertion(helix=0, offset=14, length=1)
    design.add_insertion(helix=0, offset=26, length=2)

    # also assigns complement to strands other than scaf bound to it
    design.assign_dna(scaf, 'AACGT' * 18)

    return design
Пример #6
0
def add_hairpins(design, hairpin_locations, hairpin_lattice):
    """Given the design, the hairpin lattice, and the hairpin locations, adds the hairpins to the hairpin lattice and crossovers to the seed"""
    seed_domain = range(len(hairpin_locations))
    hairpin_domain = range(len(hairpin_locations),
                           len(hairpin_locations) + len(hairpin_lattice))
    #creates the hairpins, included the loopout crossover
    for i in range(len(hairpin_domain)):
        helix = hairpin_domain[i]
        for j in range(len(hairpin_locations[helix - len(seed_domain)])):
            left_offset = hairpin_locations[helix - len(seed_domain)][j]
            right_offset = left_offset + 8
            index = 6 * (i - 1) + j
            pin_seq = non_random_hairpin_sequence(index)
            staple = sc.Strand([
                sc.Domain(helix=helix,
                          forward=True,
                          start=left_offset,
                          end=right_offset),
                sc.Loopout(length=4),
                sc.Domain(helix=helix,
                          forward=False,
                          start=left_offset - 2,
                          end=right_offset)
            ],
                               dna_sequence=pin_seq)
            design.add_strand(staple)

    #add nicks on staple strands to be able to connect the hairpins
    for helix in seed_domain:
        forward = sc_general.forward_strand(helix, 'staple')
        for nick in hairpin_locations[helix]:
            design.add_nick(helix=helix, offset=nick, forward=forward)

    #crossovers between the main helices and the hairpins
    crossovers = []
    for helix in seed_domain:
        helix2 = hairpin_domain[helix]
        forward = sc_general.forward_strand(helix, 'staple')
        for pin in hairpin_locations[helix]:
            if forward == True:
                forward_pin_offset = pin - 1
                reverse_pin_offset = pin
            else:
                forward_pin_offset = pin
                reverse_pin_offset = pin - 1
            crossovers.append(
                sc.Crossover(helix=helix,
                             helix2=helix2,
                             offset=forward_pin_offset,
                             offset2=pin,
                             forward=forward,
                             forward2=True,
                             half=True))
            crossovers.append(
                sc.Crossover(helix=helix,
                             helix2=helix2,
                             offset=reverse_pin_offset,
                             offset2=pin - 2,
                             forward=forward,
                             forward2=False,
                             half=True))

    design.add_crossovers(crossovers)
def main():
    helices = [
        sc.Helix(max_offset=64),
        sc.Helix(max_offset=64),
        sc.Helix(max_offset=64)
    ]

    # left staple
    stap_left_ss1 = sc.Domain(helix=1, forward=True, start=0, end=16)
    stap_left_ss0 = sc.Domain(helix=0, forward=False, start=0, end=16)
    stap_left = sc.Strand(domains=[stap_left_ss1, stap_left_ss0])

    # right staple
    stap_right_ss0 = sc.Domain(helix=0, forward=False, start=16, end=32)
    stap_right_ss1 = sc.Domain(helix=1, forward=True, start=16, end=32)
    stap_right = sc.Strand(domains=[stap_right_ss0, stap_right_ss1])

    # scaffold
    scaf_ss1_left = sc.Domain(helix=1, forward=False, start=0, end=16)
    scaf_ss0 = sc.Domain(helix=0, forward=True, start=0, end=32)
    loopout = sc.Loopout(length=3)
    scaf_ss1_right = sc.Domain(helix=1, forward=False, start=16, end=32)
    scaf = sc.Strand(
        domains=[scaf_ss1_left, scaf_ss0, loopout, scaf_ss1_right],
        is_scaffold=True)

    ss_extra1 = sc.Domain(helix=1, forward=True, start=32, end=48)
    ss_extra2 = sc.Domain(helix=1, forward=True, start=48, end=64)
    ss_extra3 = sc.Domain(helix=2, forward=False, start=32, end=48)
    ss_extra1b = sc.Domain(helix=1, forward=False, start=32, end=48)
    ss_extra2b = sc.Domain(helix=1, forward=False, start=48, end=64)
    ss_extra3b = sc.Domain(helix=2, forward=True, start=32, end=48)
    ss_extra4 = sc.Domain(helix=2, forward=True, start=16, end=32)
    ss_extra5 = sc.Domain(helix=2, forward=True, start=0, end=16)
    s_extra1 = sc.Strand(domains=[ss_extra1])
    s_extra2 = sc.Strand(domains=[ss_extra2])
    s_extra3 = sc.Strand(domains=[ss_extra3])
    s_extra4 = sc.Strand(domains=[ss_extra4])
    s_extra5 = sc.Strand(domains=[ss_extra5])
    s_extra1b = sc.Strand(domains=[ss_extra1b])
    s_extra2b = sc.Strand(domains=[ss_extra2b])
    s_extra3b = sc.Strand(domains=[ss_extra3b])

    # whole design
    design = sc.DNADesign(helices=helices,
                          strands=[
                              scaf, stap_left, stap_right, s_extra1, s_extra2,
                              s_extra3, s_extra4, s_extra1b, s_extra2b,
                              s_extra3b, s_extra5
                          ],
                          grid=sc.square)

    # deletions and insertions added to design so they can be added to both strands on a helix
    design.add_deletion(helix=0, offset=11)
    design.add_deletion(helix=0, offset=12)
    design.add_deletion(helix=0, offset=24)
    design.add_deletion(helix=1, offset=12)
    design.add_deletion(helix=1, offset=24)

    design.add_insertion(helix=0, offset=6, length=1)
    design.add_insertion(helix=0, offset=18, length=2)
    design.add_insertion(helix=1, offset=6, length=3)
    design.add_insertion(helix=1, offset=18, length=4)

    # DNA assigned to whole design so complement can be assigned to strands other than scaf
    design.assign_dna(scaf, 'AACT' * 18)
    design.assign_dna(s_extra1, 'AACT' * 4)
    design.assign_dna(s_extra2, 'GGTA' * 4)

    return design