Strand C3D.models.SSTextend

Models a single DNA strand. Methods of this class can be used to manipulate individual strands (extending, truncating, inserting, and deleting bases); to manipulate multiple strands (e.g. for ligation or cutting), you'll want to use the strands controller.

Attributes

Access attributes with .get('name')and .set('name', value).

  • name : String

    Name of the strand

  • routing : vox.dna.Base[]

    Describes the path of the strand through helical coordinates on the lattice. Each element should have at least the following properties:

    • pos: 4-element array giving the position of the base (X/Y/Z/Z'), where Z' represents the position within a voxel.
    • dir: +1 for a base pointing 5' -> 3' along the Z-azis, -1 for a base pointing 3' -> 5'
    • seq: string indicating how sequences should be assigned to the base, or containing a single base sequence.
  • sequence : String

    Sequence of the strand; should be the same length as the routing

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

  • extend (value, [dir], [options], [generator]) -> C3D.models.SST#

    Extends the strand from the given end:

    Add the sequence 'ATAACAG' to the 3' end:

    strand.extend 'ATAACAG'
    

    Add 5 bases to the 5' end:

    strand.extend 5, -1
    
    Parameters
    value
    String/Number/Array

    Sequence to insert. If a String, inserts one base for each letter in the string (using that letter for the base). If a Number, inserts that many bases. If an Array, inserts one base for each element of the array.

    dir
    Number

    Which end to start from; +1 for 3', -1 for 5'

    (Optional; defaults to 1)
    options
    Object

    Options to apply to each base

    (Optional)
    generator
    Function

    Optional function to modify each base.

    (Optional)
    Return
    return
    C3D.models.SST

    strand

  • 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

  • get3p ( ) -> Array#

    Gets the 4-component position of the 3' end of this strand

    Return
    return
    Array

    3' end [x, y, z1, z2]

  • get5p ( ) -> Array#

    Gets the 4-component position of the 5' end of this strand

    Return
    return
    Array

    5' end [x, y, z1, z2]

  • getBase (index) -> vox.dna.Base#

    Gets the base from the routing at a particular index

    Parameters
    index
    Number
    Return
  • 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

  • insert (index, value, [options], [generator]) -> C3D.models.SST#

    Inserts some sequence or bases at the given index:

    Inserts 10 bases at the 5th base from the 5' end:

    strand.insert(5, 10)
    

    Inserts 4 T's at the 3rd base from the 3' end:

    strand.insert(-3, 'TTTT')
    

    Inserts 7 random bases at the 5' end, using a generator function:

    strand.insert 0, 7, {}, (opt, i) ->
        opt.seq = chance.character({ pool: 'ATCG' })
        opt
    
    Parameters
    index
    Number

    Index at which to insert

    value
    String/Number/Array

    Sequence to insert. If a String, inserts one base for each letter in the string (using that letter for the base). If a Number, inserts that many bases. If an Array, inserts one base for each element of the array.

    options
    Object

    Options to apply to each base

    (Optional)
    generator
    Function

    Optional function to modify each base.

    (Optional)
    Return
    return
    C3D.models.SST

    strand

  • length ( ) -> Number#

    Gets the length, in bases, of this strand

    Return
    return
    Number

    Length

  • move (dx, dy, [dz1], [dz2]) -> C3D.models.SST#

    Moves all bases in the given strand by this amount

    Parameters
    dx
    Number
    dy
    Number
    dz1
    Number (Optional; defaults to 0)
    dz2
    Number (Optional; defaults to 0)
    Return
    return
    C3D.models.SST

    strand

  • remove (index, length) -> C3D.models.SST#

    Removes bases from the strand

    Remove 5 bases from the 5' end:

    strand.remove 0, 5
    

    Remove 7 bases from the 3' end:

    strand.remove -1, -7
    

    Remove 5 bases (3' -> 5') from the base before the 3' end:

    strand.remove -2, -5
    
    Parameters
    index
    Number

    Index at which to remove (0 = 5' end); use negative numbers to count backwards from the 3' end of the strand (-1 = 3' end).

    length
    Number

    Number of bases to remove. Use positive numbers to remove in the 5' -> 3' direction, negative numbers to remove in the 3' -> 5' direction.

    Return
    return
    C3D.models.SST

    strand

  • routingString (routing) -> String#

    Generates a string representation of a given routing string

    Parameters
    routing
    vox.dna.Base[]
    Return
    return
    String

    Routing string

  • 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)
  • truncate (length, [dir]) -> C3D.models.SST#

    Removes bases from the 5' or 3' end of the strand

    Remove 2 bases from the 3' end:

    strand.truncate 2
    

    Remove 6 bases from the 5' end:

    strand.truncate 6, -1
    
    Parameters
    length
    Number

    Number of bases to remove

    dir
    Number

    Which end to remove from; +1 for 3', -1 for 5'

    (Optional; defaults to 1)
    Return
    return
    C3D.models.SST

    strand

  • 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)