Skip to content

Commit

Permalink
remove forward and reverse helper variables from scadnano and examples
Browse files Browse the repository at this point in the history
Also cleaned up many PEP warnings.
  • Loading branch information
dave-doty committed Jun 20, 2020
1 parent f6ee275 commit 59305e8
Show file tree
Hide file tree
Showing 31 changed files with 1,688 additions and 1,691 deletions.
Binary file added dist/scadnano-0.9.1.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/1_staple_1_helix_origami.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
def main():
length = 9
helices = [sc.Helix(max_offset=length, major_ticks=[2, 5])]
stap_ss = sc.Domain(0, sc.forward, 0, length)
scaf_ss = sc.Domain(0, sc.reverse, 0, length)
stap_ss = sc.Domain(0, True, 0, length)
scaf_ss = sc.Domain(0, False, 0, length)
stap = sc.Strand([stap_ss])
scaf = sc.Strand([scaf_ss], color=sc.default_scaffold_color)
strands = [stap, scaf]
Expand Down
8 changes: 4 additions & 4 deletions examples/1_staple_1_helix_origami_idt_duplicate_names.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import scadnano as sc

def main():
ss1_r = sc.Domain(0, sc.forward, 0, 4)
ss2_r = sc.Domain(0, sc.forward, 4, 8)
ss3_r = sc.Domain(0, sc.forward, 8, 12)
ss_l = sc.Domain(0, sc.reverse, 0, 12)
ss1_r = sc.Domain(0, True, 0, 4)
ss2_r = sc.Domain(0, True, 4, 8)
ss3_r = sc.Domain(0, True, 8, 12)
ss_l = sc.Domain(0, False, 0, 12)

s1_r = sc.Strand([ss1_r], idt=sc.IDTFields('s1_r'))
s2_r = sc.Strand([ss2_r], idt=sc.IDTFields('s1_r'))
Expand Down
4 changes: 2 additions & 2 deletions examples/1_staple_1_helix_origami_mismatches.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

def main():
length = 10
stap_ss = sc.Domain(0, sc.forward, 0, length)
scaf_ss = sc.Domain(0, sc.reverse, 0, length)
stap_ss = sc.Domain(0, True, 0, length)
scaf_ss = sc.Domain(0, False, 0, length)
stap = sc.Strand([stap_ss])
scaf = sc.Strand([scaf_ss], color=sc.default_scaffold_color)
strands = [stap, scaf]
Expand Down
4 changes: 2 additions & 2 deletions examples/1_staple_1_helix_origami_position_nondefault.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ def main():
length = 9
helices = [
sc.Helix(max_offset=length, major_ticks=[2, 5], position=sc.Position3D(x=1, y=2, z=3), pitch=90)]
stap_ss = sc.Domain(0, sc.forward, 0, length)
scaf_ss = sc.Domain(0, sc.reverse, 0, length)
stap_ss = sc.Domain(0, True, 0, length)
scaf_ss = sc.Domain(0, False, 0, length)
stap = sc.Strand([stap_ss])
scaf = sc.Strand([scaf_ss], color=sc.default_scaffold_color)
strands = [stap, scaf]
Expand Down
4 changes: 2 additions & 2 deletions examples/1_staple_1_helix_origami_roll.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
def main():
length = 9
helices = [sc.Helix(max_offset=length, roll=90)]
stap_ss = sc.Domain(0, sc.forward, 0, length)
scaf_ss = sc.Domain(0, sc.reverse, 0, length)
stap_ss = sc.Domain(0, True, 0, length)
scaf_ss = sc.Domain(0, False, 0, length)
stap = sc.Strand([stap_ss])
scaf = sc.Strand([scaf_ss], color=sc.default_scaffold_color)
strands = [stap, scaf]
Expand Down
14 changes: 7 additions & 7 deletions examples/2_staple_2_helix_modifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import dataclasses

