diff --git a/README.md b/README.md index fa7360d3..12daf9f3 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ The scadnano Python package ([source code repository here](https://github.com/UC-Davis-molecular-computing/scadnano-python-package)) is a library for programmatically creating and editing these nanostructures. +The scadnano project is developed and maintained by the UC Davis Molecular Computing group. +Note that [cadnano](https://cadnano.org) is a separate project, developed and maintained by the [Douglas lab](https://bionano.ucsf.edu/) at UCSF. If you find scadnano useful in a scientific project, please cite its associated paper: @@ -16,6 +18,18 @@ If you find scadnano useful in a scientific project, please cite its associated [ [paper](https://doi.org/10.4230/LIPIcs.DNA.2020.9) | [BibTeX](https://web.cs.ucdavis.edu/~doty/papers/scadnano.bib) ] +## Table of contents + +* [Overview](#overview) +* [Reporting issues](#reporting-issues) +* [Installation](#installation) +* [Example](#example) +* [Abbreviated syntax with chained methods](#abbreviated-syntax-with-chained-methods) +* [Tutorial](#tutorial) +* [API documentation](#api-documentation) +* [Other examples](#other-examples) +* [Contributing](#contributing) + ## Overview This package is used to write Python scripts outputting `.sc` files readable by [scadnano](https://scadnano.org), a web application useful for displaying and manually editing these structures. The purpose of this module is to help automate some of the task of creating DNA designs, as well as making large-scale changes to them that are easier to describe programmatically than to do by hand in the scadnano web interface. @@ -199,7 +213,7 @@ if __name__ == '__main__': Running the code above produces a `.sc` file that, if loaded into scadnano, should appear as in the screenshot above. The [web interface README](https://github.com/UC-Davis-molecular-computing/scadnano/blob/master/README.md#terminology) explains many of the terms used in the code (domain, helix, loopout, insertion, etc.). -## abbreviated syntax with chained methods +## Abbreviated syntax with chained methods Instead of explicitly creating variables and objects representing each domain in each strand, there is a shorter syntax using chained method calls. Instead of the above, create only the helices first, then create the Design. Then strands can be added using a shorter syntax, to describe how to draw the strand starting at the 5' end and moving to the 3' end. The following is a modified version of the above script using these chained methods ```python diff --git a/scadnano/scadnano.py b/scadnano/scadnano.py index b12d7e83..25641192 100644 --- a/scadnano/scadnano.py +++ b/scadnano/scadnano.py @@ -2,7 +2,11 @@ The :mod:`scadnano` Python module is a library for describing synthetic DNA nanostructures (e.g., DNA origami). Installation instructions are at the -`GitHub repository `_. +`GitHub repository `_. + +The scadnano project is developed and maintained by the UC Davis Molecular Computing group. +Note that `cadnano `_ is a separate project, +developed and maintained by the `Douglas lab `_ at UCSF. This module is used to write Python scripts creating files readable by `scadnano `_, a web application useful for displaying @@ -50,7 +54,7 @@ # commented out for now to support Py3.6, which does not support this feature # from __future__ import annotations -__version__ = "0.15.0" # version line; WARNING: do not remove or change this line or comment +__version__ = "0.15.1" # version line; WARNING: do not remove or change this line or comment import dataclasses from abc import abstractmethod, ABC, ABCMeta @@ -409,11 +413,11 @@ class M13Variant(enum.Enum): p7249 = "p7249" """"Standard" variant of M13mp18; 7249 bases long, available from, for example + https://www.tilibit.com/collections/scaffold-dna/products/single-stranded-scaffold-dna-type-p7249 + https://www.neb.com/products/n4040-m13mp18-single-stranded-dna http://www.bayoubiolabs.com/biochemicat/vectors/pUCM13/ - - https://www.tilibit.com/collections/scaffold-dna/products/single-stranded-scaffold-dna-type-p7249 """ p7560 = "p7560" @@ -439,9 +443,9 @@ def m13(rotation: int = 5587, variant: M13Variant = M13Variant.p7249) -> str: `GenBank `_. By default, returns the "standard" variant of consisting of 7249 bases, sold by companies such as - `New England Biolabs `_ - and `Tilibit `_. + and + `New England Biolabs `_ The actual M13 DNA strand itself is circular, so assigning this sequence to the scaffold :any:`Strand` in a :any:`Design` @@ -2493,7 +2497,7 @@ class Strand(_JSONSerializable, Generic[StrandLabel, DomainLabel]): scaffold_strand.set_scaffold() Both will give the strand the same color that - `cadnano `_ + `cadnano `_ uses for the scaffold. """ @@ -4342,7 +4346,8 @@ def strand(self, helix: int, offset: int) -> StrandBuilder: return StrandBuilder(self, helix, offset) def assign_m13_to_scaffold(self, rotation: int = 5587, variant: M13Variant = M13Variant.p7249) -> None: - """Assigns the scaffold to be the sequence of M13: :py:func:`m13` with the given `rotation`. + """Assigns the scaffold to be the sequence of M13: :py:func:`m13` with the given `rotation` + and :any:`M13Variant`. Raises :any:`IllegalDesignError` if the number of scaffolds is not exactly 1. """ diff --git a/tutorial/tutorial.md b/tutorial/tutorial.md index c05d6da6..59c10391 100644 --- a/tutorial/tutorial.md +++ b/tutorial/tutorial.md @@ -220,7 +220,7 @@ We do this by creating a "precursor" design, which is not the final design, and The scaffold is a good starting point. It is one long strand, but we won't specify it as such. Instead, we will specify it by drawing one strand on each helix, spanning the full length, and then modifying these strands with crossovers, eventually joining them into one long strand. -We can use the function [Design.strand](https://scadnano-python-package.readthedocs.io/en/latest/#scadnano.Design.strand) to draw strands. It takes two integer arguments: a helix and an offset, and uses "chained method calls" to give a short syntax for specifying strands. In this case, depending on the helix, we either want the strand (in order from 5' end to 3' end) to start at offset 0 and move forward (right) 288, or start at offset 288 and move in reverse by 288 (i.e., move by -288). The bottommost helix, 23, is an exception, where we want the "nick" to be, so we actually want to draw two strands, with a break between them at the halfway point 144: +We can use the function [Design.strand](https://scadnano-python-package.readthedocs.io/en/latest/#scadnano.Design.strand) to draw strands. It takes two integer arguments: a helix and an offset, and uses "chained method calls" to give a short syntax for specifying strands. In this case, depending on the helix, we either want the strand (in order from 5' end to 3' end) to start at offset 0 and move forward (right) by 288, or start at offset 288 and move in reverse by 288 (i.e., move by -288). The bottommost helix, 23, is an exception, where we want the "nick" to be, so we actually want to draw two strands, with a break between them at the halfway point 144: ```python @@ -554,7 +554,7 @@ Finally, you will want to export the DNA sequences of the staples. One way to do ```python for strand in design.strands: - if strand != design.scaffold: + if not strand.is_scaffold: print(strand.dna_sequence) ```