Welcome to cadnano’s documentation!

cadnano is a computer-aided design tool for creating DNA nanostructures.

Warning

These docs are under development as part of the upcoming cadnano 2.5 release. Some information, such as installation steps, may not be useful prior to the official release.

Quickstart

Installation

Install Python 3.5 , followed by cadnano.

Usage

To launch the cadnano GUI from the command line:

python3 cadnano

To import cadnano as a Python module and work without a GUI:

import cadnano

Installation

Install Python 3.5

There are many ways to get Python on your system.

  • If you prefer the complete “batteries included” option, Anaconda Python is available for Mac, Windows or Linux.
  • On Mac, Homebrew is a great way to install Python.
  • If you just want a clean Python install and nothing else, installers from python.org work great too.

Cadnano will run on Python 3.3, 3.4 and 3.5, but we only support 3.5. We do not support Python 2.X.

Install cadnano

pip3 install cadnano

Advanced: Building from scratch

Should the above not work for you:

  1. Let us know
  2. The requirements PyQt5 and SIP are available from Riverbank Computing Limited at:

Windows

Instructions to come.

Mac and Linux

These instructions can work 10.10 Yosemite and 10.11 El Capitan under Xcode 7.0.1 and 6.5. It has also been tested on Debian 7.9 Wheezy Please provide feedback if you have problems running this in issues.

You can run the included pyqt5_check.py which will grab, build and install Qt5, SIP and PyQt5 in your python environment. It is cleanest using virtualenv and virtualenvwrapper creating a virtualenv with:

mkvirtualenv --always-copy <myvenv>
python pyqttools/install_pyqt_from_src.py

and then running the script, but you can definitely install in your system python if you run:

sudo python pyqttools/install_pyqt_from_src.py

This script only builds required parts of Qt5 and PyQt5 in the interest of time.

Manual installation of PyQt5 is fine too, but you’ll need to trouble shoot on your own

  1. Install Qt5. download the online installer
  2. Build sip and PyQt5 against this Qt5

Of course there are many ways to accomplish this feat, but needless to say OS X and Linux installs of PyQt5 can be painful for some people.

Tutorial

We have planned to create some new tutorials to add here. In the meantime, you can start by checking out the original tutorials that were released for the original version of cadnano.

_images/tut1.png Tutorial 1: How DNA geometry relates to building 3D shapes with a honeycomb lattice
_images/tut2.png Tutorial 2: How to create a basic shape in cadnano export the DNA staple sequences

Understanding the interface

The basic knowledge of DNA geometry necessary to understand the interface is covered by Tutorial 1. The new tutorial planned for this section will explain the latest version of the GUI interface in that context, and walk through what each of the tools do.

Creating a new design

We are also planning an updated version of Tutorial 2, which will be a step-by-step design, start to finish.

API

Packages

cadnano.decorators package

Submodules
cadnano.decorators.insertion module
class Insertion(index, length)

Bases: object

Insertions do affect an applied sequence and do not store a sequence themselves. They are a skip if the length is less than 0

Parameters:
  • index (int) – the index into the StrandSet the Insertion occurs at
  • length (int) – length of Insertion
idx()
Returns:int – the index into the StrandSet the Insertion occurs at
isSkip()
Returns:bool – True is is a skip, False otherwise
length()

This is the length of a sequence that is immutable by the strand

Returns:int – length of Insertion
setLength(length)

Setter for the length

Parameters:length (int) –
updateIdx(delta)

Increment the index by delta

Parameters:delta (int) – can be negative
Module contents

cadnano.docmodscmd module

class AddModCommand(document, params, mid)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
class ModifyModCommand(document, params, mid)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
class RemoveModCommand(document, mid)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()

cadnano.fileio package

Submodules
cadnano.fileio.c25decode module
cadnano.fileio.lattice module
class HoneycombDnaPart

Bases: object

SCAF_LOW = [[1, 11], [8, 18], [4, 15]] SCAF_HIGH = [[2, 12], [9, 19], [5, 16]] STAP_LOW = [[6, 16], [3, 13], [10, 20]] STAP_HIGH = [[7, 17], [4, 14], [0, 11]]

# from 0: DR U DL aka 210 90 330 SCAF_LOW = [[1, 12], [8, 19], [5, 15]] SCAF_HIGH = [[2, 13], [9, 20], [6, 16]] STAP_LOW = [[17], [3], [10]] STAP_HIGH = [[18], [4], [11]]

HELICAL_PITCH = 10.5
STEP = 21
SUB_STEP_SIZE = 7.0
TURNS_PER_STEP = 2.0
TWIST_OFFSET = -34.285714285714285
TWIST_PER_BASE = 34.285714285714285
static isEvenParity(row, column)
static isOddParity(row, column)
static latticeCoordToPositionXY(radius, row, column, scale_factor=1.0)

make sure radius is a float

static legacyLatticeCoordToPositionXY(radius, row, column, scale_factor=1.0)

make sure radius is a float

static positionToLatticeCoord(radius, x, y, scale_factor=1.0)
static positionToLatticeCoordRound(radius, x, y, round_up_row, round_up_col, scale_factor=1.0)
class SquareDnaPart

Bases: object

SCAF_LOW = [[4, 26, 15], [18, 28, 7], [10, 20, 31], [2, 12, 23]] SCAF_HIGH = [[5, 27, 16], [19, 29, 8], [11, 21, 0], [3, 13, 24]] STAP_LOW = [[31], [23], [15], [7]] STAP_HIGH = [[0], [24], [16], [8]]

HELICAL_PITCH = 10.666666666666666
STEP = 32
SUB_STEP_SIZE = 8.0
TURNS_PER_STEP = 3.0
TWIST_OFFSET = 196.875
TWIST_PER_BASE = 33.75
static isEvenParity(row, column)
static isOddParity(row, column)
static latticeCoordToPositionXY(radius, row, column, scale_factor=1.0)
static legacyLatticeCoordToPositionXY(radius, row, column, scale_factor=1.0)
static positionToLatticeCoord(radius, x, y, scale_factor=1.0)
static positionToLatticeCoordRound(radius, x, y, scale_factor=1.0)
cadnano.fileio.nnodecode module
cadnano.fileio.nnoencode module
cadnano.fileio.v2decode module
cadnano.fileio.v3decode module
decode(document, obj)

Decode a a deserialized Document dictionary

Parameters:
  • document (Document) –
  • obj (dict) – deserialized file object
decodePart(document, part_dict)

Decode a a deserialized Part dictionary

Parameters:
  • document (Document) –
  • part_dict (dict) – deserialized dictionary describing the Part
importToPart(part_instance, copy_dict, use_undostack=True)

Use this to duplicate virtual_helices within a Part. duplicate id_nums will start numbering part.getIdNumMax() rather than the lowest available id_num. TODO should this numbering change?

Parameters:
cadnano.fileio.v3encode module
encodeDocument(document)

Encode a Document to a dictionary to enable serialization

Parameters:document (Document) –
Returns:dict
encodePart(part)
Parameters:part (Part) –
Returns:dict
encodePartList(part_instance, vh_group_list)

Used for copying and pasting TODO: unify encodePart and encodePartList

Parameters:
  • part (Part) –
  • vh_group_list (list) – of int, virtual_helices IDs to encode to be used with copy and paste serialization
Returns:

dict

Module contents

cadnano.math package

Submodules
cadnano.math.box module
class Box(min_point, max_point)

Bases: object

Cube box object

For doing an oct tree type thing

Parameters:
  • min_point (Tuple) – length 3 lower left corner
  • max_point (Tuple) – length 3 diagonal opposite top corner
center()

Return the center of this Box

Returns:Vector3 – the center point of this box.
clone()

Clone this Box

Returns:Box – a copy of this box.
containsBox(box)

Does this object contain the Box box?

Parameters:Box
Returns:bool – True if box is in self otherwise False
containsPoint(point)

Is the point within this Box?

Parameters:point (Vector3) – to check for inclusion.
Returns:bool
True if the specified point lies within the boundaries
of this box False otherwise
doesBoxSpan(box)

doe this object contain the Box box? :param Box:

