-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsst-motif-4_1.py
39 lines (33 loc) · 1.3 KB
/
sst-motif-4_1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import scadnano as sc
def create_design() -> sc.Design:
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.Design(helices=helices, strands=strands, grid=sc.square)
return design
if __name__ == '__main__':
d = create_design()
d.write_scadnano_file(directory='output_designs')