Skip to content

Commit

Permalink
Merge pull request #83 from UC-Davis-molecular-computing/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dave-doty authored Jun 20, 2020
2 parents 3d3e455 + 59305e8 commit f54b629
Show file tree
Hide file tree
Showing 38 changed files with 1,797 additions and 1,756 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
28 changes: 28 additions & 0 deletions examples/4_helix_grid_none_min_offset_position_x_nondefault.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import scadnano as sc


def main():
length = 16
helices = [
sc.Helix(major_tick_distance=4, max_offset=length, position=sc.Position3D(x=0, y=0, z=0),
min_offset=0),
sc.Helix(major_tick_distance=4, max_offset=length, position=sc.Position3D(x=0, y=3, z=3),
min_offset=8),
sc.Helix(major_tick_distance=4, max_offset=length, position=sc.Position3D(x=2.5, y=-3, z=8),
min_offset=0),
sc.Helix(major_tick_distance=4, max_offset=length, position=sc.Position3D(x=2.5, y=1, z=11),
min_offset=8),
]
design = sc.DNADesign(helices=helices, strands=[
sc.Strand([sc.Domain(0, True, 0, length)]),
sc.Strand([sc.Domain(1, True, 8, length)]),
sc.Strand([sc.Domain(2, True, 0, length)]),
sc.Strand([sc.Domain(3, True, 8, length)]),
], grid=sc.Grid.none)

return design


if not sc.in_browser() and __name__ == '__main__':
design = main()
design.write_scadnano_file(directory='output_designs')
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
2 changes: 1 addition & 1 deletion 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 Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"version": "0.9.0",
"grid": "none",
"helices": [
{
"position": {"x": 0, "y": 0, "z": 0},
"major_tick_distance": 4
},
{
"min_offset": 8,
"position": {"x": 0, "y": 3, "z": 3},
"major_tick_distance": 4
},
{
"position": {"x": 2.5, "y": -3, "z": 8},
"major_tick_distance": 4
},
{
"min_offset": 8,
"position": {"x": 2.5, "y": 1, "z": 11},
"major_tick_distance": 4
}
],
"strands": [
{
"color": "#333333",
"domains": [
{"helix": 0, "forward": true, "start": 0, "end": 16}
]
},
{
"color": "#320096",
"domains": [
{"helix": 1, "forward": true, "start": 8, "end": 16}
]
},
{
"color": "#03b6a2",
"domains": [
{"helix": 2, "forward": true, "start": 0, "end": 16}
]
},
{
"color": "#7300de",
"domains": [
{"helix": 3, "forward": true, "start": 8, "end": 16}
]
}
]
}
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 f54b629

Please sign in to comment.