Skip to content

Commit

Permalink
Merge pull request #241 from UC-Davis-molecular-computing/240-support…
Browse files Browse the repository at this point in the history
…-extensions-in-oxdna-export

240 support extensions in oxdna export
  • Loading branch information
dave-doty authored Sep 8, 2022
2 parents 4ae1d93 + b477328 commit a46e4ad
Show file tree
Hide file tree
Showing 5 changed files with 346 additions and 87 deletions.
19 changes: 16 additions & 3 deletions examples/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,33 @@
def main() -> None:
d = create_design()
d.write_scadnano_file(directory='output_designs')
d.write_oxdna_files(directory='oxdna')


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)
helices[2].roll = 30

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")
.with_domain_name("ext_5p 1") \
.move(width).with_domain_name('domain 1') \
.cross(1).move(-width) \
.loopout(2, 3).with_domain_name('loopout 1') \
.move(width) \
.extension_3p(7).with_domain_name("ext_3p 1") \
.with_name('strand1') \
.with_sequence('TATTT' + 'G' * width + 'C' * width + 'T' * 3 + 'G' * width + 'ATAAAAA') \
.with_modification_5p(sc.cy5_5p) \
.with_modification_3p(sc.cy3_3p)

design.draw_strand(0, 24).extension_5p(5, display_length=3.5, display_angle=60) \
.with_domain_name("ext_5p 2") \
.move(-width).cross(1).move(width).loopout(2, 3).move(-width) \
.extension_3p(7).with_domain_name("ext_3p_top")
.extension_3p(7).with_domain_name("ext_3p 2") \
.with_name('strand2') \
.with_sequence('ATAAA' + 'C' * width + 'G' * width + 'A' * 3 + 'C' * width + 'TATTTTT') \

return design