Returns:bool – True if box spans self otherwise False
set(min_point, max_point)

Set the Tuples

Setter for setting the bounding points of the Box

Parameters:
  • min_point (Tuple) – length 3 lower left corner
  • max_point (Tuple) – length 3 diagonal opposite top corner
size()

Find the dimensions of the Box

Returns:Tuple – the width, height, and depth of this box.
cadnano.math.face module
class Face(normal, v1, v2, v3)

Bases: tuple

namedtuple of tuple: 4 x 3 tuple of tuples corresponding
to the normal and the three points comprising a Face
normal

Alias for field number 0

v1

Alias for field number 1

v2

Alias for field number 2

v3

Alias for field number 3

cadnano.math.matrix3 module
class Matrix3(n11, n12, n13, n21, n22, n23, n31, n32, n33)

Bases: tuple

namedtuple: 3 x 3 matrix

n11

Alias for field number 0

n12

Alias for field number 1

n13

Alias for field number 2

n21

Alias for field number 3

n22

Alias for field number 4

n23

Alias for field number 5

n31

Alias for field number 6

n32

Alias for field number 7

n33

Alias for field number 8

getInverse(m4)
Parameters:m4 (Matrix4) –
Returns:Matrix3
getNormalMatrix(m)

Normalize the matrix m :param m: :type m: Matrix3

Returns:Matrix3
transpose(m)

Compute the inverse of m

Parameters:m (Matrix3) –
Returns:Matrix3 – the inverse
cadnano.math.matrix4 module
class Matrix4(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44)

Bases: tuple

namedtuple: 4 x 4 matrix

n11

Alias for field number 0

n12

Alias for field number 1

n13

Alias for field number 2

n14

Alias for field number 3

n21

Alias for field number 4

n22

Alias for field number 5

n23

Alias for field number 6

n24

Alias for field number 7

n31

Alias for field number 8

n32

Alias for field number 9

n33

Alias for field number 10

n34

Alias for field number 11

n41

Alias for field number 12

n42

Alias for field number 13

n43

Alias for field number 14

n44

Alias for field number 15

makeRotationZ(theta)

Create a rotation matrix of angle theta

Parameters:theta (float) – Angle in radians
Returns:Matrix4 – rotation matrix about the Z axis
makeTranslation(x, y, z)

create a translation matrix given a displacement x, y, z

Parameters:
  • x (float) –
  • y (float) –
  • z (float) –
Returns:

Matrix4 – translation matrix

cadnano.math.solid module
class Solid(name)

Bases: object

addFace(v1, v2, v3, normal=None)

List vertices using right hand rule so that unit normal will point out of the surface

vertices are given by index into vertices list

Parameters:
addVertex(vertex)

Add a vertex to the Solid :param vertex: :type vertex: Vector3

applyMatrix(matrix4)
computeFaceNormals()
cadnano.math.vector module
class Vector2(x, y)

Bases: tuple

x

Alias for field number 0

y

Alias for field number 1

class Vector3(x, y, z)

Bases: tuple

x

Alias for field number 0

y

Alias for field number 1

z

Alias for field number 2

addVectors(v1, v2)
applyMatrix3(m, v)
applyMatrix4(m, v)
crossProduct(a, b)

return normalized cross product

multiplyScalar(v, s)

return v1*s

normalToPlane(v1, v2, v3)

Calculate unit normal to the normal to the plane defined by vertices v1, v2, and v3

normalizeV2(v)
normalizeV3(v)
subVectors(v1, v2)

return v1 - v2

v2AngleBetween(a, b)
v2DistanceAndAngle(a, b)
v2dot(a, b)
v3SetX(v, x)
v3SetY(v, y)
v3SetZ(v, z)
Module contents

cadnano.oligo package

Submodules
cadnano.oligo.applycolorcmd module
class ApplyColorCommand(oligo, color)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
cadnano.oligo.applysequencecmd module
class ApplySequenceCommand(oligo, sequence)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
cadnano.oligo.oligo module
class Oligo(part, color=None)

Bases: cadnano.cnobject.CNObject

Oligo is a group of Strands that are connected via 5’ and/or 3’ connections. It corresponds to the physical DNA strand, and is thus used tracking and storing properties that are common to a single strand, such as its color.

Commands that affect Strands (e.g. create, remove, merge, split) are also responsible for updating the affected Oligos.

Parameters:
  • part (Part) – the model Part
  • color (str) – optional, color property of the Oligo
addToPart(part)
applyAbstractSequences()
applyColor(color, use_undostack=True)
applySequence(sequence, use_undostack=True)
applySequenceCMD(sequence)
clearAbstractSequences()
destroy()
displayAbstractSequences()
dump()

Return dictionary of this oligo and its properties. It’s expected that caller will copy the properties if mutating

Returns:dict
editable_properties = ['name', 'color']
getColor()
getModelProperties()

Return a reference to the property dictionary

Returns:dict
getName()
getOutlineProperties()

Convenience method for the outline view

Returns:tuple – (<name>, <color>, <is_visible>)
getProperty(key)
isLoop()
length()
locString()
oligoPropertyChangedSignal = <cadnano.cnproxy.DummySignal object>

self, property_name, new_value

oligoRemovedSignal = <cadnano.cnproxy.DummySignal object>

part, self

oligoSequenceAddedSignal = <cadnano.cnproxy.DummySignal object>

self

oligoSequenceClearedSignal = <cadnano.cnproxy.DummySignal object>

self

part()
refreshLength()
remove(use_undostack=True)
removeFromPart()

This method merely disconnects the object from the model. It still lives on in the undoStack until clobbered

Note: don’t set self._part = None because we need to continue passing the same reference around.

sequence()

Get the sequence applied to this Oligo

Returns:str or None
sequenceExport(output)

Iterative appending to argument output which is a dictionary of lists

Parameters:output (dict) – dictionary with keys given in NucleicAcidPart.getSequences
Returns:dict
setPart(part)
setProperty(key, value, use_undostack=True)
setStrand5p(strand)
shallowCopy()
shouldHighlight()
strand3p()
strand5p()
undoStack()
cadnano.oligo.removeoligocmd module
class RemoveOligoCommand(oligo)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
Module contents

Oligo is a lightweight convenience module that facilitates certain types of manipulation of connected groups of Strands that correspond to physical pieces of DNA. It maintains properties such as sequence, color, visiblity, and length.

cadnano.part package

Submodules
cadnano.part.changeviewpropertycmd module
cadnano.part.createvhelixcmd module
class CreateVirtualHelixCommand(part, x, y, z, length, id_num=None, properties=None, safe=True)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
cadnano.part.nucleicacidpart module
cadnano.part.part module
class Part(*args, **kwargs)

Bases: cadnano.cnobject.CNObject

A Part is a group of VirtualHelix items that are on the same lattice. Parts are the model component that most directly corresponds to a DNA origami design.

Parts are always parented to the document. Parts know about their oligos, and the internal geometry of a part Copying a part recursively copies all elements in a part: StrandSets, Strands, etc

PartInstances are parented to either the document or an assembly PartInstances know global position of the part Copying a PartInstance only creates a new PartInstance with the same Part(), with a mutable parent and position field.

changeInstanceProperty(part_instance, view, key, value, use_undostack=True)
destroy()
document()

Get this objects Document

Returns:Document
editable_properties = ['name', 'color', 'is_visible', 'grid_type']
getColor()
getInstanceProperty(part_instance, key)

Get an instance property

Parameters:
Returns:

object

getModelProperties()

Get the dictionary of model properties

Returns:dict – group properties
getName()
getOutlineProperties()

Convenience method for getting the properties used in the outlinerview

Returns:tuple – (<name>, <color>, <is_visible>)
getProperty(key)
Parameters:key (str) –
instanceProperties()

Generator yielding all instance properties

partActiveChangedSignal = <cadnano.cnproxy.DummySignal object>

self, is_active

partDocumentSettingChangedSignal = <cadnano.cnproxy.DummySignal object>

self, key, value

partInstanceAddedSignal = <cadnano.cnproxy.DummySignal object>

self

partInstancePropertySignal = <cadnano.cnproxy.DummySignal object>

