Skip to content

Commit

Permalink
Merge pull request #161 from UC-Davis-molecular-computing/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dave-doty authored Jan 14, 2021
2 parents 434ccc4 + cfb2ffd commit e0cd9c8
Show file tree
Hide file tree
Showing 78 changed files with 1,087 additions and 708 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ Please report issues in the web interface at the [scadnano web interface GitHub

## Installation

Short version: type this at the command line:

```console
pip install scadnano
```

Read below for troubleshooting suggestions if that didn't work.

### Getting Python
The scadnano Python package requires Python version 3.7 or later (with a workaround available for version 3.6, but not for any lower version).

Expand Down Expand Up @@ -73,6 +81,17 @@ Once Python is installed (and the dataclasses backport if you have Python versio
pip install scadnano
```

If it worked, you should be able to open a Python interpreter and import the scadnano module:

```console
Python 3.7.9 (default, Aug 31 2020, 17:10:11) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import scadnano as sc
>>> print(sc.Domain(helix=1, forward=True, start=0, end=8))
Domain(, helix=1, forward=True, start=0, end=8)
>>>
```

### Troubleshooting
If the above does not work for you, here are some things to try.

Expand Down Expand Up @@ -193,7 +212,7 @@ def create_design():
helices = [sc.Helix(max_offset=48), sc.Helix(max_offset=48)]

# whole design
design = sc.Design(helices=helices, strands=[], grid=sc.square)
design = sc.Design(helices=helices, grid=sc.square)

# for absolute offsets, call method "to"
# left staple
Expand Down
30 changes: 14 additions & 16 deletions examples/16_helix_origami_barrel_from_algoSST_paper.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,11 @@ def add_adapters(design: sc.Design) -> None:
for bot_helix in range(2, 18, 2):
top_helix = bot_helix - 1 if bot_helix != 2 else 17
dom_top = sc.Domain(helix=top_helix, forward=True,
start=left_outside_seed, end=left_inside_seed)
start=left_outside_seed, end=left_inside_seed)
dom_bot = sc.Domain(helix=bot_helix, forward=False,
start=left_outside_seed, end=left_inside_seed)
idt = sc.IDTFields(name=f'adap-left-{top_helix}-{bot_helix}',
scale='25nm', purification='STD')
adapter = sc.Strand(domains=[dom_bot, dom_top], idt=idt)
start=left_outside_seed, end=left_inside_seed)
idt = sc.IDTFields(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[dom_bot, dom_top], name=f'adap-left-{top_helix}-{bot_helix}', idt=idt)
design.add_strand(adapter)

# right adapters
Expand All @@ -121,12 +120,11 @@ def add_adapters(design: sc.Design) -> None:
for bot_helix in range(2, 18, 2):
top_helix = bot_helix - 1 if bot_helix != 2 else 17
dom_top = sc.Domain(helix=top_helix, forward=True,
start=right_inside_seed, end=right_outside_seed)
start=right_inside_seed, end=right_outside_seed)
dom_bot = sc.Domain(helix=bot_helix, forward=False,
start=right_inside_seed, end=right_outside_seed)
idt = sc.IDTFields(name=f'adap-right-{top_helix}-{bot_helix}',
scale='25nm', purification='STD')
adapter = sc.Strand(domains=[dom_top, dom_bot], idt=idt)
start=right_inside_seed, end=right_outside_seed)
idt = sc.IDTFields(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[dom_top, dom_bot], name=f'adap-right-{top_helix}-{bot_helix}', idt=idt)
design.add_strand(adapter)


Expand Down Expand Up @@ -163,9 +161,9 @@ def add_tiles_and_assign_dna(design: sc.Design) -> None:
start=left_left, end=left_right)
ss_bot = sc.Domain(helix=bot_helix, forward=False,
start=left_left, end=left_right)
idt = sc.IDTFields(name=f'tile-left-{top_helix}-{bot_helix}',
scale='25nm', purification='STD')
tile = sc.Strand(domains=[ss_bot, ss_top], color=sc.Color(0, 0, 0), idt=idt)
idt = sc.IDTFields(scale='25nm', purification='STD')
tile = sc.Strand(domains=[ss_bot, ss_top], name=f'tile-left-{top_helix}-{bot_helix}',
color=sc.Color(0, 0, 0), idt=idt)
design.add_strand(tile)
design.assign_dna(tile, seq)

Expand All @@ -178,9 +176,9 @@ def add_tiles_and_assign_dna(design: sc.Design) -> None:
start=right_left, end=right_right)
ss_bot = sc.Domain(helix=bot_helix, forward=False,
start=right_left, end=right_right)
idt = sc.IDTFields(name=f'tile-right-{top_helix}-{bot_helix}',
scale='25nm', purification='STD')
tile = sc.Strand(domains=[ss_bot, ss_top], color=sc.Color(0, 0, 0), idt=idt)
idt = sc.IDTFields(scale='25nm', purification='STD')
tile = sc.Strand(domains=[ss_bot, ss_top], name=f'tile-right-{top_helix}-{bot_helix}',
color=sc.Color(0, 0, 0), idt=idt)
design.add_strand(tile)
design.assign_dna(tile, seq)

Expand Down
10 changes: 4 additions & 6 deletions examples/16_helix_origami_rectangle_seed_tiles_grow_from_top.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ def add_adapters(design: sc.Design) -> None:
start=left_outside_seed, end=left_inside_seed)
ss_bot = sc.Domain(helix=bot_helix, forward=False,
start=left_outside_seed, end=left_inside_seed)
idt = sc.IDTFields(name=f'adap-left-{top_helix}-{bot_helix}',
scale='25nm', purification='STD')
adapter = sc.Strand(domains=[ss_bot, ss_top], idt=idt)
idt = sc.IDTFields(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[ss_bot, ss_top], name=f'adap-left-{top_helix}-{bot_helix}', idt=idt)
design.add_strand(adapter)

# right adapters
Expand All @@ -87,9 +86,8 @@ def add_adapters(design: sc.Design) -> None:
start=right_inside_seed, end=right_outside_seed)
ss_bot = sc.Domain(helix=bot_helix, forward=False,
start=right_inside_seed, end=right_outside_seed)
idt = sc.IDTFields(name=f'adap-right-{top_helix}-{bot_helix}',
scale='25nm', purification='STD')
adapter = sc.Strand(domains=[ss_top, ss_bot], idt=idt)
idt = sc.IDTFields(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[ss_top, ss_bot], name=f'adap-right-{top_helix}-{bot_helix}', idt=idt)
design.add_strand(adapter)


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
Expand Up @@ -6,10 +6,10 @@ def create_design() -> sc.Design:
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'))
s3_r = sc.Strand([ss3_r], idt=sc.IDTFields('s1_r'))
s_l = sc.Strand([ss_l], idt=sc.IDTFields('s_l'))
s1_r = sc.Strand([ss1_r], idt=sc.IDTFields(), name='s1_r')
s2_r = sc.Strand([ss2_r], idt=sc.IDTFields(), name='s1_r')
s3_r = sc.Strand([ss3_r], idt=sc.IDTFields(), name='s1_r')
s_l = sc.Strand([ss_l], idt=sc.IDTFields(), name='s_l')

strands = [s1_r, s2_r, s3_r, s_l]

Expand Down
4 changes: 2 additions & 2 deletions examples/idt-plates-explicit.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def create_design() -> sc.Design:
row = ROWS[row_idx]
col = COLS[col_idx]
well = f'{row}{col}'
idt = sc.IDTFields(name=f"staple{s}", plate=f'plate{plate}', well=well)
idt = sc.IDTFields(plate=f'plate{plate}', well=well)

strand = sc.Strand(domains=[ss_f, ss_r], idt=idt)
strand = sc.Strand(domains=[ss_f, ss_r], idt=idt, name=f'staple{s}')
strands.append(strand)
row_idx += 1
if row_idx == len(ROWS):
Expand Down
Loading

0 comments on commit e0cd9c8

Please sign in to comment.