-
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 #307 from UC-Davis-molecular-computing/306-allow-p…
…er-helix-group-geometry 306 allow per helix group geometry
- Loading branch information
Showing
10 changed files
with
103 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ channels: | |
- defaults | ||
dependencies: | ||
- python=3.7 | ||
- xlwt=1.3.0=py37_0 | ||
- pip | ||
- pip: | ||
- sphinx | ||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import math | ||
|
||
import scadnano as sc | ||
|
||
def create_design() -> sc.Design: | ||
|
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 @@ | ||
import scadnano as sc | ||
|
||
|
||
def create_design() -> sc.Design: | ||
group0 = sc.HelixGroup(grid=sc.square) | ||
group1 = sc.HelixGroup(grid=sc.square, geometry=sc.Geometry(bases_per_turn=18), | ||
position=sc.Position3D(0, 3, 0)) | ||
groups = {"group 0": group0, "group 1": group1} | ||
helices = [sc.Helix(idx=idx, max_offset=40, group=group) for idx, group in | ||
[(0, "group 0"), (1, "group 1")]] | ||
design = sc.Design(helices=helices, groups=groups, strands=[]) | ||
design.draw_strand(0, 0).move(40) | ||
design.draw_strand(0, 40).move(-40) | ||
design.draw_strand(1, 0).move(40) | ||
design.draw_strand(1, 40).move(-40) | ||
|
||
return design | ||
|
||
|
||
if __name__ == '__main__': | ||
d = create_design() | ||
d.write_scadnano_file(directory='output_designs') | ||
d.from_scadnano_file('output_designs/2_staple_2_helix_helixgroup_geometry.sc') | ||
print(f'design: {d.to_json()}') |
46 changes: 46 additions & 0 deletions
46
examples/output_designs/2_staple_2_helix_helixgroup_geometry.sc
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,46 @@ | ||
{ | ||
"version": "0.19.4", | ||
"groups": { | ||
"group 0": { | ||
"position": {"x": 0, "y": 0, "z": 0}, | ||
"grid": "square" | ||
}, | ||
"group 1": { | ||
"position": {"x": 0, "y": 3, "z": 0}, | ||
"grid": "square", | ||
"geometry": { | ||
"bases_per_turn": 18 | ||
} | ||
} | ||
}, | ||
"helices": [ | ||
{"group": "group 0", "grid_position": [0, 0]}, | ||
{"group": "group 1", "grid_position": [0, 0]} | ||
], | ||
"strands": [ | ||
{ | ||
"color": "#f74308", | ||
"domains": [ | ||
{"helix": 0, "forward": true, "start": 0, "end": 40} | ||
] | ||
}, | ||
{ | ||
"color": "#57bb00", | ||
"domains": [ | ||
{"helix": 0, "forward": false, "start": 0, "end": 40} | ||
] | ||
}, | ||
{ | ||
"color": "#888888", | ||
"domains": [ | ||
{"helix": 1, "forward": true, "start": 0, "end": 40} | ||
] | ||
}, | ||
{ | ||
"color": "#32b86c", | ||
"domains": [ | ||
{"helix": 1, "forward": false, "start": 0, "end": 40} | ||
] | ||
} | ||
] | ||
} |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.