Strand Controller C3D.ctrls.SSTextend

Tracks and manages DNA strands (single-stranded tiles).

Properties

Access properties with .nameand .name = value.

  • canvas : C3D.Canvas3D

    Reference to the canvas to which this controller belongs

  • strandMap : ndarray

    5D array mapping positions to strands and base indices; the dimensions are:

    [ @canvas.lattice.width,
      @canvas.lattice.height,
      @canvas.lattice.depth,
      @canvas.lattice.maxLength(),
      2 ]
    

    where the 4th axis refers to the base-wise position (z2) along the lattice and the 5th axis refers to the direction of the strand (0 = 3' -> 5', and 1 = 5' -> 3').

    Each element of this array is itself a 2D array:

    [ {C3D.models.SST}, {Number} ]
    

    where the second element is the index of the base at this position.

  • strands : Backbone.Collection

    Cache of strand objects

  • tss : C3D.models.TranslationScheme[]

    Array of active translation scheme instances in the canvas

Methods

Call methods with.name(),.name(arguments)or just .name arguments .

  • clear ([options]) -> undefined# Backbone.Model

    Removes all attributes from the model, including the id attribute. Fires a "change" event unless silent is passed as an option.

    Parameters
    options
    Object (Optional)
  • clone ( ) -> Backbone.Model# Backbone.Model

    Returns a copy of the model.

    Return
    return
    Backbone.Model

    copy of the model

  • compile (options) -> undefined#

    Compiles the voxels in the C3D.ctrls.Voxels controller on this controller's canvas to strands, using the configured translation scheme.

    Parameters
    options
    Object
  • cutStrand (strand, index) -> C3D.models.SST[]#

    Cuts the passed strand into two different strands between the passed index and index + 1.

    Parameters
    strand
    C3D.models.SST

    Strand to cut

    index
    Number

    Index at which to cut; strand will be cut between index and index + 1.

    Return
    return
    C3D.models.SST[]

    The two new strands

  • fromCaDNAno (data) -> undefined#

    Loads data from a caDNAno file-like data structure

    Parameters
    data
    vox.dna.CaDNAno

    Contents of a deserialized caDNAno JSON file

  • generateSequences ( ) -> undefined#

    Generates sequences using the configured C3D.models.SequenceSet, or a C3D.models.RandomSequenceSet if none is configured.

  • get (attribute) -> Mixed# Backbone.Model

    Get the current value of an attribute from the model. For example: note.get("title")

    Parameters
    attribute
    String

    Attribute to get

    Return
    return
    Mixed

    value of the attribute

  • getStrandAt (x, y, z1, z2, [dir]) -> Array/undefined#

    Gets the strand and base at a given 4-component lattice position

    Parameters
    x
    Number
    y
    Number
    z1
    Number

    Voxel position

    z2
    Number

    Base position (within voxel)

    dir
    -1/1

    Strand direction to search for (+1 for 5' -> 3', -1 for 3' -> 5')

    (Optional; defaults to 1)
    Return
    return
    Array/undefined

    2-element array containing the - C3D.models.SST : strand object - Number : index of the base within the strand or undefined if there is no base at this position.

  • getStrandsAt (x, y, z1, [dir]) -> Array#

    Gets the strands and bases at a given 3-component lattice position; this tells you all strands that participate in a given voxel/domain.

    Parameters
    x
    Number
    y
    Number
    z1
    Number

    Voxel position

    dir
    -1/1

    Strand direction to search for (+1 for 5' -> 3', -1 for 3' -> 5')

    (Optional; defaults to 1)
    Return
    return
    Array

    Array with one element for each base in the domain; that is, the length of this array will be equal to <code>@canvas.lattice.length(x,y,z1)</code>.

    Each element of this array is a 2-element array containing the - C3D.models.SST : strand object - Number : index of the base within the strand or undefined if there is no base at this position.

  • has (attribute) -> Boolean# Backbone.Model

    Returns true if the attribute is set to a non-null or non-undefined value.

    if (note.has("title")) {
      ...
    }
    
    Parameters
    attribute
    String
    Return
    return
    Boolean

    true if the attribute is non-null or non-undefined, else false

  • hasBaseAt (x, y, z1, z2, [dir]) -> Boolean#

    Determines whether there is a base at the given 4-component lattice position

    Parameters
    x
    Number
    y
    Number
    z1
    Number

    Voxel position

    z2
    Number

    Base position (within voxel)

    dir
    -1/1

    Strand direction to search for (+1 for 5' -> 3', -1 for 3' -> 5'); by default searches both directions

    (Optional; defaults to null)
    Return
    return
    Boolean

    true if any strand has a base here, else false

  • hasStrandAt (x, y, z1, [dir]) -> Boolean#

    Determines whether there is a base at the given 3-component lattice position; that is, whether any base in a given voxel has a strand

    Parameters
    x
    Number
    y
    Number
    z1
    Number

    Voxel position

    dir
    -1/1

    Strand direction to search for (+1 for 5' -> 3', -1 for 3' -> 5'); by default searches both directions

    (Optional; defaults to null)
    Return
    return
    Boolean

    true if any strand has a base here, else false

  • ligateStrands (strand1, strand2) -> C3D.models.SST#

    Ligates two strands into one new strand; specifically, ligates the 3' end of strand1 to the 5' end of strand2.

    Parameters
    Return
    return
    C3D.models.SST

    New strand

  • remove (model) -> C3D.models.SST#

    Removes the passed strand and returns it

    Parameters
    Return
  • selectTransform (select, transform) -> undefined#

    Select strands according to an arbitrary predicate, then transform them using an arbitrary transformation function.

    Parameters
    select
    Function

    Selection predicate function

    transform
    Function

    Transformation function

  • set (attribute, [options]) -> undefined# Backbone.Model

    Set a hash of attributes (one or many) on the model. If any of the attributes change the model's state, a change event will be triggered on the model. Change events for specific attributes are also triggered, and you can bind to those as well, for example: change:title, and change:content. You may also pass individual keys and values.

    note.set({title: "March 20", content: "In his eyes she eclipses..."});
    
    book.set("title", "A Scandal in Bohemia");
    
    Parameters
    attribute
    String/Object

    (s)

    options
    Object (Optional)
  • toCSV ( ) -> String#

    Exports strand sequences to comma-separated values (CSV) format

    Return
    return
    String

    CSV text

  • toCaDNAno ( ) -> vox.dna.CaDNAno#

    Exports strands to the caDNAno JSON format

    Return
    return
    vox.dna.CaDNAno

    Object suitable to be serialized to a caDNAno JSON file

  • toCanDo ( ) -> String#

    Exports the structure to a CanDo table format

    Return
    return
    String

    CanDo table

  • unset (attribute, [options]) -> undefined# Backbone.Model

    Remove an attribute by deleting it from the internal attributes hash. Fires a "change" event unless silent is passed as an option.

    Parameters
    attribute
    String
    options
    Object (Optional)