Skip to content

Commit

Permalink
Merge pull request #128 from UC-Davis-molecular-computing/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dave-doty authored Aug 6, 2020
2 parents 1895aa9 + dceefc1 commit e03a5ea
Show file tree
Hide file tree
Showing 64 changed files with 940 additions and 6,652 deletions.
2 changes: 1 addition & 1 deletion examples/1_staple_1_helix_origami_position_nondefault.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def create_design():
stap = sc.Strand([stap_ss])
scaf = sc.Strand([scaf_ss], color=sc.default_scaffold_color)
strands = [stap, scaf]
design = sc.Design(helices=helices, strands=strands, grid=sc.square)
design = sc.Design(helices=helices, strands=strands, grid=sc.Grid.none)
design.assign_dna(scaf, 'AACT' * (length // 4))

return design
Expand Down
2 changes: 1 addition & 1 deletion examples/24_helix_origami_rectangle_twist_corrected.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 304, "grid_position": [0, 0]},
Expand Down
2 changes: 1 addition & 1 deletion examples/24_helix_rectangle_twist_corrected.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "e",
"helices": [
{"max_offset": 304, "grid_position": [0, -3]},
Expand Down
68 changes: 47 additions & 21 deletions examples/helix_groups.py
Original file line number Diff line number Diff line change
@@ -1,50 +1,76 @@
import scadnano as sc


def create_design():
include_rot = False
include_rot = True
n = 'north'
e = 'east'
s = 'south'
w = 'west'
helices = [
sc.Helix(max_offset=20, group=n, grid_position=(1, 1)), # 0
sc.Helix(max_offset=21, group=n, grid_position=(0, 1)), # 1
sc.Helix(max_offset=19, group=n, grid_position=(0, 2)), # 2
sc.Helix(max_offset=18, group=n, grid_position=(1, 2)), # 3
sc.Helix(max_offset=17, group=n, grid_position=(2, 2)), # 4
sc.Helix(max_offset=16, group=n, grid_position=(2, 1)), # 5
sc.Helix(max_offset=24, group=s), # 6
sc.Helix(max_offset=25, group=s), # 7
sc.Helix(max_offset=26, group=w, position=sc.Position3D(x=0, y=0, z=0)), # 8
sc.Helix(max_offset=27, group=w, position=sc.Position3D(x=0, y=2.5, z=0)), # 9
sc.Helix(idx=13, max_offset=22, group=e), # 13
sc.Helix(idx=15, max_offset=23, group=e), # 15
sc.Helix(max_offset=20, group=n, grid_position=(0, 0)), # 0
sc.Helix(max_offset=21, group=n, grid_position=(1, 0)), # 1
sc.Helix(max_offset=19, group=n, grid_position=(1, 1)), # 2
sc.Helix(max_offset=18, group=n, grid_position=(0, 1)), # 3
sc.Helix(max_offset=17, group=n, grid_position=(-1, 1)), # 4
sc.Helix(max_offset=16, group=n, grid_position=(-1, 0)), # 5
sc.Helix(max_offset=24, group=s), # 6
sc.Helix(max_offset=25, group=s), # 7
sc.Helix(max_offset=26, group=w, position=sc.Position3D(x=0, y=0, z=0)), # 8
sc.Helix(max_offset=27, group=w, position=sc.Position3D(x=0, y=3, z=0)), # 9
]
group_north = sc.HelixGroup(position=sc.Position3D(x=0, y=-200, z=0), grid=sc.honeycomb)
group_south = sc.HelixGroup(position=sc.Position3D(x=0, y=70, z=0), helices_view_order=[7, 6],
if include_rot:
helices.extend([
sc.Helix(max_offset=26, group='r', grid_position=(0, 0)), # 10
sc.Helix(max_offset=27, group='r', grid_position=(0, 1)), # 11
])
helices.extend([
sc.Helix(idx=13, max_offset=22, group=e), # 13
sc.Helix(idx=15, max_offset=23, group=e), # 15
])

group_north = sc.HelixGroup(position=sc.Position3D(x=0, y=-10, z=0), grid=sc.honeycomb)
group_south = sc.HelixGroup(position=sc.Position3D(x=0, y=10, z=0), helices_view_order=[7, 6],
grid=sc.square)
group_east = sc.HelixGroup(position=sc.Position3D(x=0, y=0, z=100), pitch=45, grid=sc.square)
group_west = sc.HelixGroup()
group_east = sc.HelixGroup(position=sc.Position3D(x=10, y=0, z=0), grid=sc.square)
group_west = sc.HelixGroup(position=sc.Position3D(x=-10, y=0, z=0), grid=sc.Grid.none)
groups = {
n: group_north,
e: group_east,
s: group_south,
w: group_west,
}

if include_rot:
group_rot = sc.HelixGroup(position=sc.Position3D(x=10, y=10, z=0), pitch=45, grid=sc.square)
groups['r'] = group_rot

design = sc.Design(helices=helices, groups=groups, strands=[])

design.strand(0, 0).to(8)\
.cross(1).to(0)\
.cross(2).to(8)\
.cross(3).to(0)\
.cross(4).to(8)\
design.strand(0, 0).to(8) \
.cross(1).to(0) \
.cross(2).to(8) \
.cross(3).to(0) \
.cross(4).to(8) \
.cross(5).to(0)

design.strand(4, 10).to(13)

design.strand(6, 0).to(8).cross(7).to(0)
design.strand(8, 0).to(8).cross(9).to(0)
design.strand(13, 0).to(8).cross(15).to(0)

design.strand(8, 8).to(11)
design.strand(13, 8).to(11)


if include_rot:
design.strand(10, 0).to(8).cross(11).to(0)

return design


if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{
Expand Down
2 changes: 1 addition & 1 deletion examples/output_designs/16_helix_origami_rectangle.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 448, "grid_position": [0, 0]},
Expand Down
2 changes: 1 addition & 1 deletion examples/output_designs/16_helix_origami_rectangle_idt.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 448, "grid_position": [0, 0]},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 448, "grid_position": [0, 0]},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 448, "grid_position": [0, 0]},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 448, "grid_position": [0, 0]},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 448, "grid_position": [0, 0]},
Expand Down
2 changes: 1 addition & 1 deletion examples/output_designs/1_staple_1_helix_origami.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"grid_position": [0, 0]}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "0.10.1",
"grid": "square",
"version": "0.11.0",
"grid": "none",
"helices": [
{
"position": {"x": 1, "y": 2, "z": 3},
Expand Down
2 changes: 1 addition & 1 deletion examples/output_designs/1_staple_1_helix_origami_roll.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"grid_position": [0, 0], "roll": 90}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"grid_position": [0, 0]},
Expand Down
30 changes: 15 additions & 15 deletions examples/output_designs/2_staple_2_helix_modifications.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"grid_position": [0, 0]},
{"grid_position": [0, 1]}
],
"modifications_in_design": {
"/5Biosg/": {
"display_text": "B",
"idt_text": "/5Biosg/",
"/3Cy3Sp/": {
"display_text": "Cy3",
"idt_text": "/3Cy3Sp/",
"display_connector": false,
"location": "5'"
"location": "3'"
},
"/iCy5/": {
"display_text": "Cy5",
"idt_text": "/iCy5/",
"display_connector": false,
"location": "internal"
},
"/iBiodT/": {
"display_text": "B",
Expand All @@ -25,12 +31,6 @@
"display_connector": false,
"location": "5'"
},
"/iCy5/": {
"display_text": "Cy5",
"idt_text": "/iCy5/",
"display_connector": false,
"location": "internal"
},
"/iCy3/": {
"display_text": "Cy3",
"idt_text": "/iCy3/",
Expand All @@ -43,11 +43,11 @@
"display_connector": false,
"location": "3'"
},
"/3Cy3Sp/": {
"display_text": "Cy3",
"idt_text": "/3Cy3Sp/",
"/5Biosg/": {
"display_text": "B",
"idt_text": "/5Biosg/",
"display_connector": false,
"location": "3'"
"location": "5'"
}
},
"strands": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"grid_position": [0, 0]},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"grid_position": [0, 0]},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 48, "grid_position": [0, 0]},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 48, "grid_position": [0, 0]},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 48, "grid_position": [0, 0]},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 48, "grid_position": [0, 0]},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"geometry": {
"rise_per_base_pair": 0.2,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"grid_position": [0, 0]},
Expand Down
2 changes: 1 addition & 1 deletion examples/output_designs/3_helix_deletions_insertions.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 64, "grid_position": [0, 0]},
Expand Down
2 changes: 1 addition & 1 deletion examples/output_designs/4_helix_grid_none.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "none",
"helices": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "none",
"helices": [
{
Expand Down
2 changes: 1 addition & 1 deletion examples/output_designs/4_helix_min_offsets_nonzero.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 30, "grid_position": [0, 0]},
Expand Down
2 changes: 1 addition & 1 deletion examples/output_designs/56_helix_origami_rectangle.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 160, "grid_position": [0, 0]},
Expand Down
2 changes: 1 addition & 1 deletion examples/output_designs/64_helix_origami_rectangle.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"max_offset": 128, "grid_position": [0, 0]},
Expand Down
2 changes: 1 addition & 1 deletion examples/output_designs/6_helix_6_col_origami_rectangle.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.10.1",
"version": "0.11.0",
"grid": "square",
"helices": [
{"grid_position": [0, 0]},
Expand Down
Loading

0 comments on commit e03a5ea

Please sign in to comment.