def add_staple_crossovers(design: sc.DNADesign): for helix in range(23): start_offset = 24 if helix % 2 == 0 else 40 for offset in range(start_offset, 296, 32): if offset != 152: # skip crossover near seam design.add_full_crossover(helix1=helix, helix2=helix + 1, offset1=offset, forward1=helix % 2 == 1)
def add_crossovers(design: sc.DNADesign): # staples interior for offset in range(84, 1246, 42): design.add_full_crossover(helix=0, helix2=1, offset=offset, forward=False) design.add_full_crossover(helix=3, helix2=4, offset=offset, forward=True) for offset in range(56, 1246, 42): design.add_full_crossover(helix=1, helix2=2, offset=offset, forward=True) design.add_full_crossover(helix=4, helix2=5, offset=offset, forward=False) for offset in range(70, 1246, 42): design.add_full_crossover(helix=2, helix2=3, offset=offset, forward=False) design.add_full_crossover(helix=5, helix2=0, offset=offset, forward=True) for offset in range(49, 1245, 42): # extra crossovers 5 - 0 for some reason design.add_full_crossover(helix=5, helix2=0, offset=offset, forward=True) # staples edges design.add_half_crossover(helix=0, helix2=1, offset=42, forward=False) design.add_half_crossover(helix=3, helix2=4, offset=42, forward=True) design.add_half_crossover(helix=0, helix2=5, offset=1245, forward=False) design.add_half_crossover(helix=2, helix2=3, offset=1245, forward=False) # scaffold interior crossovers = [] for offset in range(58, 1250, 42): crossovers.append( sc.Crossover(helix=0, helix2=1, offset=offset, forward=True)) for offset in range(30, 1250, 42): crossovers.append( sc.Crossover(helix=1, helix2=2, offset=offset, forward=False)) for offset in range(54, 1250, 42): crossovers.append( sc.Crossover(helix=2, helix2=3, offset=offset, forward=True)) for offset in range(26, 1250, 42): crossovers.append( sc.Crossover(helix=3, helix2=4, offset=offset, forward=False)) # scaffold edges crossovers.append( sc.Crossover(helix=0, helix2=1, offset=16, forward=True, half=True)) crossovers.append( sc.Crossover(helix=2, helix2=3, offset=12, forward=True, half=True)) crossovers.append( sc.Crossover(helix=4, helix2=5, offset=19, forward=True, half=True)) crossovers.append( sc.Crossover(helix=0, helix2=1, offset=1275, forward=True, half=True)) crossovers.append( sc.Crossover(helix=2, helix2=3, offset=1271, forward=True, half=True)) crossovers.append( sc.Crossover(helix=4, helix2=5, offset=1278, forward=True, half=True)) design.add_crossovers(crossovers)