Skip to content
This repository has been archived by the owner on May 22, 2022. It is now read-only.
Seb edited this page Aug 31, 2014 · 3 revisions

Backbone models are used to describe the data.

You can modify the model with get and set.

name: "" (alphanumeric string)
id: "" (unique!)
seq: "" (e.g. AZEDNNM)

Collection of sequences.

example obj.

[{id: 1, name: "i1", seq: "ABC"},
{id: 2, name: "i2", seq: "DEF"}]

Cool stuff you can do:

msa.seqs.pluck('id') // [1,2] (mapping)
msa.seqs.max(function(el){ el.get('name').length)) //  i2 (longest name)
msa.seqs.reduce(function(memo, el){ return memo += el.get('seq') } // ABCDEF (reducing)

There is even more possible - check it out.

Clone this wiki locally