def main():
stap_left_ss1 = sc.Domain(1, sc.forward, 0, 16)
stap_left_ss0 = sc.Domain(0, sc.reverse, 0, 16)
stap_right_ss0 = sc.Domain(0, sc.reverse, 16, 32)
stap_right_ss1 = sc.Domain(1, sc.forward, 16, 32)
scaf_ss1_left = sc.Domain(1, sc.reverse, 0, 16)
scaf_ss0 = sc.Domain(0, sc.forward, 0, 32)
scaf_ss1_right = sc.Domain(1, sc.reverse, 16, 32)
stap_left_ss1 = sc.Domain(1, True, 0, 16)
stap_left_ss0 = sc.Domain(0, False, 0, 16)
stap_right_ss0 = sc.Domain(0, False, 16, 32)
stap_right_ss1 = sc.Domain(1, True, 16, 32)
scaf_ss1_left = sc.Domain(1, False, 0, 16)
scaf_ss0 = sc.Domain(0, True, 0, 32)
scaf_ss1_right = sc.Domain(1, False, 16, 32)
stap_left = sc.Strand([stap_left_ss1, stap_left_ss0])
stap_right = sc.Strand([stap_right_ss0, stap_right_ss1])
scaf = sc.Strand([scaf_ss1_left, scaf_ss0, scaf_ss1_right], color=sc.default_scaffold_color)
Expand Down
14 changes: 7 additions & 7 deletions examples/2_staple_2_helix_origami_6bases_wide.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
def main():
width = 6
width_h = width // 2
stap_left_ss1 = sc.Domain(1, sc.forward, 0, width_h)
stap_left_ss0 = sc.Domain(0, sc.reverse, 0, width_h)
stap_right_ss0 = sc.Domain(0, sc.reverse, width_h, width)
stap_right_ss1 = sc.Domain(1, sc.forward, width_h, width)
scaf_ss1_left = sc.Domain(1, sc.reverse, 0, width_h)
scaf_ss0 = sc.Domain(0, sc.forward, 0, width)
scaf_ss1_right = sc.Domain(1, sc.reverse, width_h, width)
stap_left_ss1 = sc.Domain(1, True, 0, width_h)
stap_left_ss0 = sc.Domain(0, False, 0, width_h)
stap_right_ss0 = sc.Domain(0, False, width_h, width)
stap_right_ss1 = sc.Domain(1, True, width_h, width)
scaf_ss1_left = sc.Domain(1, False, 0, width_h)
scaf_ss0 = sc.Domain(0, True, 0, width)
scaf_ss1_right = sc.Domain(1, False, width_h, width)
stap_left = sc.Strand([stap_left_ss1, stap_left_ss0])
stap_right = sc.Strand([stap_right_ss0, stap_right_ss1])
scaf = sc.Strand([scaf_ss1_left, scaf_ss0, scaf_ss1_right], color=sc.default_scaffold_color)
Expand Down
14 changes: 7 additions & 7 deletions examples/2_staple_2_helix_origami_deletions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@


def main():
stap_left_ss1 = sc.Domain(1, sc.forward, 0, 16)
stap_left_ss0 = sc.Domain(0, sc.reverse, 0, 16)
stap_right_ss0 = sc.Domain(0, sc.reverse, 16, 32)
stap_right_ss1 = sc.Domain(1, sc.forward, 16, 32)
scaf_ss1_left = sc.Domain(1, sc.reverse, 0, 16)
scaf_ss0 = sc.Domain(0, sc.forward, 0, 32)
scaf_ss1_right = sc.Domain(1, sc.reverse, 16, 32)
stap_left_ss1 = sc.Domain(1, True, 0, 16)
stap_left_ss0 = sc.Domain(0, False, 0, 16)
stap_right_ss0 = sc.Domain(0, False, 16, 32)
stap_right_ss1 = sc.Domain(1, True, 16, 32)
scaf_ss1_left = sc.Domain(1, False, 0, 16)
scaf_ss0 = sc.Domain(0, True, 0, 32)
scaf_ss1_right = sc.Domain(1, False, 16, 32)
stap_left = sc.Strand([stap_left_ss1, stap_left_ss0])
stap_right = sc.Strand([stap_right_ss0, stap_right_ss1])
scaf = sc.Strand([scaf_ss1_left, scaf_ss0, scaf_ss1_right], color=sc.default_scaffold_color)
Expand Down
4 changes: 2 additions & 2 deletions examples/4_helix_grid_none.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def main():
sc.Helix(max_offset=length, position=sc.Position3D(x=0, y=-3, z=8), pitch=0, roll=0, yaw=0),
sc.Helix(max_offset=length, position=sc.Position3D(x=0, y=1, z=11), pitch=0, roll=0, yaw=0),
]
stap_ss = sc.Domain(0, sc.forward, 0, length)
scaf_ss = sc.Domain(0, sc.reverse, 0, length)
stap_ss = sc.Domain(0, True, 0, length)
scaf_ss = sc.Domain(0, False, 0, length)
stap = sc.Strand([stap_ss])
scaf = sc.Strand([scaf_ss], color=sc.default_scaffold_color)
strands = [stap, scaf]
Expand Down
4 changes: 2 additions & 2 deletions examples/4_helix_min_offsets_nonzero.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def main():
sc.Helix(min_offset=2, max_offset=length, grid_position=(0, 2)),
sc.Helix(min_offset=3, max_offset=length, grid_position=(0, 3)),
]
stap_ss = sc.Domain(0, sc.forward, 0, length - 1)
scaf_ss = sc.Domain(0, sc.reverse, 0, length - 1)
stap_ss = sc.Domain(0, True, 0, length - 1)
scaf_ss = sc.Domain(0, False, 0, length - 1)
stap = sc.Strand([stap_ss])
scaf = sc.Strand([scaf_ss], color=sc.default_scaffold_color)
strands = [stap, scaf]
Expand Down
12 changes: 6 additions & 6 deletions examples/long_range_crossovers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ def main():
helix_top = helices[bot]
helix_bot = helices[top]