Expand Down
36 changes: 28 additions & 8 deletions examples/output_designs/extensions.sc
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,49 @@
"helices": [
{"max_offset": 32, "grid_position": [0, 0]},
{"max_offset": 32, "grid_position": [0, 1]},
{"max_offset": 32, "grid_position": [0, 2]}
{"max_offset": 32, "grid_position": [0, 2], "roll": 30}
],
"modifications_in_design": {
"/3Cy3Sp/": {
"display_text": "Cy3",
"idt_text": "/3Cy3Sp/",
"display_connector": false,
"location": "3'"
},
"/5Cy5/": {
"display_text": "Cy5",
"idt_text": "/5Cy5/",
"display_connector": false,
"location": "5'"
}
},
"strands": [
{
"name": "strand1",
"color": "#f74308",
"sequence": "TATTTGGGGGGGGCCCCCCCCTTTGGGGGGGGATAAAAA",
"domains": [
{"extension_num_bases": 5, "display_length": 2.5},
{"helix": 0, "forward": true, "start": 0, "end": 8},
{"extension_num_bases": 5, "display_length": 2.5, "name": "ext_5p 1"},
{"name": "domain 1", "helix": 0, "forward": true, "start": 0, "end": 8},
{"helix": 1, "forward": false, "start": 0, "end": 8},
{"loopout": 3},
{"loopout": 3, "name": "loopout 1"},
{"helix": 2, "forward": true, "start": 0, "end": 8},
{"extension_num_bases": 7, "name": "ext_3p"}
]
{"extension_num_bases": 7, "name": "ext_3p 1"}
],
"5prime_modification": "/5Cy5/",
"3prime_modification": "/3Cy3Sp/"
},
{
"name": "strand2",
"color": "#57bb00",
"sequence": "ATAAACCCCCCCCGGGGGGGGAAACCCCCCCCTATTTTT",
"domains": [
{"extension_num_bases": 5, "display_length": 3.5, "display_angle": 60},
{"extension_num_bases": 5, "display_length": 3.5, "display_angle": 60, "name": "ext_5p 2"},
{"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"}
{"extension_num_bases": 7, "name": "ext_3p 2"}
]
}
]
Expand Down
81 changes: 81 additions & 0 deletions examples/oxdna/extensions.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
t = 0
b = 28.70476669145484 28.70476669145484 28.70476669145484
E = 0 0 0
-1.7101007166283435 -4.698463103929543 -0.6 0.0 0.0 1.0 -0.3420201433256687 -0.9396926207859084 0.0 0 0 0 0 0 0
-1.3680805733026749 -3.7587704831436337 -0.6 0.0 0.0 1.0 -0.3420201433256687 -0.9396926207859084 0.0 0 0 0 0 0 0
-1.0260604299770062 -2.8190778623577253 -0.6 0.0 0.0 1.0 -0.3420201433256687 -0.9396926207859084 0.0 0 0 0 0 0 0
-0.6840402866513374 -1.8793852415718169 -0.6 0.0 0.0 1.0 -0.3420201433256687 -0.9396926207859084 0.0 0 0 0 0 0 0
-0.3420201433256687 -0.9396926207859084 -0.6 0.0 0.0 1.0 -0.3420201433256687 -0.9396926207859084 0.0 0 0 0 0 0 0
-0.20521208599540122 -0.563815572471545 0.0 0.3420201433256687 0.9396926207859084 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.14805443861417622 -0.5814463717374467 0.3897628551303123 -0.2467573976902937 0.969077286229078 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.4498687217806405 -0.39701150255811557 0.7795257102606246 -0.7497812029677342 0.6616858375968593 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.5953435239601033 -0.07460622278849112 1.1692885653909368 -0.9922392066001721 0.1243437046474852 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.5339230852868811 0.2737263944118978 1.5590514205212491 -0.8898718088114685 -0.456210657353163 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.2869523871727911 0.5269329440221371 1.9488142756515616 -0.47825397862131847 -0.8782215733702284 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
-0.059740707957489946 0.5970184652192408 2.3385771307818737 0.09956784659581658 -0.9950307753654014 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
-0.3856725658119234 0.459626665871387 2.728339985912186 0.642787609686539 -0.7660444431189783 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.45962666587138673 3.136280944401741 2.728339985912186 -0.7660444431189779 0.6427876096865397 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.16250428088580307 2.9443789620436576 2.3385771307818737 -0.2708404681430051 0.962624246950012 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
-0.19109199015101078 2.953197102513386 1.9488142756515616 0.31848665025168466 0.9479273461671317 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
-0.4782795043337535 3.1596708640183784 1.5590514205212491 0.7971325072229225 0.6038044103254775 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
-0.5992541527313534 3.492045978817247 1.1692885653909368 0.9987569212189223 0.04984588566069714 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
-0.5119745289792934 3.834814632241364 0.7795257102606246 0.8532908816321557 -0.521435203379498 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
-0.24677226187836698 4.068857021600669 0.3897628551303123 0.4112871031306117 -0.9115058523116731 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.10418890660015818 4.1128381620209895 0.0 -0.1736481776669303 -0.9848077530122081 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.0 4.402441887767081 0.6 -0.0 -0.0 -1.0 0.0 1.0 0.0 0 0 0 0 0 0
0.0 5.2829302653204975 0.6 -0.0 -0.0 -1.0 0.0 1.0 0.0 0 0 0 0 0 0
0.0 6.163418642873914 0.6 -0.0 -0.0 -1.0 0.0 1.0 0.0 0 0 0 0 0 0
0.10418890660015818 6.4530223686200054 0.0 -0.1736481776669303 0.9848077530122081 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.4189420908516437 6.614386910871499 0.3897628551303123 -0.6982368180860729 0.7158668492597186 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.5881034927091263 6.925019334507692 0.7795257102606246 -0.9801724878485439 0.1981461431993976 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.5528857271222446 7.276967898192146 1.1692885653909368 -0.9214762118704077 -0.3884347962746946 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.32552775831945563 7.547922574317793 1.5590514205212491 -0.5425462638657594 -0.8400259231507715 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
-0.01495841504284353 7.64372052962782 1.9488142756515616 0.024930691738072552 -0.9996891820008164 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
-0.3502462033408738 7.531069823856844 2.3385771307818737 0.5837436722347897 -0.8119380057158566 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
-0.563815572471545 7.249119106422731 2.728339985912186 0.9396926207859084 -0.34202014332566927 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
-0.9396926207859084 7.385927163752999 2.128339985912186 0.0 0.0 1.0 -0.9396926207859084 0.34202014332566927 0.0 0 0 0 0 0 0
-1.8793852415718169 7.727947307078669 2.128339985912186 0.0 0.0 1.0 -0.9396926207859084 0.34202014332566927 0.0 0 0 0 0 0 0
-2.8190778623577253 8.069967450404338 2.128339985912186 0.0 0.0 1.0 -0.9396926207859084 0.34202014332566927 0.0 0 0 0 0 0 0
-3.7587704831436337 8.411987593730007 2.128339985912186 0.0 0.0 1.0 -0.9396926207859084 0.34202014332566927 0.0 0 0 0 0 0 0
-4.698463103929543 8.754007737055677 2.128339985912186 0.0 0.0 1.0 -0.9396926207859084 0.34202014332566927 0.0 0 0 0 0 0 0
-5.6381557247154515 9.096027880381346 2.128339985912186 0.0 0.0 1.0 -0.9396926207859084 0.34202014332566927 0.0 0 0 0 0 0 0
-6.57784834550136 9.438048023707015 2.128339985912186 0.0 0.0 1.0 -0.9396926207859084 0.34202014332566927 0.0 0 0 0 0 0 0
-4.26645440816078 2.607176016897488 9.564545667997182 -0.0 -0.0 -1.0 -0.853290881632156 0.5214352033794976 0.0 0 0 0 0 0 0
-3.413163526528624 2.0857408135179902 9.564545667997182 -0.0 -0.0 -1.0 -0.853290881632156 0.5214352033794976 0.0 0 0 0 0 0 0
-2.559872644896468 1.5643056101384927 9.564545667997182 -0.0 -0.0 -1.0 -0.853290881632156 0.5214352033794976 0.0 0 0 0 0 0 0
-1.706581763264312 1.0428704067589951 9.564545667997182 -0.0 -0.0 -1.0 -0.853290881632156 0.5214352033794976 0.0 0 0 0 0 0 0
-0.853290881632156 0.5214352033794976 9.564545667997182 -0.0 -0.0 -1.0 -0.853290881632156 0.5214352033794976 0.0 0 0 0 0 0 0
-0.5119745289792936 0.3128611220276985 8.964545667997182 0.853290881632156 -0.5214352033794976 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
-0.24677226187836604 0.5469035113870042 8.57478281286687 0.41128710313061007 -0.9115058523116738 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.10418890660015846 0.5908846518073247 8.185019957736559 -0.17364817766693078 -0.984807753012208 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.4189420908516441 0.4295201095558306 7.7952571026062465 -0.6982368180860735 -0.7158668492597177 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.5881034927091264 0.11888768591963762 7.405494247475934 -0.9801724878485442 -0.19814614319939605 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.5528857271222446 -0.23306087776481704 7.0157313923456215 -0.9214762118704076 0.38843479627469507 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.3255277583194561 -0.5040155538904626 6.625968537215309 -0.5425462638657601 0.8400259231507711 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
-0.014958415042843565 -0.5998135092004898 6.2362056820849965 0.024930691738072608 0.9996891820008164 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.11888768591963841 4.110057002922791 6.2362056820849965 -0.19814614319939736 -0.9801724878485439 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
-0.23306087776481726 4.074839237335909 6.625968537215309 0.38843479627469546 -0.9214762118704074 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
-0.5040155538904627 3.847481268533121 7.0157313923456215 0.8400259231507712 -0.5425462638657598 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
-0.5998135092004897 3.506995095170822 7.405494247475934 0.9996891820008162 0.024930691738071276 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
-0.48716280342951424 3.1717073068727917 7.7952571026062465 0.8119380057158571 0.5837436722347891 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
-0.2052120859954015 2.95813793774212 8.185019957736559 0.34202014332566916 0.9396926207859082 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.14805443861417522 2.940507138476218 8.57478281286687 -0.24675739769029204 0.9690772862290784 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.4498687217806408 3.12494200765555 8.964545667997182 -0.7497812029677347 0.661685837596859 -0.0 -0.0 -0.0 -1.0 0 0 0 0 0 0
0.0 4.402441887767081 9.564545667997182 -0.0 -0.0 -1.0 0.0 1.0 0.0 0 0 0 0 0 0
0.0 5.2829302653204975 9.564545667997182 -0.0 -0.0 -1.0 0.0 1.0 0.0 0 0 0 0 0 0
0.0 6.163418642873914 9.564545667997182 -0.0 -0.0 -1.0 0.0 1.0 0.0 0 0 0 0 0 0
-0.5998135092004897 7.058865435470174 8.964545667997182 0.9996891820008162 -0.024930691738072275 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
-0.4871628034295133 7.394153223768205 8.57478281286687 0.8119380057158555 -0.5837436722347913 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
-0.20521208599540094 7.607722592898875 8.185019957736559 0.34202014332566827 -0.9396926207859086 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.1480544386141768 7.625353392164777 7.7952571026062465 -0.2467573976902947 -0.9690772862290777 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.4498687217806412 7.440918522985445 7.405494247475934 -0.7497812029677353 -0.6616858375968582 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.5953435239601033 7.118513243215821 7.0157313923456215 -0.9922392066001722 -0.1243437046474847 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.5339230852868814 6.770180626015432 6.625968537215309 -0.889871808811469 0.45621065735316235 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.286952387172791 6.516974076405193 6.2362056820849965 -0.47825397862131835 0.8782215733702284 -0.0 0.0 0.0 1.0 0 0 0 0 0 0
0.47825397862131835 6.165685447057101 6.836205682084996 -0.0 -0.0 -1.0 0.47825397862131835 -0.8782215733702284 0.0 0 0 0 0 0 0
0.9565079572426367 5.287463873686873 6.836205682084996 -0.0 -0.0 -1.0 0.47825397862131835 -0.8782215733702284 0.0 0 0 0 0 0 0
1.4347619358639552 4.409242300316644 6.836205682084996 -0.0 -0.0 -1.0 0.47825397862131835 -0.8782215733702284 0.0 0 0 0 0 0 0
1.9130159144852734 3.5310207269464158 6.836205682084996 -0.0 -0.0 -1.0 0.47825397862131835 -0.8782215733702284 0.0 0 0 0 0 0 0
2.3912698931065917 2.6527991535761872 6.836205682084996 -0.0 -0.0 -1.0 0.47825397862131835 -0.8782215733702284 0.0 0 0 0 0 0 0
2.86952387172791 1.7745775802059587 6.836205682084996 -0.0 -0.0 -1.0 0.47825397862131835 -0.8782215733702284 0.0 0 0 0 0 0 0
3.347777850349228 0.8963560068357302 6.836205682084996 -0.0 -0.0 -1.0 0.47825397862131835 -0.8782215733702284 0.0 0 0 0 0 0 0
79 changes: 79 additions & 0 deletions examples/oxdna/extensions.top
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
78 2
1 T 1 -1
1 A 2 0
1 T 3 1
1 T 4 2
1 T 5 3
1 G 6 4
1 G 7 5
1 G 8 6
1 G 9 7
1 G 10 8
1 G 11 9
1 G 12 10
1 G 13 11
1 C 14 12
1 C 15 13
1 C 16 14
1 C 17 15
1 C 18 16
1 C 19 17
1 C 20 18
1 C 21 19
1 T 22 20
1 T 23 21
1 T 24 22
1 G 25 23
1 G 26 24
1 G 27 25
1 G 28 26
1 G 29 27
1 G 30 28
1 G 31 29
1 G 32 30
1 A 33 31
1 T 34 32
1 A 35 33
1 A 36 34
1 A 37 35
1 A 38 36
1 A -1 37
2 A 40 -1
2 T 41 39
2 A 42 40
2 A 43 41
2 A 44 42
2 C 45 43
2 C 46 44
2 C 47 45
2 C 48 46
2 C 49 47
2 C 50 48
2 C 51 49
2 C 52 50
2 G 53 51
2 G 54 52
2 G 55 53
2 G 56 54
2 G 57 55
2 G 58 56
2 G 59 57
2 G 60 58
2 A 61 59
2 A 62 60
2 A 63 61
2 C 64 62
2 C 65 63
2 C 66 64
2 C 67 65
2 C 68 66
2 C 69 67
2 C 70 68
2 C 71 69
2 T 72 70
2 A 73 71
2 T 74 72
2 T 75 73
2 T 76 74
2 T 77 75
2 T -1 76
Loading

0 comments on commit a46e4ad

Please sign in to comment.