-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from UC-Davis-molecular-computing/dev
Dev
- Loading branch information
Showing
12 changed files
with
1,695 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import scadnano as sc | ||
|
||
def create_design() -> sc.Design: | ||
# shows how to make consecutive domains on a helix, separated by a crossover that appears horizontal | ||
# this is useful when doing single-stranded tile designs, for instance, or any other design | ||
# where we have consecutive domains on a single helix. | ||
# | ||
# 0 [------+^+------> | ||
# | ||
# 1 <------+^+------] | ||
design = sc.Design(helices=[sc.Helix(100), sc.Helix(100)], grid=sc.square) | ||
design.draw_strand(0, 0).move(8).move(8) | ||
design.draw_strand(1, 16).move(-8).move(-8) | ||
|
||
# XXX: the following code raises an exception because it tries to add a crossover where | ||
# there already is one. This can be surprising since it would work with the following | ||
# similar-looking design that has a single longer domain per strand | ||
# | ||
# 0 [------------> | ||
# | ||
# 1 <------------] | ||
design.add_full_crossover(helix=0, helix2=1, offset=8, forward=True) | ||
|
||
return design | ||
|
||
if __name__ == '__main__': | ||
d = create_design() | ||
d.write_scadnano_file(directory='output_designs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import scadnano as sc | ||
|
||
|
||
def create_design() -> sc.Design: | ||
width = 8 | ||
helices = [sc.Helix(max_offset=32) for _ in range(3)] | ||
design = sc.Design(helices=helices, grid=sc.square) | ||
|
||
design.draw_strand(0, 0).extension_5p(5, display_length=2.5, display_angle=45)\ | ||
.move(width).cross(1).move(-width).loopout(2, 3).move(width)\ | ||
.extension_3p(7).with_domain_name("ext_3p") | ||
|
||
design.draw_strand(0, 24).extension_5p(5, display_length=3.5, display_angle=60)\ | ||
.move(-width).cross(1).move(width).loopout(2, 3).move(-width)\ | ||
.extension_3p(7).with_domain_name("ext_3p_top") | ||
|
||
return design | ||
|
||
|
||
if __name__ == '__main__': | ||
d = create_design() | ||
d.write_scadnano_file(directory='output_designs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"version": "0.17.3", | ||
"grid": "square", | ||
"helices": [ | ||
{"max_offset": 100, "grid_position": [0, 0]}, | ||
{"max_offset": 100, "grid_position": [0, 1]} | ||
], | ||
"strands": [ | ||
{ | ||
"color": "#f74308", | ||
"domains": [ | ||
{"helix": 0, "forward": true, "start": 0, "end": 8}, | ||
{"helix": 0, "forward": true, "start": 8, "end": 16} | ||
] | ||
}, | ||
{ | ||
"color": "#57bb00", | ||
"domains": [ | ||
{"helix": 1, "forward": false, "start": 8, "end": 16}, | ||
{"helix": 1, "forward": false, "start": 0, "end": 8} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"version": "0.17.3", | ||
"grid": "square", | ||
"helices": [ | ||
{"max_offset": 32, "grid_position": [0, 0]}, | ||
{"max_offset": 32, "grid_position": [0, 1]}, | ||
{"max_offset": 32, "grid_position": [0, 2]} | ||
], | ||
"strands": [ | ||
{ | ||
"color": "#f74308", | ||
"domains": [ | ||
{"extension_num_bases": 5, "display_length": 2.5}, | ||
{"helix": 0, "forward": true, "start": 0, "end": 8}, | ||
{"helix": 1, "forward": false, "start": 0, "end": 8}, | ||
{"loopout": 3}, | ||
{"helix": 2, "forward": true, "start": 0, "end": 8}, | ||
{"extension_num_bases": 7, "name": "ext_3p"} | ||
] | ||
}, | ||
{ | ||
"color": "#57bb00", | ||
"domains": [ | ||
{"extension_num_bases": 5, "display_length": 3.5, "display_angle": 60}, | ||
{"helix": 0, "forward": false, "start": 16, "end": 24}, | ||
{"helix": 1, "forward": true, "start": 16, "end": 24}, | ||
{"loopout": 3}, | ||
{"helix": 2, "forward": false, "start": 16, "end": 24}, | ||
{"extension_num_bases": 7, "name": "ext_3p_top"} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"version": "0.17.3", | ||
"grid": "square", | ||
"helices": [ | ||
{"grid_position": [0, 0]}, | ||
{"grid_position": [0, 1]}, | ||
{"grid_position": [0, 2]}, | ||
{"grid_position": [0, 3]}, | ||
{"grid_position": [0, 4]}, | ||
{"grid_position": [0, 5]}, | ||
{"grid_position": [0, 6]}, | ||
{"grid_position": [0, 7]}, | ||
{"grid_position": [0, 8]}, | ||
{"grid_position": [0, 9]}, | ||
{"grid_position": [0, 10]}, | ||
{"grid_position": [0, 11]}, | ||
{"grid_position": [0, 12]}, | ||
{"grid_position": [0, 13]}, | ||
{"grid_position": [0, 14]}, | ||
{"grid_position": [0, 15]}, | ||
{"grid_position": [0, 16]}, | ||
{"grid_position": [0, 17]}, | ||
{"grid_position": [0, 18]}, | ||
{"grid_position": [0, 19]}, | ||
{"grid_position": [0, 20]}, | ||
{"grid_position": [0, 21]}, | ||
{"grid_position": [0, 22]}, | ||
{"grid_position": [0, 23]}, | ||
{"grid_position": [0, 24]}, | ||
{"grid_position": [0, 25]}, | ||
{"grid_position": [0, 26]}, | ||
{"grid_position": [0, 27]}, | ||
{"grid_position": [0, 28]}, | ||
{"grid_position": [0, 29]}, | ||
{"grid_position": [0, 30]}, | ||
{"grid_position": [0, 31]} | ||
], | ||
"strands": [ | ||
{ | ||
"color": "#0066cc", | ||
"domains": [ | ||
{"helix": 0, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 1, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 2, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 3, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 4, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 5, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 6, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 7, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 8, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 9, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 10, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 11, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 12, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 13, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 14, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 15, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 16, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 17, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 18, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 19, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 20, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 21, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 22, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 23, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 24, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 25, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 26, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 27, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 28, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 29, "forward": false, "start": 0, "end": 200}, | ||
{"helix": 30, "forward": true, "start": 0, "end": 200}, | ||
{"helix": 31, "forward": false, "start": 0, "end": 200} | ||
], | ||
"is_scaffold": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import scadnano as sc | ||
|
||
def create_design() -> sc.Design: | ||
num_helices = 32 | ||
helices = [sc.Helix(max_offset=200) for _ in range(num_helices)] | ||
design = sc.Design(helices=helices, grid=sc.square) | ||
strand_builder = design.draw_strand(0, 0) | ||
for helix in range(num_helices): | ||
# move forward if on an even helix, otherwise move in reverse | ||
move_distance = 200 if helix % 2 == 0 else -200 | ||
strand_builder.move(move_distance) | ||
if helix < 31: # crossover to next helix, unless it's the last helix | ||
strand_builder.cross(helix + 1) | ||
strand_builder.as_scaffold() | ||
return design | ||
|
||
|
||
if __name__ == '__main__': | ||
design = create_design() | ||
design.write_scadnano_file(directory='output_designs') |
Oops, something went wrong.