stap_left_ss_top = sc.Domain(top, sc.forward, 0, bases // 3)
stap_left_ss_bot = sc.Domain(bot, sc.reverse, 0, bases // 3)
stap_mid_ss_bot = sc.Domain(bot, sc.reverse, bases // 3, bases * 2 // 3)
stap_mid_ss_top = sc.Domain(top, sc.forward, bases // 3, bases * 2 // 3)
stap_right_ss_top = sc.Domain(top, sc.forward, bases * 2 // 3, bases)
stap_right_ss_bot = sc.Domain(bot, sc.reverse, bases * 2 // 3, bases)
stap_left_ss_top = sc.Domain(top, True, 0, bases // 3)
stap_left_ss_bot = sc.Domain(bot, False, 0, bases // 3)
stap_mid_ss_bot = sc.Domain(bot, False, bases // 3, bases * 2 // 3)
stap_mid_ss_top = sc.Domain(top, True, bases // 3, bases * 2 // 3)
stap_right_ss_top = sc.Domain(top, True, bases * 2 // 3, bases)
stap_right_ss_bot = sc.Domain(bot, False, bases * 2 // 3, bases)
stap_left = sc.Strand([stap_left_ss_bot, stap_left_ss_top])
stap_mid = sc.Strand([stap_mid_ss_top, stap_mid_ss_bot])
stap_right = sc.Strand([stap_right_ss_bot, stap_right_ss_top])
Expand Down
12 changes: 6 additions & 6 deletions examples/output_designs/2_staple_2_helix_modifications.dna
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"display_connector": false,
"location": "5'"
},
"/3Cy3Sp/": {
"display_text": "Cy3",
"idt_text": "/3Cy3Sp/",
"display_connector": false,
"location": "3'"
},
"/iCy3/": {
"display_text": "Cy3",
"idt_text": "/iCy3/",
Expand All @@ -31,12 +37,6 @@
"display_connector": false,
"location": "3'"
},
"/3Cy3Sp/": {
"display_text": "Cy3",
"idt_text": "/3Cy3Sp/",
"display_connector": false,
"location": "3'"
},
"/5Biosg/": {
"display_text": "B",
"idt_text": "/5Biosg/",
Expand Down
14 changes: 1 addition & 13 deletions examples/output_designs/4_helix_grid_none.dna
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
],
"strands": [
{
"color": "#f74308",
"color": "#32b86c",
"domains": [
{"helix": 0, "forward": true, "start": 0, "end": 10}
]
Expand All @@ -30,18 +30,6 @@
"domains": [
{"helix": 0, "forward": false, "start": 0, "end": 10}
]
},
{
"color": "#f74308",
"domains": [
{"helix": 1, "forward": true, "start": 0, "end": 10}
]
},
{
"color": "#0066cc",
"domains": [
{"helix": 1, "forward": false, "start": 0, "end": 10}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@
],
"strands": [
{
"color": "#f74308",
"color": "#333333",
"domains": [
{"helix": 0, "forward": true, "start": 0, "end": 16}
]
},
{
"color": "#57bb00",
"color": "#320096",
"domains": [
{"helix": 1, "forward": true, "start": 8, "end": 16}
]
},
{
"color": "#888888",
"color": "#03b6a2",
"domains": [
{"helix": 2, "forward": true, "start": 0, "end": 16}
]
},
{
"color": "#32b86c",
"color": "#7300de",
"domains": [
{"helix": 3, "forward": true, "start": 8, "end": 16}
]
Expand Down
2 changes: 1 addition & 1 deletion examples/output_designs/4_helix_min_offsets_nonzero.dna
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"strands": [
{
"color": "#f74308",
"color": "#aaaa00",
"domains": [
{"helix": 0, "forward": true, "start": 0, "end": 29}
]
Expand Down
Loading

0 comments on commit 59305e8

Please sign in to comment.