self, view, key, val

partParentChangedSignal = <cadnano.cnproxy.DummySignal object>

self

partPropertyChangedSignal = <cadnano.cnproxy.DummySignal object>

self, property_name, new_value

partRemovedSignal = <cadnano.cnproxy.DummySignal object>

self

partSelectedChangedSignal = <cadnano.cnproxy.DummySignal object>

self, is_selected

partZDimensionsChangedSignal = <cadnano.cnproxy.DummySignal object>

self, id_min, id_max, zoom_to_fit

setDocument(document)

set this object’s Document

Parameters:document (Document) –
setInstanceProperty(part_instance, key, value)

Set an instance property

Parameters:
setProperty(key, value, use_undostack=True)

Get the value of the key model properties

Parameters:
  • key (str) –
  • value (object) –
  • use_undostack (bool, optional) – default True
cadnano.part.refresholigoscmd module
class RefreshOligosCommand(part)

Bases: cadnano.undocommand.UndoCommand

RefreshOligosCommand is a post-processing step for AutoStaple.

Normally when an xover is created, all strands in the 3’ direction are assigned the oligo of the 5’ strand. This becomes very expensive during autoStaple, because the Nth xover requires updating up to N-1 strands.

Hence, we disable oligo assignment during the xover creation step, and then do it all in one pass at the end with this command.

This command is meant for non-undoable steps, like file-io.

redo()
undo()

Doesn’t reassign

cadnano.part.refreshsegmentscmd module
class RefreshSegmentsCommand(part, id_nums)

Bases: cadnano.undocommand.UndoCommand

Add an UndoCommand to the undostack calling Part.refreshSegments

redo()
undo()
cadnano.part.removepartcmd module
class RemovePartCommand(part)

Bases: cadnano.undocommand.UndoCommand

RemovePartCommand deletes a part. Emits partRemovedSignal.

redo()
undo()
cadnano.part.removevhelixcmd module
class RemoveVirtualHelixCommand(part, id_num)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
cadnano.part.renumbercmd module
class RenumberVirtualHelicesCommand(part, coord_list)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
cadnano.part.resizevirtualhelixcmd module
class ResizeVirtualHelixCommand(part, id_num, is_right, delta)

Bases: cadnano.undocommand.UndoCommand

set the maximum and mininum base index in the helical direction

need to adjust all subelements in the event of a change in the minimum index

redo()
undo()
cadnano.part.translatevhelixcmd module
class TranslateVirtualHelicesCommand(part, virtual_helix_set, dx, dy, dz)

Bases: cadnano.undocommand.UndoCommand

Move Virtual Helices around

doSignals(part, vh_set)
redo()
specialUndo()

does not deselect

undo()
cadnano.part.xovercmds module
class CreateXoverCommand(part, strand5p, strand5p_idx, strand3p, strand3p_idx, update_oligo=True)

Bases: cadnano.undocommand.UndoCommand

Creates a Xover from the 3’ end of strand5p to the 5’ end of strand3p this needs to 1. preserve the old oligo of strand3p 2. install the crossover 3. apply the strand5p oligo to the strand3p

redo()
undo()
class RemoveXoverCommand(part, strand5p, strand3p)

Bases: cadnano.undocommand.UndoCommand

Removes a Xover from the 3’ end of strand5p to the 5’ end of strand3p this needs to 1. preserve the old oligo of strand3p 2. install the crossover 3. update the oligo length 4. apply the new strand3p oligo to the strand3p

redo()
undo()
Module contents

cadnano.removeinstancecmd module

class RemoveInstanceCommand(cnobj, obj_instance)

Bases: cadnano.undocommand.UndoCommand

Undo ready command for removing an instance.

Parameters:obj_instance (ObjectInstance) – Object instance remove
redo()
undo()

cadnano.strand package

Submodules
cadnano.strand.insertioncmd module
class AddInsertionCommand(strand, idx, length)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
class ChangeInsertionCommand(strand, idx, new_length)

Bases: cadnano.undocommand.UndoCommand

Changes the length of an insertion to a non-zero value the caller of this needs to handle the case where a zero length is required and call RemoveInsertionCommand

redo()
undo()
class RemoveInsertionCommand(strand, idx)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
cadnano.strand.modscmd module
class AddModsCommand(document, strand, idx, mod_id)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
class RemoveModsCommand(document, strand, idx, mod_id)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
cadnano.strand.resizecmd module
class ResizeCommand(strand, new_idxs, update_segments=True)

Bases: cadnano.undocommand.UndoCommand

redo()
undo()
cadnano.strand.strand module
class Strand(strandset, base_idx_low, base_idx_high, oligo=None)

Bases: cadnano.cnobject.CNObject

A Strand is a continuous stretch of bases that are all in the same StrandSet (recall: a VirtualHelix is made up of two StrandSets).

Every Strand has two endpoints. The naming convention for keeping track of these endpoints is based on the relative numeric value of those endpoints (low and high). Thus, Strand has a ‘_base_idx_low’, which is its index with the lower numeric value (typically positioned on the left), and a ‘_base_idx_high’ which is the higher-value index (typically positioned on the right)

Strands can be linked to other strands by “connections”. References to connected strands are named “_strand5p” and “_strand3p”, which correspond to the 5’ and 3’ phosphate linkages in the physical DNA strand, respectively. Since Strands can point 5’-to-3’ in either the low-to-high or high-to-low directions, connection accessor methods (connectionLow and connectionHigh) are bound during the init for convenience.

Parameters:
  • strandset (StrandSet) –
  • base_idx_low (int) – low index
  • base_idx_high (int) – high index
  • oligo (cadnano.oligo.Oligo) – optional, defaults to None.
abstractSeq()
addInsertion(idx, length, use_undostack=True)

Adds an insertion or skip at idx. length should be:

>0 for an insertion
-1 for a skip
Parameters:
  • idx (int) –
  • length (int) –
  • use_undostack (bool) – optional, default is True
addMods(document, mod_id, idx, use_undostack=True)

Used to add mods during a merge operation.

applyAbstractSequence()

Assigns virtual index from 5’ to 3’ on strand and it’s complement location.

canInstallXoverAt(idx, from_strand, from_idx)

Assumes idx is: self.lowIdx() <= idx <= self.highIdx()

canResizeTo(new_low, new_high)

Checks to see if a resize is allowed. Similar to getResizeBounds but works for two bounds at once.

changeInsertion(idx, length, use_undostack=True)
Parameters:
  • idx (int) –
  • length (int) –
  • use_undostack (bool) – optional, default is True
clearAbstractSequence()
clearDecoratorCommands()
clearInsertionsCommands(insertions, idxL, idxH)

clear out insertions in this range

connection3p()
connection5p()
copyAbstractSequenceToSequence()
destroy()
document()
dump5p()
generator3pStrand()

Iterate from self to the final _strand3p is None 5prime to 3prime Includes originalCount to check for circular linked list

Yields:Strand – 3’ connected Strand
generator5pStrand()

Iterate from self to the final _strand5p is None 3’ to 5’

Includes originalCount to check for circular linked list

Yields:Strand – 5’ connected Strand
getColor()
getComplementStrands()

Return the list of complement strands that overlap with this strand.

getRemoveInsertionCommands(new_idxs)

Removes Insertions, Decorators, and Modifiers that have fallen out of range of new_idxs.

For insertions, it finds the ones that have neither Staple nor Scaffold strands at the insertion idx as a result of the change of this strand to new_idxs

getResizeBounds(idx)

Determines (inclusive) low and high drag boundaries resizing from an endpoint located at idx.

When resizing from _base_idx_low:

low bound is determined by checking for lower neighbor strands.
high bound is the index of this strand's high cap, minus 1.

When resizing from _base_idx_high:

low bound is the index of this strand's low cap, plus 1.
high bound is determined by checking for higher neighbor strands.

When a neighbor is not present, just use the Part boundary.

getSequenceList()

