def add_tiles_and_assign_dna(design): # left tiles left_left = 11 left_right = 32 for col, 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) tile = sc.Strand(domains=[ss_bot, ss_top], color=sc.Color(0, 0, 0)) 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) tile = sc.Strand(domains=[ss_bot, ss_top], color=sc.Color(0, 0, 0)) design.add_strand(tile) design.assign_dna(tile, seq)
def main(): blue = sc.Color(r=0, g=0, b=255) black = sc.Color(r=0, g=0, b=0) red = sc.Color(r=255, g=0, b=0) green = sc.Color(r=0, g=150, b=0) cols = 8 rows = 8 # helices = [sc.Helix(major_tick_distance=10) for _ in range(rows+1)] strands = [] for col in range(cols): for row in range(rows): helix = row forward = row % 2 == 0 if forward: offset = col * 20 ss1 = sc.Domain(helix, forward, offset, offset + 20) ss2 = sc.Domain(helix + 1, forward, offset + 20, offset + 40) else: offset = col * 20 ss1 = sc.Domain(helix, forward, offset + 30, offset + 50) ss2 = sc.Domain(helix + 1, forward, offset + 10, offset + 30) if forward: color = blue if col % 2 == 0 else black else: color = red if col % 2 == 0 else green strand = sc.Strand([ss1, ss2], color=color) strands.append(strand) # design = sc.DNADesign(helices=helices, strands=strands, grid=sc.square) design = sc.DNADesign(major_tick_distance=10, strands=strands, grid=sc.square) return design
def add_tiles_and_assign_dna(design): # 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)