def assign_dna_to_unzipper_toeholds(design: sc.Design) -> None: uz_toes = [sc.wc(seq) for seq in uz_toes_wc] strands_h1 = design.strands_starting_on_helix(1) strands_h1.sort(key=lambda _strand: _strand.first_domain().offset_5p()) strands_h1.reverse() strands_h18 = design.strands_starting_on_helix(18) strands_h18.sort(key=lambda _strand: _strand.first_domain().offset_5p()) for strand, toe in zip(strands_h1 + strands_h18, uz_toes): seq = toe + sc.DNA_base_wildcard * (strand.dna_length() - 8) design.assign_dna(strand, seq)
def add_tiles_and_assign_dna(design: sc.Design) -> None: # left tiles left_left = 11 left_right = 32 for top_helix, seq in zip(range(2, 18, 2), tile_dna_seqs): bot_helix = top_helix + 1 ss_top = sc.Domain(helix=top_helix, forward=True, start=left_left, end=left_right) ss_bot = sc.Domain(helix=bot_helix, forward=False, start=left_left, end=left_right) idt = sc.IDTFields(name=f'tile-left-{top_helix}-{bot_helix}', scale='25nm', purification='STD') tile = sc.Strand(domains=[ss_bot, ss_top], color=sc.Color(0, 0, 0), idt=idt) design.add_strand(tile) design.assign_dna(tile, seq) # right tiles right_left = 480 right_right = 501 for top_helix, seq in zip(range(2, 18, 2), tile_dna_seqs): bot_helix = top_helix + 1 ss_top = sc.Domain(helix=top_helix, forward=True, start=right_left, end=right_right) ss_bot = sc.Domain(helix=bot_helix, forward=False, start=right_left, end=right_right) idt = sc.IDTFields(name=f'tile-right-{top_helix}-{bot_helix}', scale='25nm', purification='STD') tile = sc.Strand(domains=[ss_bot, ss_top], color=sc.Color(0, 0, 0), idt=idt) design.add_strand(tile) design.assign_dna(tile, seq)