Skip to content

Commit

Permalink
Merge pull request #285 from UC-Davis-molecular-computing/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dave-doty authored Sep 7, 2023
2 parents 976ee4d + 82661bb commit f415a47
Show file tree
Hide file tree
Showing 70 changed files with 34,083 additions and 33,968 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ 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).
The scadnano Python package requires Python version 3.7 or later.

To check your current version of Python, open a command line and type

Expand All @@ -79,17 +79,13 @@ If it is version 2.7 or below, type
python3 --version
```

If that fails, or reports Python version 3.5 or below, you will have to install a later version of Python (recommended at least 3.7). Follow [this link](https://www.python.org/downloads/) to install Python. You may also use an alternative Python distribution, such as [Anaconda](https://www.anaconda.com/products/individual#Downloads).

If you are using Python 3.6 and do not wish to upgrade, you can install a package providing the required features: the [dataclasses backport](https://pypi.org/project/dataclasses/); see `pip` instructions below to see how to install it.
Python 3.7 provides the
[dataclasses module](https://docs.python.org/3/library/dataclasses.html) automatically.
If that fails, or reports Python version 3.6 or below, you will have to install a later version of Python. Follow [this link](https://www.python.org/downloads/) to install Python. You may also use an alternative Python distribution, such as [Anaconda](https://www.anaconda.com/products/individual#Downloads).



### Installing the scadnano Python package

Once Python is installed (and the dataclasses backport if you have Python version 3.6), there are two ways you can install the scadnano Python package:
Once Python is installed, there are two ways you can install the scadnano Python package:

1. pip (recommended)

Expand Down
18 changes: 10 additions & 8 deletions examples/16_helix_origami_barrel_from_algoSST_paper.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ def add_adapters(design: sc.Design) -> None:
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(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[dom_bot, dom_top], name=f'adap-left-{top_helix}-{bot_helix}', idt=idt)
idt = sc.VendorFields(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[dom_bot, dom_top], name=f'adap-left-{top_helix}-{bot_helix}',
vendor_fields=idt)
design.add_strand(adapter)

# right adapters
Expand All @@ -123,8 +124,9 @@ def add_adapters(design: sc.Design) -> None:
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(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[dom_top, dom_bot], name=f'adap-right-{top_helix}-{bot_helix}', idt=idt)
idt = sc.VendorFields(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[dom_top, dom_bot], name=f'adap-right-{top_helix}-{bot_helix}',
vendor_fields=idt)
design.add_strand(adapter)


Expand Down Expand Up @@ -161,9 +163,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(scale='25nm', purification='STD')
idt = sc.VendorFields(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)
color=sc.Color(0, 0, 0), vendor_fields=idt)
design.add_strand(tile)
design.assign_dna(tile, seq)

Expand All @@ -176,9 +178,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(scale='25nm', purification='STD')
idt = sc.VendorFields(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)
color=sc.Color(0, 0, 0), vendor_fields=idt)
design.add_strand(tile)
design.assign_dna(tile, seq)

Expand Down
12 changes: 7 additions & 5 deletions examples/16_helix_origami_rectangle_seed_tiles_grow_from_top.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def set_helix_major_ticks(design: sc.Design) -> None:
for helix in design.helices.values():
helix.major_ticks = list(major_ticks)

for _,helix in zip([0,1,2], design.helices.values()):
for _, helix in zip([0, 1, 2], design.helices.values()):
ticks = [11, 22, 32, 40, 48]
tick = 58
offset = 11
Expand Down Expand Up @@ -73,8 +73,9 @@ 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(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[ss_bot, ss_top], name=f'adap-left-{top_helix}-{bot_helix}', idt=idt)
idt = sc.VendorFields(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[ss_bot, ss_top], name=f'adap-left-{top_helix}-{bot_helix}',
vendor_fields=idt)
design.add_strand(adapter)

# right adapters
Expand All @@ -86,8 +87,9 @@ 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(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[ss_top, ss_bot], name=f'adap-right-{top_helix}-{bot_helix}', idt=idt)
idt = sc.VendorFields(scale='25nm', purification='STD')
adapter = sc.Strand(domains=[ss_top, ss_bot], name=f'adap-right-{top_helix}-{bot_helix}',
vendor_fields=idt)
design.add_strand(adapter)


Expand Down
12 changes: 7 additions & 5 deletions examples/1_staple_1_helix_origami_idt_duplicate_names.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import scadnano as sc


def create_design() -> sc.Design:
ss1_r = sc.Domain(0, True, 0, 4)
ss2_r = sc.Domain(0, True, 4, 8)
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(), 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')
s1_r = sc.Strand([ss1_r], vendor_fields=sc.VendorFields(), name='s1_r')
s2_r = sc.Strand([ss2_r], vendor_fields=sc.VendorFields(), name='s1_r')
s3_r = sc.Strand([ss3_r], vendor_fields=sc.VendorFields(), name='s1_r')
s_l = sc.Strand([ss_l], vendor_fields=sc.VendorFields(), name='s_l')

strands = [s1_r, s2_r, s3_r, s_l]

design = sc.Design(strands=strands, grid=sc.square)

design.assign_dna(s_l, 'AGTT'*3)
design.assign_dna(s_l, 'AGTT' * 3)

return design


if __name__ == '__main__':
d = create_design()
d.write_idt_bulk_input_file(directory='idt')
4 changes: 3 additions & 1 deletion examples/consecutive_domains.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
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
Expand All @@ -19,10 +20,11 @@ def create_design() -> sc.Design:
# 0 [------------>
#
# 1 <------------]
design.add_full_crossover(helix=0, helix2=1, offset=8, forward=True)
# 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')
4 changes: 2 additions & 2 deletions examples/idt-plates-explicit.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def create_design() -> sc.Design:
row = ROWS[row_idx]
col = COLS[col_idx]
well = f'{row}{col}'
idt = sc.IDTFields(plate=f'plate{plate}', well=well)
idt = sc.VendorFields(plate=f'plate{plate}', well=well)

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

0 comments on commit f415a47

Please sign in to comment.