Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Issue #2, SIGALRM error #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .travis.yml
@@ -0,0 +1,18 @@
language: python
python:
- "3.8"
- "3.9"

# command to install dependencies
install:
- pip install -r requirements.txt
- pip install pytest-cov pytest
- pip install codecov
- pip install .

# command to run tests
script:
- pytest --cov-report term --cov=nuskell/

after_success:
- codecov
99 changes: 37 additions & 62 deletions README.md
@@ -1,77 +1,49 @@
# Nuskell: a nucleic acid strand displacement compiler
# Nuskell: nucleic acid strand displacement compiler

[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/DNA-and-Natural-Algorithms-Group/nuskell)](https://github.com/DNA-and-Natural-Algorithms-Group/nuskell/tags)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/DNA-and-Natural-Algorithms-Group/nuskell?include_prereleases)](https://github.com/DNA-and-Natural-Algorithms-Group/nuskell/releases)
![build](https://github.com/DNA-and-Natural-Algorithms-Group/nuskell/actions/workflows/python-package.yml/badge.svg)
[![Codecov](https://img.shields.io/codecov/c/github/dna-and-natural-algorithms-group/nuskell)](https://codecov.io/gh/dna-and-natural-algorithms-group/nuskell)
[![PyPI version](https://badge.fury.io/py/nuskell.svg)](https://badge.fury.io/py/nuskell)
[![PyPI - License](https://img.shields.io/pypi/l/nuskell)](https://opensource.org/licenses/MIT)
[![Build Status](https://travis-ci.com/DNA-and-Natural-Algorithms-Group/nuskell.svg?branch=master)](https://travis-ci.com/github/DNA-and-Natural-Algorithms-Group/nuskell)
[![Codecov branch](https://img.shields.io/codecov/c/github/DNA-and-Natural-Algorithms-Group/nuskell/master)](https://codecov.io/gh/DNA-and-Natural-Algorithms-Group/nuskell)

**Nuskell** is a compiler framework to translate formal chemical reaction
networks (CRNs) into domain-level strand displacement (DSD) systems.
To support the diversity of proposed CRN-to-DSD translation methods
from literature, as well as potential new CRN-to-DSD translation
methods that are yet to be developed, Nuskell provides a *domain-specific
programming language*. In this language, CRN-to-DSD translations can be
formulated as algorithms: so-called *translation schemes*. We provide a
library of selected existing [translation schemes] that users can use
without understanding the details of the Nuskell programming language.
``Nuskell`` is software framework to compile formal chemical reaction networks
(CRNs) into domain-level strand displacement (DSD) systems. As there are many
ways to do such a translation, we provide a library of [translation schemes]
(i.e. variations of CRN-to-DSD translations) that the user can select from.

A notion of correctness for a particular translation is established on a
case-by-case basis using the domain-level reaction enumeration package
In order to proof/disproof the correctness of a particular translation,
``Nuskell`` includes the domain-level reaction enumeration package
[Peppercorn][] [[Badelt et al. (2020)]] and the CRN verification package
[crnverifier][], which implements the rate-independent, stochastic-level
theories of pathway decomposition equivalence [[Shin et al. (2019)]] and/or
CRN bisimulation [[Johnson et al. (2019)]].
[crnverifier][].
Peppercorn finds intended and potentially unintended reaction pathways, the
crnverifier then checks if the implementation CRN is a correct implementation
of the formal CRN using the stochastic trajectory-type CRN correctness notions
of bisimulation [[Johnson et al. (2019)]] and pathway decomposition
[[Shin et al. (2019)]].

Peppercorn first finds intended and potentially unintended reaction pathways,
then the crnverifier checks if the implementation CRN is a correct
implementation of the formal CRN. Nuskell is a first step to integrate
biophysical modeling of nucleic acids with rigorous abstraction hierarchies of
modern compilers to design and characterize DSD systems. For more details, see
[[Badelt et al. (2017)]].
### Examples

## Installation
Nuskell must be installed directly from this repository, we recommend clining
the repository and then using:
```bash
pip install .
```
Implement a formal CRN using a particular translation-scheme:

For debugging, or if you are planning a contribution to the repository, please
install the development version and make sure all tests pass:
```bash
pip install .[dev]
pytest
```

## Quickstart: the nuskell executable
Upon installation, the package provides an executable `nuskell`, which is the
main interface combining CRN-to-DSD translation, DSD enumeration and CRN
verification. For example, to implement the formal CRN
$ echo "A + B <=> X + Y; X -> A" | nuskell --ts srinivas2017.ts --verify crn-bisimulation
```
A + B <=> X + Y
X -> A
for options see:
```
using the translation-scheme from [Srinivas (2015)], and to verify that
the translation is correct with CRN bisimulation, use the command line call:
```bash
echo "A + B <=> X + Y; X -> A" | nuskell --ts srinivas2015.ts --verify crn-bisimulation
$ nuskell --help
```
New users may also appreciate the `-v` flag to get more detailed information on
the individual compilation steps, as well as the option `--pilfile` to print the
DNA complexes generated in different stages of the compilation.
Detailed information about existing translation schemes can be found in the
[translation schemes] directory.

For more options see:
```bash
nuskell --help
## Translation Schemes
Detailed information about translation schemes can be found in the [translation
schemes] directory.

## Installation
```
$ python setup.py install
```

## Nuskell documentation
A (preliminary) documentation can be found online: [documentation]. Most
importantly, the documentation provides more details on what kind of
translation schemes are supported and how to write them. Suggestions and
contributions that improve the documentation are very welcome.
## Documentation
A preview of the documentation for release v1.0 can be found at: [documentation].

## Version
0.8 -- basically a complete rewrite, python>=3.8 only.
Expand All @@ -80,23 +52,26 @@ contributions that improve the documentation are very welcome.
* enumeration interface updated to peppercornenumerator-v1.1.
* nuskell now uses the prototype objects provided by the dsdobjects library.

## Authors
### Authors
- Stefan Badelt
- Seung Woo Shin
- Hope Amber Johnson
- Robert Johnson
- Qing Dong
- Erik Winfree

### License
MIT

## Cite
Stefan Badelt, Seung Woo Shin, Robert F. Johnson, Qing Dong, Chris Thachuk, and Erik Winfree (2017)
"A General-Purpose CRN-to-DSD Compiler with Formal Verification, Optimization, and Simulation Capabilities"
[[Badelt et al. (2017)]].


[//]: References
[Peppercorn]: <https://github.com/DNA-and-Natural-Algorithms-Group/peppercornenumerator>
[crnverifier]: <https://github.com/DNA-and-Natural-Algorithms-Group/crnverifier>
[translation schemes]: <https://github.com/DNA-and-Natural-Algorithms-Group/nuskell/tree/master/nuskell/dsdcompiler/schemes>
[Srinivas (2015)]: <https://github.com/DNA-and-Natural-Algorithms-Group/nuskell/tree/master/nuskell/dsdcompiler/schemes/literature/srinivas2015.ts>
[Badelt et al. (2017)]: <https://doi.org/10.1007/978-3-319-66799-7_15>
[Badelt et al. (2020)]: <https://doi.org/10.1098/rsif.2019.0866>
[Shin et al. (2019)]: <https://doi.org/10.1016/j.tcs.2017.10.011>
Expand Down
183 changes: 170 additions & 13 deletions docs/Makefile
@@ -1,20 +1,177 @@
# Minimal makefile for Sphinx documentation
# Makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/nuskell.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/nuskell.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/nuskell"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/nuskell"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

.PHONY: help Makefile
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
6 changes: 6 additions & 0 deletions docs/compiler.rst
@@ -0,0 +1,6 @@
nuskell.compiler
==========================

.. automodule:: nuskell.compiler
:members: translate, genCRN, InvalidSchemeError