return the list of sequences strings comprising the sequence and the inserts as a tuple with the index of the insertion [(idx, (strandItemString, insertionItemString), …]

This takes advantage of the fact the python iterates a dictionary by keys in order so if keys are indices, the insertions will iterate out from low index to high index

hasInsertionAt(idx)
hasXoverAt(idx)

An xover is necessarily at an enpoint of a strand

highIdx()
idNum()
idx3Prime()

Returns the absolute base_idx of the 3’ end of the strand. overloaded in __init__

idx5Prime()

Returns the absolute base_idx of the 5’ end of the strand. overloaded in __init__

idxs()
insertionLengthBetweenIdxs(idxL, idxH)

includes the length of insertions in addition to the bases

insertionsOnStrand(idxL=None, idxH=None)

if passed indices it will use those as a bounds

isForward()
length()
lowIdx()
merge(idx)

Check for neighbor, then merge if possible.

Parameters:idx (int) –
Raises:IndexError
modifersOnStrand()
oligo()
part()
reapplySequence()
removeInsertion(idx, use_undostack=True)
Parameters:
  • idx (int) –
  • use_undostack (bool) – optional, default is True
removeMods(document, mod_id, idx, use_undostack=True)

Used to add mods during a merge operation.

resize(new_idxs, use_undostack=True, update_segments=True)
sequence(for_export=False)
setComplementSequence(sequence_string, strand)

This version takes anothers strand and only sets the indices that align with the given complimentary strand.

As it depends which direction this is going, and strings are stored in memory left to right, we need to test for is_forward to map the reverse compliment appropriately, as we traverse overlapping strands.

We reverse the sequence ahead of time if we are applying it 5’ to 3’, otherwise we reverse the sequence post parsing if it’s 3’ to 5’

Again, sequences are stored as strings in memory 5’ to 3’ so we need to jump through these hoops to iterate 5’ to 3’ through them correctly

Perhaps it’s wiser to merely store them left to right and reverse them at draw time, or export time

Parameters:
  • sequence_string (str) –
  • strand (Strand) –
Returns:

str – the used portion of the sequence_string

setConnection3p(strand)
setConnection5p(strand)
setIdxs(idxs)
setOligo(new_oligo, emit_signal=True)
setSequence(sequence_string)

Applies sequence string from 5’ to 3’ return the tuple (used, unused) portion of the sequence_string

Parameters:sequence_string (str) –
Returns:tuple

of str of form:

(used, unused)
shallowCopy()
split(idx, update_sequence=True)

Called by view items to split this strand at idx.

strandFilter()
strandHasNewOligoSignal = <cadnano.cnproxy.DummySignal object>

pyqtSignal(QObject) – strand

strandInsertionAddedSignal = <cadnano.cnproxy.DummySignal object>

pyqtSignal(QObject, object) – (strand, insertion object)

strandInsertionChangedSignal = <cadnano.cnproxy.DummySignal object>

#pyqtSignal(QObject, object) – (strand, insertion object)

strandInsertionRemovedSignal = <cadnano.cnproxy.DummySignal object>

#pyqtSignal(QObject, int) – # Parameters: (strand, insertion index)

strandModsAddedSignal = <cadnano.cnproxy.DummySignal object>

pyqtSignal(QObject, object, str, int) – (strand, document, mod_id, idx)

strandModsChangedSignal = <cadnano.cnproxy.DummySignal object>

pyqtSignal(QObject, object, str, int) – (strand, document, mod_id, idx)

strandModsRemovedSignal = <cadnano.cnproxy.DummySignal object>

pyqtSignal(QObject, object, str, int) – (strand, document, mod_id, idx)

strandRemovedSignal = <cadnano.cnproxy.DummySignal object>

pyqtSignal(QObject) – strand

strandResizedSignal = <cadnano.cnproxy.DummySignal object>

pyqtSignal(QObject, tuple)

strandSelectedChangedSignal = <cadnano.cnproxy.DummySignal object>

pyqtSignal(QObject, tuple) – (strand, value)

strandSet()
strandType()
strandUpdateSignal = <cadnano.cnproxy.DummySignal object>

pyqtSignal(QObject) – strand

strandXover5pRemovedSignal = <cadnano.cnproxy.DummySignal object>

pyqtSignal(QObject, QObject) – (strand3p, strand5p)

totalLength()

includes the length of insertions in addition to the bases

sixb(x)
tostring(x)
Module contents

cadnano.strandset package

Submodules
cadnano.strandset.createstrandcmd module
class CreateStrandCommand(strandset, base_idx_low, base_idx_high, color, update_segments=True)

Bases: cadnano.undocommand.UndoCommand

Create a new Strand based with bounds (base_idx_low, base_idx_high), and insert it into the strandset at position strandset_idx. Also, create a new Oligo, add it to the Part, and point the new Strand at the oligo.

redo()
undo()
cadnano.strandset.mergecmd module
class MergeCommand(strand_low, strand_high, priority_strand)

Bases: cadnano.undocommand.UndoCommand

This class takes two Strands and merges them. This Class should be private to StrandSet as knowledge of a strandsetIndex outside of this of the StrandSet class implies knowledge of the StrandSet implementation

Must pass this two different strands, and nominally one of the strands again which is the priority_strand. The resulting “merged” strand has the properties of the priority_strand’s oligo. Decorators are preserved

the strand_low and strand_high must be presorted such that strand_low has a lower range than strand_high

low_strandset_idx should be known ahead of time as a result of selection

redo()
undo()
cadnano.strandset.removestrandcmd module
class RemoveStrandCommand(strandset, strand, solo=True)

Bases: cadnano.undocommand.UndoCommand

RemoveStrandCommand deletes a strand. It should only be called on strands with no connections to other strands.

Parameters:
  • strandset (StrandSet) –
  • strand (Strand) –
  • solo (bool, optional) – set to True if only one strand is being removed to minimize signaling
redo()
undo()
cadnano.strandset.splitcmd module
class SplitCommand(strand, base_idx, update_sequence=True)

Bases: cadnano.undocommand.UndoCommand

The SplitCommand takes as input a strand and “splits” the strand in two, such that one new strand 3’ end is at base_idx, and the other new strand 5’ end is at base_idx +/- 1 (depending on the direction of the strands).

Under the hood: On redo, this command actually is creates two new copies of the original strand, resizes each and modifies their connections. On undo, the new copies are removed and the original is restored.

redo()
undo()
cadnano.strandset.strandset module
class StrandSet(is_fwd, id_num, part, initial_size)

Bases: cadnano.cnobject.CNObject

StrandSet is a container class for Strands, and provides the several publicly accessible methods for editing strands, including operations for creation, destruction, resizing, splitting, and merging strands.

Views may also query StrandSet for information that is useful in determining if edits can be made, such as the bounds of empty space in which a strand can be created or resized.

Internally StrandSet uses redundant heap and a list data structures to track Strands objects, with the list of length of a virtual helix looking like:

strand_array = [strandA, strandA, strandA, ..., None, strandB, strandB, ...]

Where every index strandA spans has a reference to strandA and strand_heap:

strand_heap = [strandA, strandB, strandC, ...]

is merely a sorted list from low index to high index of strand objects

Parameters:
  • is_fwd (bool) – is this a forward or reverse StrandSet?
  • id_num (int) – ID number of the virtual helix this is on
  • part (Part) – Part object this is a child of
  • initial_size (int) – initial_size to allocate
complementStrandSet()

Returns the complementary strandset. Used for insertions and sequence application.

Returns:StrandSet – the complementary StrandSet
createDeserializedStrand(base_idx_low, base_idx_high, color, use_undostack=False)

Passes a strand to AddStrandCommand that was read in from file input. Omits the step of checking _couldStrandInsertAtLastIndex, since we assume that deserialized strands will not cause collisions.

createStrand(base_idx_low, base_idx_high, color=None, use_undostack=True)

Assumes a strand is being created at a valid set of indices.

Parameters:
  • base_idx_low (int) – low index of strand
  • base_idx_high (int) – high index of strand
  • color (str, optional) – default=True
  • use_undostack (bool, optional) – default=True
Returns:

int – 0 if successful, -1 otherwise

destroy()

Destroy this object

document()

Get model Document

Returns:Document – the Document
dump(xover_list)

Serialize a StrandSet, and append to a xover_list of xovers adding a xover if the 3 prime end of it is founds TODO update this to support strand properties

Parameters:xover_list (list) – A list to append xovers to
Returns:list of tuple – indices low and high of each strand in the StrandSet
getBoundsOfEmptyRegionContaining(base_idx)

Return the bounds of the empty region containing base index <base_idx>.

Parameters:base_idx (int) – the index of interest
Returns:tuple

of int of form:

(low_idx, high_idx)
getNeighbors(strand)

Given a Strand in this StrandSet find it’s internal neighbors

Parameters:strand (Strand) –
Returns:tuple – (low neighbor, high neighbor) of types Strand or None
getOverlappingStrands(idx_low, idx_high)

Gets Strand list that overlap the given range.

Parameters:
  • idx_low (int) – low index of overlap region
  • idx_high (int) – high index of overlap region
Returns:

list of Strand – all Strand objects in range

getStrand(base_idx)

Returns the Strand that overlaps with base_idx

Parameters:base_idx (int) –
Returns:StrandStrand at base_idx if it exists
getStrandIndex(strand)

Get the index of strand if it exists

Returns:tuple – (bool, int)
Raises:ValueError
hasStrandAt(idx_low, idx_high)

Check if set has a strand on the interval given

Parameters:
  • idx_low (int) – low index
  • idx_high (int) – high index
Returns:

bool – True if strandset has a strand in the region between idx_low and idx_high (both included). False otherwise

idNum()

Get the associated virtual helix ID number

Returns:int – virtual helix ID number
indexOfRightmostNonemptyBase()

Returns the high base_idx of the last strand, or 0.

isForward()

Is the set 5’ to 3’ (forward) or is it 3’ to 5’ (reverse)

Returns:bool – True if is forward, False otherwise
isReverse()
isStrandInSet(strand)
length()

length of the StrandSet and therefore also the associated virtual helix in bases

Returns:int – length of the set
mergeStrands(priority_strand, other_strand, use_undostack=True)

Merge the priority_strand and other_strand into a single new strand. The oligo of priority should be propagated to the other and all of its connections.

Parameters:
  • priority_strand (Strand) – priority strand
  • other_strand (Strand) – other strand
  • use_undostack (bool, optional) – default=True
oligoStrandRemover(strand, cmds, solo=True)

Used for removing all Strand`s from an :class:`Oligo

Parameters:
  • strand (Strand) – a strand to remove
  • cmds (list) – a list of UndoCommand objects to append to
  • solo (bool, optional) – to pass on to RemoveStrandCommand,
  • default=True
part()

Get model Part

Returns:Part – the Part
removeAllStrands(use_undostack=True)

Remove all Strand objects in the set

Parameters:use_undostack (bool, optional) – default=True
removeStrand(strand, use_undostack=True, solo=True)

Remove a Strand from the set

Parameters:
  • strand (Strand) – the Strand to remove
  • use_undostack (bool, optional) – default=True
  • solo (bool, optional) – solo is an argument to enable
  • signals emiting from the command in the case the command (limiting) –
  • instantiated part of a larger command, default=True (is) –
resize(delta_low, delta_high)

Resize this StrandSet. Pad each end when growing otherwise don’t do anything

Parameters:
  • delta_low (int) – amount to resize the low index end
  • delta_high (int) – amount to resize the high index end
simpleCopy(part)

Create an empty copy (no strands) of this strandset with the only a new virtual_helix_group parent

TODO: consider renaming this method

Parameters:part (Part) – part to copy this into
splitStrand(strand, base_idx, update_sequence=True, use_undostack=True)

Break strand into two strands. Reapply sequence by default.

Parameters:
  • strand (Strand) – the Strand
  • base_idx (int) – the index
  • update_sequence (bool, optional) – whether to emit signal, default=True
  • use_undostack (bool, optional) – default=True
Returns:

bool – True if successful, False otherwise

strandCanBeSplit(strand, base_idx)

Make sure the base index is within the strand Don’t split right next to a 3Prime end Don’t split on endpoint (AKA a crossover)

Parameters:
  • strand (Strand) – the Strand
  • base_idx (int) – the index to split at
Returns:

bool – True if can be split, False otherwise

strandCount()

Getter for the number of Strands in the set

Returns:int – the number of Strands in the set
strandFilter()

Get the filter type for this set

Returns:str – ‘forward’ if is_fwd else ‘reverse’
strandType()

Store the enum of strand type

Returns:intStrandType.FWD if is forward, otherwise StrandType.REV
strands()

Get raw reference to the strand_heap of this StrandSet

Returns:list – the list of strands
strandsCanBeMerged(strandA, strandB)

Only checks that the strands are of the same StrandSet and that the end points differ by 1. DOES NOT check if the Strands overlap, that should be handled by addStrand

Returns:tuple – empty tuple if the strands can’t be merged if the strands can be merged it returns the strand with the lower index in the form:
(strand_low, strand_high)
strandsetStrandAddedSignal = <cadnano.cnproxy.DummySignal object>

pyqtSignal(QObject, QObject) – strandset, strand

Module contents

Modules

cadnano

cadnano package
Subpackages
cadnano.data package
Subpackages
cadnano.data.fasta package
Module contents

This convenience module is to hard-code some example FASTA files for testing and development.

cadnano.data.genbank package
Module contents

This convenience module is to hard-code some example GenBank files for testing and development.

Submodules
cadnano.data.dnasequences module
cadnano.data.sequencemods module
Module contents

__init__.py

Created by Shawn Douglas on 2011-01-23.

cadnano.gui package
Subpackages
cadnano.gui.controllers package
Subpackages
cadnano.gui.controllers.itemcontrollers package
Subpackages
cadnano.gui.controllers.itemcontrollers.strand package
Submodules
cadnano.gui.controllers.itemcontrollers.strand.abstractstranditemcontroller module
class AbstractStrandItemController(strand_item, model_strand)

Bases: object

connectOligoSignals()
connectSignals()

Connects modelStrant signals to strandItem slots.

disconnectOligoSignals()
disconnectSignals()
reconnectOligoSignals()
cadnano.gui.controllers.itemcontrollers.strand.endpointitemcontroller module
class EndpointItemController(strandItem, modelOligo, modelStrand)

Bases: cadnano.gui.controllers.itemcontrollers.strand.abstractstranditemcontroller.AbstractStrandItemController

cadnano.gui.controllers.itemcontrollers.strand.stranditemcontroller module
class StrandItemController(strand_item, model_strand)

Bases: cadnano.gui.controllers.itemcontrollers.strand.abstractstranditemcontroller.AbstractStrandItemController

connectOligoSignals()
connectSignals()

Connects modelStrant signals to strandItem slots.

disconnectOligoSignals()
disconnectSignals()
reconnectOligoSignals()

use this for whenever a strands oligo changes

Module contents
Submodules
cadnano.gui.controllers.itemcontrollers.nucleicacidpartitemcontroller module
class NucleicAcidPartItemController(nucleicacid_part_item, model_na_part)

Bases: cadnano.gui.controllers.itemcontrollers.partitemcontroller.PartItemController

connections = [('partZDimensionsChangedSignal', 'partZDimensionsChangedSlot'), ('partParentChangedSignal', 'partParentChangedSlot'), ('partRemovedSignal', 'partRemovedSlot'), ('partPropertyChangedSignal', 'partPropertyChangedSlot'), ('partSelectedChangedSignal', 'partSelectedChangedSlot'), ('partDocumentSettingChangedSignal', 'partDocumentSettingChangedSlot'), ('partActiveVirtualHelixChangedSignal', 'partActiveVirtualHelixChangedSlot'), ('partActiveBaseInfoSignal', 'partActiveBaseInfoSlot'), ('partActiveChangedSignal', 'partActiveChangedSlot'), ('partInstancePropertySignal', 'partInstancePropertySlot'), ('partVirtualHelixAddedSignal', 'partVirtualHelixAddedSlot'), ('partVirtualHelixRemovingSignal', 'partVirtualHelixRemovingSlot'), ('partVirtualHelixRemovedSignal', 'partVirtualHelixRemovedSlot'), ('partVirtualHelixResizedSignal', 'partVirtualHelixResizedSlot'), ('partVirtualHelicesTranslatedSignal', 'partVirtualHelicesTranslatedSlot'), ('partVirtualHelicesSelectedSignal', 'partVirtualHelicesSelectedSlot'), ('partVirtualHelixPropertyChangedSignal', 'partVirtualHelixPropertyChangedSlot'), ('partOligoAddedSignal', 'partOligoAddedSlot')]
cadnano.gui.controllers.itemcontrollers.oligoitemcontroller module
class OligoItemController(oligo_item, model_oligo)

Bases: object

connectSignals()
connections = [('oligoSequenceAddedSignal', 'oligoSequenceAddedSlot'), ('oligoSequenceClearedSignal', 'oligoSequenceClearedSlot'), ('oligoPropertyChangedSignal', 'oligoPropertyChangedSlot')]
disconnectSignals()
cadnano.gui.controllers.itemcontrollers.partitemcontroller module
class PartItemController(part_item, model_part)

Bases: object

connectSignals()
connections = [('partZDimensionsChangedSignal', 'partZDimensionsChangedSlot'), ('partParentChangedSignal', 'partParentChangedSlot'), ('partRemovedSignal', 'partRemovedSlot'), ('partPropertyChangedSignal', 'partPropertyChangedSlot'), ('partSelectedChangedSignal', 'partSelectedChangedSlot'), ('partDocumentSettingChangedSignal', 'partDocumentSettingChangedSlot')]
disconnectSignals()
cadnano.gui.controllers.itemcontrollers.virtualhelixitemcontroller module
class VirtualHelixItemController(virtualhelix_item, model_part, do_wire_part, do_wire_strands)

Bases: object

Since there is no model VirtualHelix Object, we need a specialized controller for the property view

connectSignals()
disconnectSignals()
part_connections = [('partVirtualHelixPropertyChangedSignal', 'partVirtualHelixPropertyChangedSlot'), ('partVirtualHelixRemovedSignal', 'partVirtualHelixRemovedSlot'), ('partVirtualHelixResizedSignal', 'partVirtualHelixResizedSlot')]
strand_connections = [('strandsetStrandAddedSignal', 'strandAddedSlot')]
Module contents
Submodules
cadnano.gui.controllers.documentcontroller module
cadnano.gui.controllers.viewrootcontroller module
class ViewRootController(view_root, model_document)

Bases: object

connectSignals()
disconnectSignals()
Module contents
cadnano.gui.plugins package
Submodules
cadnano.gui.plugins.dummyplugin module
Module contents
cadnano.gui.ui package
Subpackages
cadnano.gui.ui.dialogs package
Submodules
cadnano.gui.ui.dialogs.dialogicons_rc module
cadnano.gui.ui.dialogs.ui_about module
cadnano.gui.ui.dialogs.ui_addseq module
cadnano.gui.ui.dialogs.ui_latticetype module
cadnano.gui.ui.dialogs.ui_mods module
cadnano.gui.ui.dialogs.ui_preferences module
cadnano.gui.ui.dialogs.ui_warning module
Module contents
cadnano.gui.ui.mainwindow package
Submodules
cadnano.gui.ui.mainwindow.icons_rc module
cadnano.gui.ui.mainwindow.svgbutton module
cadnano.gui.ui.mainwindow.ui_mainwindow module
Module contents
Module contents
cadnano.gui.views package
Subpackages
cadnano.gui.views.abstractitems package
Submodules
cadnano.gui.views.abstractitems.abstractoligoitem module
class AbstractOligoItem

Bases: object

AbstractOligoItem is a base class for oligoitems in all views. It includes slots that get connected in OligoController which can be overridden.

Slots that must be overridden should raise an exception.

oligoPropertyChangedSlot(property_key, new_value)
oligoSequenceAddedSlot(oligo)
oligoSequenceClearedSlot(oligo)
cadnano.gui.views.abstractitems.abstractpartitem module
cadnano.gui.views.abstractitems.abstracttoolmanager module
cadnano.gui.views.abstractitems.abstractvirtualhelixitem module
class AbstractVirtualHelixItem(model_virtual_helix=None, parent=None)

Bases: object

AbstractVirtualHelixItem is a base class for virtualhelixitem in all views. It includes slots that get connected in VirtualHelixItemController which can be overridden.

Slots that must be overridden should raise an exception.

cnModel()
fwdStrand(idx)
getAllPropertiesForIdNum(id_num)
getAngularProperties()
Returns:Tuple
‘bases_per_repeat, ‘bases_per_turn’,
’twist_per_base’, ‘minor_groove_angle’
getAxisPoint(idx)
getColor()
getModelProperties()
getName()
getProperty(keys)
getSize()
getTwistPerBase()
Returns:Tuple – twist per base in degrees, eulerZ
idNum()
isActive()
part()
partItem()
revStrand(idx)
setActive(is_fwd, idx)

Makes active the virtual helix associated with this item.

setProperty(keys, values, id_nums=None)
setSize(new_size, id_nums=None)
setZ(new_z, id_nums=None)
strandAddedSlot(sender, strand)
virtualHelixPropertyChangedSlot(virtual_helix, transform)
virtualHelixRemovedSlot()
Module contents
cadnano.gui.views.outlinerview package
Submodules
cadnano.gui.views.outlinerview.cnoutlineritem module
cadnano.gui.views.outlinerview.nucleicacidpartitem module
cadnano.gui.views.outlinerview.oligoitem module
cadnano.gui.views.outlinerview.outlinerstyles module
cadnano.gui.views.outlinerview.outlinertreewidget module
cadnano.gui.views.outlinerview.virtualhelixitem module
Module contents
cadnano.gui.views.pathview package
Subpackages
cadnano.gui.views.pathview.strand package
Subpackages
cadnano.gui.views.pathview.strand.decorators package
Submodules
cadnano.gui.views.pathview.strand.decorators.abstractdecoratoritem module
cadnano.gui.views.pathview.strand.decorators.fluorophoreitem module
cadnano.gui.views.pathview.strand.decorators.insertionitem module
cadnano.gui.views.pathview.strand.decorators.skipitem module
cadnano.gui.views.pathview.strand.decorators.stapleextensionitem module
Module contents
Submodules
cadnano.gui.views.pathview.strand.abstractstranditem module
cadnano.gui.views.pathview.strand.endpointitem module
cadnano.gui.views.pathview.strand.stranditem module
cadnano.gui.views.pathview.strand.xoveritem module
Module contents
cadnano.gui.views.pathview.tools package
Submodules
cadnano.gui.views.pathview.tools.abstractpathtool module
cadnano.gui.views.pathview.tools.addseqtool module
cadnano.gui.views.pathview.tools.breaktool module
cadnano.gui.views.pathview.tools.erasetool module
cadnano.gui.views.pathview.tools.insertiontool module
cadnano.gui.views.pathview.tools.modstool module
cadnano.gui.views.pathview.tools.painttool module
cadnano.gui.views.pathview.tools.pathselection module
cadnano.gui.views.pathview.tools.pathtoolmanager module
cadnano.gui.views.pathview.tools.penciltool module
cadnano.gui.views.pathview.tools.selecttool module
cadnano.gui.views.pathview.tools.skiptool module
Module contents
Submodules
cadnano.gui.views.pathview.colorpanel module
cadnano.gui.views.pathview.nucleicacidpartitem module
cadnano.gui.views.pathview.pathextras module
cadnano.gui.views.pathview.pathrootitem module
cadnano.gui.views.pathview.pathstyles module
cadnano.gui.views.pathview.prexovermanager module
cadnano.gui.views.pathview.virtualhelixhandleitem module
cadnano.gui.views.pathview.virtualhelixitem module
Module contents
cadnano.gui.views.propertyview package
Submodules
cadnano.gui.views.propertyview.abstractproppartitem module
cadnano.gui.views.propertyview.cnpropertyitem module
cadnano.gui.views.propertyview.nucleicacidpartitem module
cadnano.gui.views.propertyview.oligoitem module
cadnano.gui.views.propertyview.propertyeditorwidget module
cadnano.gui.views.propertyview.virtualhelixitem module
Module contents
cadnano.gui.views.sliceview package
Subpackages
cadnano.gui.views.sliceview.tools package
Submodules
cadnano.gui.views.sliceview.tools.abstractslicetool module
cadnano.gui.views.sliceview.tools.createslicetool module
cadnano.gui.views.sliceview.tools.moveslicetool module
cadnano.gui.views.sliceview.tools.selectslicetool module
cadnano.gui.views.sliceview.tools.slicetoolmanager module
Module contents
Submodules
cadnano.gui.views.sliceview.griditem module
cadnano.gui.views.sliceview.nucleicacidpartitem module
cadnano.gui.views.sliceview.prexovermanager module
cadnano.gui.views.sliceview.sliceextras module
cadnano.gui.views.sliceview.slicerootitem module
cadnano.gui.views.sliceview.slicestyles module
cadnano.gui.views.sliceview.virtualhelixitem module
Module contents
Submodules
cadnano.gui.views.customqgraphicsview module
cadnano.gui.views.documentwindow module
cadnano.gui.views.grabcorneritem module
cadnano.gui.views.preferences module
cadnano.gui.views.styles module
Module contents
Submodules
cadnano.gui.palette module
Module contents
Submodules
cadnano.addinstancecmd module
class AddInstanceCommand(document, cnobj)

Bases: cadnano.undocommand.UndoCommand

Undo ready command for adding an instance.

Parameters:
  • document (Document) – m
  • obj_instance (ObjectInstance) – Object instance to add to Document
redo()
undo()
cadnano.assembly module
class Assembly(document)

Bases: cadnano.cnobject.CNObject

An Assembly is a collection of components, comprised recursively of various levels of individual parts and sub-assembly modules.

The purpose of an Assembly object in radnano is to arrange Parts into larger groups (which may be connected or constrained in specific ways) to facilitate the modeling of more complex designs than a single part.

addInstance(assembly_instance)
assemblyDestroyedSignal = <cadnano.cnproxy.DummySignal object>
assemblyInstanceAddedSignal = <cadnano.cnproxy.DummySignal object>
deepCopy()

Deep copy the assembly by cloning the

This leaves alone assemblyInstances, and only

To finish the job this deepCopy Assembly should be incorporated into a new ObjectInstance and therefore an assemblyInstance

destroy()
document()
instances()
objects()
undoStack()
cadnano.cadnanoqt module
cadnano.cnobject module
class CNObject(parent)

Bases: cadnano.cnproxy.ProxyObject

undoStack()
cadnano.cnproxy module
BaseObject

alias of cadnano.cnproxy.ProxyObject

class DummySignal(*args, **kwargs)

Bases: object

connect(target)
disconnect(target)
emit(*args)
class ProxyObject(parent)

Bases: object

connect(sender, bsignal, method)
deleteLater()
disconnect(sender, bsignal, method)
parent()
setParent(parent)
signals()
ProxySignal

alias of cadnano.cnproxy.DummySignal

class TempApp

Bases: object

documentWasCreatedSignal = <cadnano.cnproxy.DummySignal object>
is_temp_app = True
cadnano.color module

This allows the model to have a Color object class without the need for PyQt5.QtGui.QColor

When running the Qt Application, QColor will be used, otherwise an API compatible class is used and exported as a Color object

Currently Color objects are unused in the model and colors are stored as QColor compatible hex string in format ‘#rrggbbaa’, and therefore is not exposed in the API documentation

class Color(*args)

Bases: object

Overloaded constructor using *args to be compatible with QColor

usage:

Color(r, g, b)

or:

Color('#rrggbb') for hex
hex()

The hex string name.

Returns:str – QColor compatible hex string in format ‘#rrggbbaa’
name()

The hex string name. For QColor compatibility

Returns:str – QColor compatible hex string in format ‘#rrggbbaa’
setAlpha(a)

Set the alpha 8 bit value

Parameters:a (int) – 0 - 255
setRgb(r, g, b, a=255)

Set the r, g, b and alpha 8 bit values

Parameters:
  • r (int) – 0 - 255
  • g (int) – 0 - 255
  • b (int) – 0 - 255
  • a (int) – 0 - 255
intToColorHex(color_number)

Convert an integer to a hexadecimal string compatible with QColor

Parameters:color_number (int) – integer value of a RGB color
Returns:str – QColor compatible hex string in format ‘#rrggbb’
cadnano.document module
cadnano.enum module
cadnano.objectinstance module
class ObjectInstance(reference_object, parent=None)

Bases: cadnano.cnobject.CNObject

deepCopy(reference_object, parent)
destroy()
getProperty(key)
instanceDestroyedSignal = <cadnano.cnproxy.DummySignal object>
instanceParentChangedSignal = <cadnano.cnproxy.DummySignal object>
instancePropertyChangedSignal = <cadnano.cnproxy.DummySignal object>
parent()
properties()
reference()
setProperty(key, val)
shallowCopy()
cadnano.pointquadtree module

derived from MIT licensed https://github.com/mdrasmus/compbio/blob/master/rasmus/quadtree.py adds in joins and ability to remove nodes

class Quadtree(x, y, size, min_size=4)

Bases: cadnano.pointquadtree.QuadtreeBase

getSize()
insertNode(node)
queryNode(node, distance, scale_factor=1.0)
queryPoint(query_point, distance)
removeNode(node)
class QuadtreeBase(x, y, size, min_size, parent=None, depth=0)

Bases: object

QuadTreeBase that has a configurable lower size limit of a box set class min_size before using with:

Quadtree.min_size = my_min_size

QuadTrees can have both nodes and children Quadtrees if a node’s rect spans a given Quadtree’s center

MAX_DEPTH = 20
SPLIT_THRESHOLD = 10
findNodeByNode(query_node)

look for the exact node assumes same node doesn’t exist more than once in Quadtree return the Node and the nodes parent

findNodeByRect(rect)

look for the exact node assumes same node doesn’t exist more than once in Quadtree return the Node and the nodes parent

getDepth()
getSize()
insertIntoChildren(node)
insertNode(node)
join()
query(point, rect, distance, node_results)
queryRect(rect, node_results)
rect(scale_factor=1.0)
removeNode(node)
resize()
split()
allClose(a, b)
v2Distance(a, b)
cadnano.preferences module
cadnano.proxyconfigure module
proxyConfigure(signal_type=None)

call once per application at the start of the import chain

cadnano.undocommand module
class UndoCommand(name=None)

Bases: object

addCommand(cmd)
redo()
undo()
cadnano.undostack module
class UndoStack(limit=10)

Bases: object

appendUndoStack(undocommand)
beginMacro(message)
canRedo()
canUndo()
endMacro()
push(undocommand)
redo()
setUndoLimit(lim)
undo()
cadnano.util module

util.py

beginSuperMacro(model_object, desc=None)

SuperMacros can be used to nest multiple command lists.

Normally execCommandList macros all the commands in a list. In some cases, multiple command lists need to be executed separately because of dependency issues. (e.g. in part.autoStaple, strands must be completely 1. created and 2. split before 3. xover installation.)

clamp(x, min_x, max_x)
comp(seqStr)

Returns the complement of the sequence in seqStr.

doCmd(model_object, command, use_undostack)

Helper for pushing onto the undostack

endSuperMacro(model_object)

Ends a SuperMacro. Should be called after beginSuperMacro.

execCommandList(model_object, commands, desc=None, use_undostack=True)

This is a wrapper for performing QUndoCommands, meant to ensure uniform handling of the undoStack and macro descriptions.

When using the undoStack, commands are pushed onto self.undoStack() as part of a macro with description desc. Otherwise, command redo methods are called directly.

finalizeCommands(model_object, commands, desc=None)

Used to enable interaction with the model but not push commands to the undostack. In practice:

  1. Call a bunch of commands and don’t push them to the undostack AKA:
    cmd.redo()
  2. call finalizeCommands() to push the cummulative change to the stack

This assumes that the UndoCommands provided this function respresent a transition from the initial state to the final state

Note

UndoCommands need to implement specialUndo (e.g. just call normal undo.)

findChild(self)

When called when self is a QGraphicsItem, iterates through self’s childItems(), placing a red rectangle (a sibling of self) around each item in sequence (press return to move between items). Since the index of each child item is displayed as it is highlighted, one can use findChild() to quickly get a reference to one of self’s children. At each step, one can type a command letter before hitting return. The command will apply to the current child. Command Letter: Action: <return> Advance to next child s<return> Show current child S<return> Show current child, hide siblings h<return> Hide current child r<return> return current child

init_logging(args=None, logdir=None)

Set up standard logging system based on parameters in args, e.g. loglevel and testing.

isLinux()

Returns True if platform is detected as Linux, otherwise False

isMac()

Returns True if platform is detected as Darwin, otherwise False

isWindows()

Returns True if platform is detected as Windows, otherwise False

loadAllPlugins()
loadPlugin(f)
markwhite(seqStr)
methodName()

Returns string containing name of the calling method.

nearest(a, l)
nowhite(seqStr)

Gets rid of non-letters in a string.

overlap(x, y, a, b)

Finds the overlap of (x, y) and (a, b). Assumes an overlap exists, i.e. y >= a and b >= x.

parse_args(argv=None, gui=None)

Uses argparse to process commandline arguments.

Returns:NameSpace object. This can easily be converted to a regular dict through – argns.__dict__
This also presents a nice command line help to the user, exposed with –help flag:
python main.py –help

If gui is set to “qt”, then the parser will use parse_known_args. Unlike parse_args(), parse_known_args() will not cause abort by show the help message and exit, if it finds any unrecognized command-line arguments.

Alternatively, you can initialize your app via:
app = QApplication(sys.argv) parse_args(app.arguments())

QApplication.arguments() returns a list of arguments with all Qt arguments stripped away. Qt command line args include:

-style=<style> -stylesheet=<stylesheet> -widgetcount -reverse -qmljsdebugger -session=<session>
rcomp(seqStr)

Returns the reverse complement of the sequence in seqStr.

read_fasta(fp)
this_path()
trace(n)

Returns a stack trace n frames deep

unloadedPlugins()

Returns a list of plugin paths that have yet to be loaded but are in the top level of one of the search directories specified in pluginDirs

Module contents
app()
getBatch()
getReopen()
initAppWithGui(app_args=None, do_exec=True)
setBatch(is_batch)
setReopen(is_reopen)

GUI

Packages

Modules

Changelog

Unreleased

  • GUI: 3D view
  • I/O: Export to PDB (experimental)

v2.5

Major changes and new features since cadnano 2:

  • Installer: Distribution as a Python package
  • Design/GUI: Helices no longer constrained to lattices
  • Design/GUI: Added support for “abstract” sequences
  • Design/GUI: Added support for parallel crossovers
  • Code: Updated from Python 2 → 3
  • Code: Updated from PyQt4 → PyQt5
  • Code: Rewrote underlying data model
  • Code: Better stability
  • GUI: Improved hinting across views
  • GUI/Installer: Removed Maya plugin code
  • I/O: New file format
  • I/O: Easier scripting via command-line mode
  • I/O: Export to STL (experimental)

Authors

Development Leads

Patches and Suggestions

License

Copyright (c) 2016, Wyss Institute at Harvard University

Files NOT in the paths cadnano/gui and pyqttools/ are licensed as follows:

The BSD 3-Clause License

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Files in the paths cadnano/gui and pyqttools/ are licensed as follows:

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc.

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

Preamble

The GNU General Public License is a free, copyleft license for software and other kinds of works.

The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program–to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.

To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.

For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

Developers that use the GNU GPL protect your rights with two steps:

  1. assert copyright on the software, and
  2. offer you this License giving you legal permission to copy, distribute and/or modify it.

For the developers’ and authors’ protection, the GPL clearly explains that there is no warranty for this free software. For both users’ and authors’ sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.

Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users’ freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.

Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.

The precise terms and conditions for copying, distribution and modification follow.

TERMS AND CONDITIONS

0. Definitions.

This License refers to version 3 of the GNU General Public License.

Copyright also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.

The Program refers to any copyrightable work licensed under this License. Each licensee is addressed as you. Licensees and recipients may be individuals or organizations.

To modify a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a modified version of the earlier work or a work based on the earlier work.

A covered work means either the unmodified Program or a work based on the Program.

To propagate a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.

To convey a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.

An interactive user interface displays Appropriate Legal Notices to the extent that it includes a convenient and prominently visible feature that

  1. displays an appropriate copyright notice, and
  2. tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License.

If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.

1. Source Code.

The source code for a work means the preferred form of the work for making modifications to it. Object code means any non-source form of a work.

A Standard Interface means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.

The System Libraries of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A Major Component, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.

The Corresponding Source for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work’s System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.

The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.

The Corresponding Source for a work in source code form is that same work.

2. Basic Permissions.

All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.

You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.

Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.

4. Conveying Verbatim Copies.

You may convey verbatim copies of the Program’s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.

You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.

5. Conveying Modified Source Versions.

You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:

- a) The work must carry prominent notices stating that you modified it, and giving a relevant date. - b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to keep intact all notices. - c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.

