Skip to content

Commit

Permalink
Merge pull request #123 from UC-Davis-molecular-computing/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dave-doty authored Jul 24, 2020
2 parents 1dc7f98 + 631c1f3 commit 157c9b0
Show file tree
Hide file tree
Showing 135 changed files with 5,193 additions and 4,709 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ If you are using Python 3.6 and do not wish to upgrade, you can install a packag
Python 3.7 provides the
[dataclasses module](https://docs.python.org/3/library/dataclasses.html) automatically.

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:


### 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:

1. pip (recommended)

Use [pip](https://pypi.org/project/pip/) to install the package by executing the following at the command line:
Expand Down Expand Up @@ -109,8 +111,7 @@ Once Python is installed (and the dataclasses backport if you have Python versio
* *required*: [scadnano.py](scadnano/scadnano.py)
* *optional*: [modifications.py](scadnano/modifications.py); This contains some common DNA modifications such as biotin and Cy3.
* *optional*: [origami_rectangle.py](scadnano/origami_rectangle.py); This can help create origami rectangles, but it is not necessary to use scadnano.
* *optional*: [_version.py](scadnano/_version.py) This ensures that the current version number is written into any `.sc` files written by the library; otherwise it may be out of date. (Which should not matter for the most part.)

To download them, right-click on "Raw" near the top and select (in Chrome or Firefox) "Save link as...":
![](images/download_raw_screenshot.png)
Expand Down
23 changes: 21 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,29 @@
sys.path.insert(0, os.path.abspath('../scadnano'))
# print(sys.path)

# current_version = "0.8.1"
# from scadnano.scadnano_version import current_version
# this is ugly, but appears to be standard practice:
# https://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package/17626524#17626524
__version__ = open("../scadnano/_version.py").readlines()[-1].split()[-1].strip("\"'")
# __version__ = open("scadnano/_version.py").readlines()[-1].split()[-1].strip("\"'")


# this is ugly, but appears to be standard practice:
# https://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package/17626524#17626524
def extract_version(filename: str):
with open(filename) as f:
lines = f.readlines()
version_comment = '# version line; WARNING: do not remove or change this line or comment'
for line in lines:
if version_comment in line:
idx = line.index(version_comment)
line_prefix = line[:idx]
parts = line_prefix.split('=')
stripped_parts = [part.strip() for part in parts]
version_str = stripped_parts[-1].replace('"', '')
return version_str
raise AssertionError(f'could not find version in {filename}')

__version__ = extract_version('../scadnano/scadnano.py')



Expand Down
2 changes: 1 addition & 1 deletion examples/16_helix_origami_barrel_from_algoSST_paper.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def assign_dna_to_unzipper_toeholds(design):
design.assign_dna(strand, seq)


if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
the_design = create_design()
the_design.write_scadnano_file(directory='output_designs')
the_design.write_idt_bulk_input_file(directory='idt')
Expand Down
2 changes: 1 addition & 1 deletion examples/16_helix_origami_rectangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ def create_design():
return design


if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
2 changes: 1 addition & 1 deletion examples/16_helix_origami_rectangle_idt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def create_design():
return design


if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
design.write_idt_bulk_input_file(directory='idt')
Expand Down
2 changes: 1 addition & 1 deletion examples/16_helix_origami_rectangle_no_seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ def create_design():
return design


if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
2 changes: 1 addition & 1 deletion examples/16_helix_origami_rectangle_no_seq_no_twist.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ def create_design():
return design


if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
2 changes: 1 addition & 1 deletion examples/16_helix_origami_rectangle_no_twist.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ def create_design():
return design


if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def add_adapters(design):
# design.assign_dna(tile, seq)


if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
design.write_idt_bulk_input_file(directory='idt')
Expand Down
2 changes: 1 addition & 1 deletion examples/16_helix_origami_rectangle_shifted_seam_no_seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ def create_design():
return design


if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
2 changes: 1 addition & 1 deletion examples/1_staple_1_helix_origami.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ def create_design():

return design

if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
2 changes: 1 addition & 1 deletion examples/1_staple_1_helix_origami_idt_duplicate_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ def create_design():

return design

if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_idt_bulk_input_file(directory='idt')
2 changes: 1 addition & 1 deletion examples/1_staple_1_helix_origami_mismatches.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ def create_design():
return design


if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
2 changes: 1 addition & 1 deletion examples/1_staple_1_helix_origami_position_nondefault.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ def create_design():
return design


if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
2 changes: 1 addition & 1 deletion examples/1_staple_1_helix_origami_roll.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ def create_design():

return design

if not sc.in_browser() and __name__ == '__main__':
if __name__ == '__main__':
design = create_design()
design.write_scadnano_file(directory='output_designs')
Loading

0 comments on commit 157c9b0

Please sign in to comment.