-
Notifications
You must be signed in to change notification settings - Fork 7
/
names_domains_strands.py
45 lines (33 loc) · 1.72 KB
/
names_domains_strands.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
40
41
42
43
44
45
import scadnano as sc
def create_design() -> sc.Design:
num_domains = 9
helices = [sc.Helix(max_offset=(num_domains) * 8)]
design: sc.Design = sc.Design(helices=helices, strands=[], grid=sc.square)
design.draw_strand(0, (num_domains - 1) * 8) \
.move(-8).with_domain_name('domain 8*') \
.move(-8).with_domain_name('domain 7*') \
.move(-8).with_domain_name('domain 6*') \
.move(-8).with_domain_name('domain 5*') \
.move(-8).with_domain_name('domain 4*') \
.move(-8).with_domain_name('domain 3*') \
.move(-8).with_domain_name('domain 2*') \
.move(-8).with_domain_name('domain 1*') \
.with_name('bottom strand')
# domain names match
design.draw_strand(0, 0).move(8).with_domain_name('domain 1').with_name('top strand 1')
# domains are aligns but names mismatch
design.draw_strand(0, 8).move(8).with_domain_name('domain 50').with_name('top strand 2')
# domain names match
design.draw_strand(0, 16).move(8).with_domain_name('domain 3').with_name('top strand 3')
# domain names are the same, not complementary
design.draw_strand(0, 24).move(8).with_domain_name('domain 4*').with_name('top strand 4')
# domain names match but domains are mis-aligned
design.draw_strand(0, 32).move(9).with_domain_name('domain 5').with_name('top strand 5')
# domain names match but domains are mis-aligned
design.draw_strand(0, 48).move(7).with_domain_name('domain 7').with_name('top strand 7')
# no overlap so no mismatch
design.draw_strand(0, 64).move(8).with_domain_name('domain 9').with_name('top strand 9')
return design
if __name__ == '__main__':
d = create_design()
d.write_scadnano_file(directory='output_designs')