A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an aggregate if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation’s users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.

6. Conveying Non-Source Forms.

You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:

- a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. - b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either 1. a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or 2. access to copy the Corresponding Source from a network server at no charge. - c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. - d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. - e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.

A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.

A User Product is either

  1. a consumer product, which means any tangible personal property which is normally used for personal, family, or household purposes, or
  2. anything designed or sold for incorporation into a dwelling.

In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, normally used refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.

Installation Information for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.

If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).

The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.

Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.

7. Additional Terms.

Additional permissions are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.

When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.

Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:

  1. Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
  2. Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
  3. Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
  4. Limiting the use for publicity purposes of names of licensors or authors of the material; or
  5. Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
  6. Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.

All other non-permissive additional terms are considered further restrictions within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.

If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.

Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.

8. Termination.

You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).

However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated

  1. provisionally, unless and until the copyright holder explicitly and finally terminates your license, and
  2. permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.

Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.

Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.

9. Acceptance Not Required for Having Copies.

You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.

10. Automatic Licensing of Downstream Recipients.

Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.

An entity transaction is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party’s predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.

You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.

11. Patents.

A contributor is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor’s contributor version.

A contributor’s essential patent claims are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, control includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.

Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor’s essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.

In the following three paragraphs, a patent license is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To grant such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.

If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either

  1. cause the Corresponding Source to be so available, or
  2. arrange to deprive yourself of the benefit of the patent license for this particular work, or
  3. arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients.

Knowingly relying means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient’s use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.

If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.

A patent license is discriminatory if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license

  1. in connection with copies of the covered work conveyed by you (or copies made from those copies), or
  2. primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.

Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.

12. No Surrender of Others’ Freedom.

If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.

13. Use with the GNU Affero General Public License.

Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.

14. Revised Versions of this License.

The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License or any later version applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.

If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Program.

Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.

15. Disclaimer of Warranty.

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

16. Limitation of Liability.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

17. Interpretation of Sections 15 and 16.

If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.

END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the copyright line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year>  <name of author>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:

<program>  Copyright (C) <year>  <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

The hypothetical commands show w and show c should show the appropriate parts of the General Public License. Of course, your program’s commands might be different; for a GUI interface, you would use an about box.

You should also get your employer (if you work as a programmer) or school, if any, to sign a copyright disclaimer for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see http://www.gnu.org/licenses/.

The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read http://www.gnu.org/philosophy/why-not-lgpl.html.


nno2stl/stlwriter.py is derived from visvis/vvio/stl.py in Visvis source.

Visvis License

Visvis is subject to the (new) BSD license:

Copyright (c) 2015, Visvis development team

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Science Applied or the University of Twente, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ALMAR KLEIN BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Visvis contributers:

  • Almar Klein (Science Applied)
  • Robert Schroll
  • Keith Smith
  • Rob Reilink (Science Applied)

How to Cite

If you use cadnano in your work, please cite its associated paper. Cadnano is free software, and we rely on grant funding to support its continued development.

Indices and tables