diff --git a/visualizations/biojs-msa/config/biojs-msa.xml b/visualizations/biojs-msa/config/biojs-msa.xml new file mode 100644 index 00000000000..52dcfd8059c --- /dev/null +++ b/visualizations/biojs-msa/config/biojs-msa.xml @@ -0,0 +1,20 @@ + + + + + + HistoryDatasetAssociation + sequence.Fasta + dataset_id + + + HistoryDatasetAssociation + sequences + dataset_id + + + + dataset_id + + + diff --git a/visualizations/biojs-msa/static/msa.min.js b/visualizations/biojs-msa/static/msa.min.js new file mode 100644 index 00000000000..49a54b92de9 --- /dev/null +++ b/visualizations/biojs-msa/static/msa.min.js @@ -0,0 +1,4 @@ +require=function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return r(n?n:e)},c,c.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;si;i++){var s=e[i]=this.get(e[i]);if(s){var a=this.modelId(s.attributes);null!=a&&delete this._byId[a],delete this._byId[s.cid];var l=this.indexOf(s);this.models.splice(l,1),this.length--,t.silent||(t.index=l,s.trigger("remove",s,this,t)),this._removeReference(s,t)}}return n?e[0]:e},set:function(e,t){t=r.defaults({},t,u),t.parse&&(e=this.parse(e,t));var n=!r.isArray(e);e=n?e?[e]:[]:e.slice();for(var i,o,s,a,l,c=t.at,h=this.comparator&&null==c&&t.sort!==!1,d=r.isString(this.comparator)?this.comparator:null,f=[],g=[],m={},p=t.add,v=t.merge,b=t.remove,x=!h&&p&&b?[]:!1,w=0,y=e.length;y>w;w++){if(s=e[w],a=this.get(s))b&&(m[a.cid]=!0),v&&s!==a&&(s=this._isModel(s)?s.attributes:s,t.parse&&(s=a.parse(s,t)),a.set(s,t),h&&!l&&a.hasChanged(d)&&(l=!0)),e[w]=a;else if(p){if(o=e[w]=this._prepareModel(s,t),!o)continue;f.push(o),this._addReference(o,t)}o=a||o,o&&(i=this.modelId(o.attributes),!x||!o.isNew()&&m[i]||x.push(o),m[i]=!0)}if(b){for(var w=0,y=this.length;y>w;w++)m[(o=this.models[w]).cid]||g.push(o);g.length&&this.remove(g,t)}if(f.length||x&&x.length)if(h&&(l=!0),this.length+=f.length,null!=c)for(var w=0,y=f.length;y>w;w++)this.models.splice(c+w,0,f[w]);else{x&&(this.models.length=0);for(var _=x||f,w=0,y=_.length;y>w;w++)this.models.push(_[w])}if(l&&this.sort({silent:!0}),!t.silent){for(var k=null!=c?r.clone(t):t,w=0,y=f.length;y>w;w++)null!=c&&(k.index=c+w),(o=f[w]).trigger("add",o,this,k);(l||x&&x.length)&&this.trigger("sort",this,t)}return n?e[0]:e},reset:function(e,t){t||(t={});for(var n=0,i=this.models.length;i>n;n++)this._removeReference(this.models[n],t);return t.previousModels=this.models,this._reset(),e=this.add(e,r.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,r.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e),t},unshift:function(e,t){return this.add(e,r.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(){return a.apply(this.models,arguments)},get:function(e){if(null==e)return void 0;var t=this.modelId(this._isModel(e)?e.attributes:e);return this._byId[e]||this._byId[t]||this._byId[e.cid]},at:function(e){return 0>e&&(e+=this.length),this.models[e]},where:function(e,t){return r.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var n in e)if(e[n]!==t.get(n))return!1;return!0})},findWhere:function(e){return this.where(e,!0)},sort:function(e){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return e||(e={}),r.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(r.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return r.invoke(this.models,"get",e)},fetch:function(e){e=e?r.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=e.success,n=this;return e.success=function(i){var r=e.reset?"reset":"set";n[r](i,e),t&&t(n,i,e),n.trigger("sync",n,i,e)},wrapError(this,e),this.sync("read",this,e)},create:function(e,t){if(t=t?r.clone(t):{},!(e=this._prepareModel(e,t)))return!1;t.wait||this.add(e,t);var n=this,i=t.success;return t.success=function(e,r){t.wait&&n.add(e,t),i&&i(e,r,t)},e.save(null,t),e},parse:function(e){return e},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(e){return e[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(this._isModel(e))return e.collection||(e.collection=this),e;t=t?r.clone(t):{},t.collection=this;var n=new this.model(e,t);return n.validationError?(this.trigger("invalid",this,n.validationError,t),!1):n},_isModel:function(e){return e instanceof o},_addReference:function(e){this._byId[e.cid]=e;var t=this.modelId(e.attributes);null!=t&&(this._byId[t]=e),e.on("all",this._onModelEvent,this)},_removeReference:function(e){this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,i){if("add"!==e&&"remove"!==e||n===this){if("destroy"===e&&this.remove(t,i),"change"===e){var r=this.modelId(t.previousAttributes()),o=this.modelId(t.attributes);r!==o&&(null!=r&&delete this._byId[r],null!=o&&(this._byId[o]=t))}this.trigger.apply(this,arguments)}}});var h=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample","partition"];r.each(h,function(e){r[e]&&(l.prototype[e]=function(){var t=a.call(arguments);return t.unshift(this.models),r[e].apply(r,t)})});var d=["groupBy","countBy","sortBy","indexBy"];r.each(d,function(e){r[e]&&(l.prototype[e]=function(t,n){var i=r.isFunction(t)?t:function(e){return e.get(t)};return r[e](this.models,i,n)})}),l.extend=i,t.exports=l},{"./model":6,"backbone-events-standalone":8,"backbone-extend-standalone":9,underscore:59}],5:[function(e,t){t.exports.Model=e("./model"),t.exports.Collection=e("./collection"),t.exports.Events=e("backbone-events-standalone"),t.exports.extend=e("backbone-extend-standalone")},{"./collection":4,"./model":6,"backbone-events-standalone":8,"backbone-extend-standalone":9}],6:[function(e,t){var n=e("backbone-events-standalone"),i=e("backbone-extend-standalone"),r=e("underscore"),o=function(e,t){var n=e||{};t||(t={}),this.cid=r.uniqueId("c"),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(n=this.parse(n,t)||{}),n=r.defaults({},n,r.result(this,"defaults")),this.set(n,t),this.changed={},this.initialize.apply(this,arguments)};r.extend(o.prototype,n,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(){return r.clone(this.attributes)},sync:function(){return Backbone.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return r.escape(this.get(e))},has:function(e){return null!=this.get(e)},set:function(e,t,n){var i,o,s,a,l,u,c,h;if(null==e)return this;if("object"==typeof e?(o=e,n=t):(o={})[e]=t,n||(n={}),!this._validate(o,n))return!1;s=n.unset,l=n.silent,a=[],u=this._changing,this._changing=!0,u||(this._previousAttributes=r.clone(this.attributes),this.changed={}),h=this.attributes,c=this._previousAttributes,this.idAttribute in o&&(this.id=o[this.idAttribute]);for(i in o)t=o[i],r.isEqual(h[i],t)||a.push(i),r.isEqual(c[i],t)?delete this.changed[i]:this.changed[i]=t,s?delete h[i]:h[i]=t;if(!l){a.length&&(this._pending=n);for(var d=0,f=a.length;f>d;d++)this.trigger("change:"+a[d],this,h[a[d]],n)}if(u)return this;if(!l)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,r.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var n in this.attributes)t[n]=void 0;return this.set(t,r.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!r.isEmpty(this.changed):r.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?r.clone(this.changed):!1;var t,n=!1,i=this._changing?this._previousAttributes:this.attributes;for(var o in e)r.isEqual(i[o],t=e[o])||((n||(n={}))[o]=t);return n},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return r.clone(this._previousAttributes)},fetch:function(e){e=e?r.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=this,n=e.success;return e.success=function(i){return t.set(t.parse(i,e),e)?(n&&n(t,i,e),t.trigger("sync",t,i,e),void 0):!1},wrapError(this,e),this.sync("read",this,e)},save:function(e,t,n){var i,o,s,a=this.attributes;if(null==e||"object"==typeof e?(i=e,n=t):(i={})[e]=t,n=r.extend({validate:!0},n),i&&!n.wait){if(!this.set(i,n))return!1}else if(!this._validate(i,n))return!1;i&&n.wait&&(this.attributes=r.extend({},a,i)),void 0===n.parse&&(n.parse=!0);var l=this,u=n.success;return n.success=function(e){l.attributes=a;var t=l.parse(e,n);return n.wait&&(t=r.extend(i||{},t)),r.isObject(t)&&!l.set(t,n)?!1:(u&&u(l,e,n),l.trigger("sync",l,e,n),void 0)},wrapError(this,n),o=this.isNew()?"create":n.patch?"patch":"update","patch"!==o||n.attrs||(n.attrs=i),s=this.sync(o,this,n),i&&n.wait&&(this.attributes=a),s},destroy:function(e){e=e?r.clone(e):{};var t=this,n=e.success,i=function(){t.stopListening(),t.trigger("destroy",t,t.collection,e)};if(e.success=function(r){(e.wait||t.isNew())&&i(),n&&n(t,r,e),t.isNew()||t.trigger("sync",t,r,e)},this.isNew())return e.success(),!1;wrapError(this,e);var o=this.sync("delete",this,e);return e.wait||i(),o},url:function(){var e=r.result(this,"urlRoot")||r.result(this.collection,"url")||urlError();return this.isNew()?e:e.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(e){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(e){return this._validate({},r.extend(e||{},{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=r.extend({},this.attributes,e);var n=this.validationError=this.validate(e,t)||null;return n?(this.trigger("invalid",this,n,r.extend(t,{validationError:n})),!1):!0}});var s=["keys","values","pairs","invert","pick","omit","chain","isEmpty"];r.each(s,function(e){r[e]&&(o.prototype[e]=function(){var t=slice.call(arguments);return t.unshift(this.attributes),r[e].apply(r,t)})}),o.extend=i,t.exports=o},{"backbone-events-standalone":8,"backbone-extend-standalone":9,underscore:59}],7:[function(e,t,n){!function(){function e(){return{keys:Object.keys||function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("keys() called on a non-object");var t,n=[];for(t in e)e.hasOwnProperty(t)&&(n[n.length]=t);return n},uniqueId:function(e){var t=++u+"";return e?e+t:t},has:function(e,t){return a.call(e,t)},each:function(e,t,n){if(null!=e)if(s&&e.forEach===s)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,r=e.length;r>i;i++)if(t.call(n,e[i],i,e)===o)return}else for(var a in e)if(this.has(e,a)&&t.call(n,e[a],a,e)===o)return},once:function(e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments),e=null,t)}}}}var i,r=this,o={},s=Array.prototype.forEach,a=Object.prototype.hasOwnProperty,l=Array.prototype.slice,u=0,c=e();i={on:function(e,t,n){if(!d(this,"on",e,[t,n])||!t)return this;this._events||(this._events={});var i=this._events[e]||(this._events[e]=[]);return i.push({callback:t,context:n,ctx:n||this}),this},once:function(e,t,n){if(!d(this,"once",e,[t,n])||!t)return this;var i=this,r=c.once(function(){i.off(e,r),t.apply(this,arguments)});return r._callback=t,this.on(e,r,n)},off:function(e,t,n){var i,r,o,s,a,l,u,h;if(!this._events||!d(this,"off",e,[t,n]))return this;if(!e&&!t&&!n)return this._events={},this;for(s=e?[e]:c.keys(this._events),a=0,l=s.length;l>a;a++)if(e=s[a],o=this._events[e]){if(this._events[e]=i=[],t||n)for(u=0,h=o.length;h>u;u++)r=o[u],(t&&t!==r.callback&&t!==r.callback._callback||n&&n!==r.context)&&i.push(r);i.length||delete this._events[e]}return this},trigger:function(e){if(!this._events)return this;var t=l.call(arguments,1);if(!d(this,"trigger",e,t))return this;var n=this._events[e],i=this._events.all;return n&&f(n,t),i&&f(i,arguments),this},stopListening:function(e,t,n){var i=this._listeners;if(!i)return this;var r=!t&&!n;"object"==typeof t&&(n=this),e&&((i={})[e._listenerId]=e);for(var o in i)i[o].off(t,n,this),r&&delete this._listeners[o];return this}};var h=/\s+/,d=function(e,t,n,i){if(!n)return!0;if("object"==typeof n){for(var r in n)e[t].apply(e,[r,n[r]].concat(i));return!1}if(h.test(n)){for(var o=n.split(h),s=0,a=o.length;a>s;s++)e[t].apply(e,[o[s]].concat(i));return!1}return!0},f=function(e,t){var n,i=-1,r=e.length,o=t[0],s=t[1],a=t[2];switch(t.length){case 0:for(;++ih;h++)if(u=e[h],">"===u[0]||";"===u[0]){if(l=u.slice(1),t=new r("",l,c.length),c.push(t),o.contains("|",u)){for(s=l.split("|"),a=1;a0?o>=r:r>=o;n=r+=t)i.push(e.substr(n,t));return i},t.exports=n},{}],24:[function(e,t){var n,i;i=e("./utils"),t.exports=n=function(){function e(){}return e["export"]=function(e,t){var n,r,o,s;for(r="",o=0,s=e.length;s>o;o++)n=e[o],null!=t&&(n=t(n)),r+=">"+n.name+"\n",r+=i.splitNChars(n.seq,80).join("\n"),r+="\n";return r},e}()},{"./utils":23}],25:[function(e,t){t.exports.seq=e("./seq")},{"./seq":26}],26:[function(e,t){t.exports=function(e,t,n){this.seq=e,this.name=t,this.id=n,this.meta={}}},{}],27:[function(e,t){t.exports=e(25)},{"./seq":28,"/home/xsebi/biojs.bak/packages/biojs-vis-msa/node_modules/biojs-io-fasta/node_modules/biojs-model/src/index.js":25}],28:[function(e,t){t.exports=e(26)},{"/home/xsebi/biojs.bak/packages/biojs-vis-msa/node_modules/biojs-io-fasta/node_modules/biojs-model/src/seq.js":26}],29:[function(e,t){t.exports=e("./src/index.js")},{"./src/index.js":36}],30:[function(e,t){t.exports={A:"#00a35c",R:"#00fc03",N:"#00eb14",D:"#00eb14",C:"#0000ff",Q:"#00f10e",E:"#00f10e",G:"#009d62",H:"#00d52a",I:"#0054ab",L:"#007b84",K:"#00ff00",M:"#009768",F:"#008778",P:"#00e01f",S:"#00d52a",T:"#00db24",W:"#00a857",Y:"#00e619",V:"#005fa0",B:"#00eb14",X:"#00b649",Z:"#00f10e"}},{}],31:[function(e,t){t.exports={A:"#BBBBBB",B:"grey",C:"yellow",D:"red",E:"red",F:"magenta",G:"brown",H:"#00FFFF",I:"#BBBBBB",J:"#fff",K:"#00FFFF",L:"#BBBBBB",M:"#BBBBBB",N:"green",O:"#fff",P:"brown",Q:"green",R:"#00FFFF",S:"green",T:"green",U:"#fff",V:"#BBBBBB",W:"magenta",X:"grey",Y:"magenta",Z:"grey",Gap:"grey"}},{}],32:[function(e,t){t.exports={A:"orange",B:"#fff",C:"green",D:"red",E:"red",F:"blue",G:"orange",H:"red",I:"green",J:"#fff",K:"red",L:"green",M:"green",N:"#fff",O:"#fff",P:"orange",Q:"#fff",R:"red",S:"orange",T:"orange",U:"#fff",V:"green",W:"blue",X:"#fff",Y:"blue",Z:"#fff",Gap:"#fff"}},{}],33:[function(e,t){t.exports={A:"#80a0f0",R:"#f01505",N:"#00ff00",D:"#c048c0",C:"#f08080",Q:"#00ff00",E:"#c048c0",G:"#f09048",H:"#15a4a4",I:"#80a0f0",L:"#80a0f0",K:"#f01505",M:"#80a0f0",F:"#80a0f0",P:"#ffff00",S:"#00ff00",T:"#00ff00",W:"#80a0f0",Y:"#15a4a4",V:"#80a0f0",B:"#fff",X:"#fff",Z:"#fff"}},{}],34:[function(e,t){t.exports={A:"#e718e7",R:"#6f906f",N:"#1be41b",D:"#778877",C:"#23dc23",Q:"#926d92",E:"#ff00ff",G:"#00ff00",H:"#758a75",I:"#8a758a",L:"#ae51ae",K:"#a05fa0",M:"#ef10ef",F:"#986798",P:"#00ff00",S:"#36c936",T:"#47b847",W:"#8a758a",Y:"#21de21",V:"#857a85",B:"#49b649",X:"#758a75",Z:"#c936c9"}},{}],35:[function(e,t){t.exports={A:"#ad0052",B:"#0c00f3",C:"#c2003d",D:"#0c00f3",E:"#0c00f3",F:"#cb0034",G:"#6a0095",H:"#1500ea",I:"#ff0000",J:"#fff",K:"#0000ff",L:"#ea0015",M:"#b0004f",N:"#0c00f3",O:"#fff",P:"#4600b9",Q:"#0c00f3",R:"#0000ff",S:"#5e00a1",T:"#61009e",U:"#fff",V:"#f60009",W:"#5b00a4",X:"#680097",Y:"#4f00b0",Z:"#0c00f3"}},{}],36:[function(e,t){t.exports.selector=e("./selector"),t.exports.taylor=e("./taylor"),t.exports.zappo=e("./zappo"),t.exports.hydro=e("./hydrophobicity"),t.exports.clustal=e("./clustal"),t.exports.clustal2=e("./clustal2"),t.exports.curied=e("./buried"),t.exports.cinema=e("./cinema"),t.exports.nucleotide=e("./nucleotide"),t.exports.helix=e("./helix"),t.exports.lesk=e("./lesk"),t.exports.mae=e("./mae"),t.exports.purine=e("./purine"),t.exports.strand=e("./strand"),t.exports.turn=e("./turn")},{"./buried":30,"./cinema":31,"./clustal":32,"./clustal2":33,"./helix":34,"./hydrophobicity":35,"./lesk":37,"./mae":38,"./nucleotide":39,"./purine":40,"./selector":41,"./strand":42,"./taylor":43,"./turn":44,"./zappo":45}],37:[function(e,t){t.exports={A:" orange",B:" #fff",C:" green",D:" red",E:" red",F:" green",G:" orange",H:" magenta",I:" green",J:" #fff",K:" red",L:" green",M:" green",N:" magenta",O:" #fff",P:" green",Q:" magenta",R:" red",S:" orange",T:" orange",U:" #fff",V:" green",W:" green",X:" #fff",Y:" green",Z:" #fff",Gap:" #fff"}},{}],38:[function(e,t){t.exports={A:" #77dd88",B:" #fff",C:" #99ee66",D:" #55bb33",E:" #55bb33",F:" #9999ff",G:" #77dd88",H:" #5555ff",I:" #66bbff",J:" #fff",K:" #ffcc77",L:" #66bbff",M:" #66bbff",N:" #55bb33",O:" #fff",P:" #eeaaaa",Q:" #55bb33",R:" #ffcc77",S:" #ff4455",T:" #ff4455",U:" #fff",V:" #66bbff",W:" #9999ff",X:" #fff",Y:" #9999ff",Z:" #fff",Gap:" #fff"}},{}],39:[function(e,t){t.exports={A:" #64F73F",C:" #FFB340",G:" #EB413C",T:" #3C88EE",U:" #3C88EE"}},{}],40:[function(e,t){t.exports={A:" #FF83FA",C:" #40E0D0",G:" #FF83FA",R:" #FF83FA",T:" #40E0D0",U:" #40E0D0",Y:" #40E0D0"}},{}],41:[function(e,t){var n=e("./buried"),i=e("./cinema"),r=e("./clustal"),o=e("./clustal2"),s=e("./helix"),a=e("./hydrophobicity"),l=e("./lesk"),u=e("./mae"),c=e("./nucleotide"),h=e("./purine"),d=e("./strand"),f=e("./taylor"),g=e("./turn"),m=e("./zappo");t.exports=Colors={mapping:{buried:n,buried_index:n,cinema:i,clustal2:o,clustal:r,helix:s,helix_propensity:s,hydro:a,lesk:l,mae:u,nucleotide:c,purine:h,purine_pyrimidine:h,strand:d,strand_propensity:d,taylor:f,turn:g,turn_propensity:g,zappo:m},getColor:function(e){var t=Colors.mapping[e];return void 0===t&&(t={}),t}}},{"./buried":30,"./cinema":31,"./clustal":32,"./clustal2":33,"./helix":34,"./hydrophobicity":35,"./lesk":37,"./mae":38,"./nucleotide":39,"./purine":40,"./strand":42,"./taylor":43,"./turn":44,"./zappo":45}],42:[function(e,t){t.exports={A:"#5858a7",R:"#6b6b94",N:"#64649b",D:"#2121de",C:"#9d9d62",Q:"#8c8c73",E:"#0000ff",G:"#4949b6",H:"#60609f",I:"#ecec13",L:"#b2b24d",K:"#4747b8",M:"#82827d",F:"#c2c23d",P:"#2323dc",S:"#4949b6",T:"#9d9d62",W:"#c0c03f",Y:"#d3d32c",V:"#ffff00",B:"#4343bc",X:"#797986",Z:"#4747b8"}},{}],43:[function(e,t){t.exports={A:"#ccff00",R:"#0000ff",N:"#cc00ff",D:"#ff0000",C:"#ffff00",Q:"#ff00cc",E:"#ff0066",G:"#ff9900",H:"#0066ff",I:"#66ff00",L:"#33ff00",K:"#6600ff",M:"#00ff00",F:"#00ff66",P:"#ffcc00",S:"#ff3300",T:"#ff6600",W:"#00ccff",Y:"#00ffcc",V:"#99ff00",B:"#fff",X:"#fff",Z:"#fff"}},{}],44:[function(e,t){t.exports={A:"#2cd3d3",R:"#708f8f",N:"#ff0000",D:"#e81717",C:"#a85757",Q:"#3fc0c0",E:"#778888",G:"#ff0000",H:"#708f8f",I:"#00ffff",L:"#1ce3e3",K:"#7e8181",M:"#1ee1e1",F:"#1ee1e1",P:"#f60909",S:"#e11e1e",T:"#738c8c",W:"#738c8c",Y:"#9d6262",V:"#07f8f8",B:"#f30c0c",X:"#7c8383",Z:"#5ba4a4"}},{}],45:[function(e,t){t.exports={A:"#ffafaf",R:"#6464ff",N:"#00ff00",D:"#ff0000",C:"#ffff00",Q:"#00ff00",E:"#ff0000",G:"#ff00ff",H:"#6464ff",I:"#ffafaf",L:"#ffafaf",K:"#6464ff",M:"#ffafaf",F:"#ffc800",P:"#ff00ff",S:"#00ff00",T:"#00ff00",W:"#ffc800",Y:"#ffc800",V:"#ffafaf",B:"#fff",X:"#fff",Z:"#fff"}},{}],46:[function(e,t){var n=window.HTMLCanvasElement&&window.HTMLCanvasElement.prototype,i=window.Blob&&function(){try{return Boolean(new Blob)}catch(e){return!1}}(),r=i&&window.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(e){return!1}}(),o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=(i||o)&&window.atob&&window.ArrayBuffer&&window.Uint8Array&&function(e){var t,n,s,a,l,u;for(t=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):decodeURIComponent(e.split(",")[1]),n=new ArrayBuffer(t.length),s=new Uint8Array(n),a=0;a0&&n-1 in t}function i(e,t){var n,i;this.originalEvent=e,i=function(e,t){this[e]="preventDefault"===e?function(){return this.defaultPrevented=!0,t[e]()}:m(t[e])?function(){return t[e]()}:t[e]};for(n in e)(e[n]||"function"==typeof e[n])&&i.call(this,n,e);v.extend(this,t)}var r,o=e.$,s=e.jBone,a=/^<(\w+)\s*\/?>$/,l=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,u=[].slice,c=[].splice,h=Object.keys,d=document,f=function(e){return"string"==typeof e},g=function(e){return e instanceof Object},m=function(e){var t={};return e&&"[object Function]"===t.toString.call(e)},p=function(e){return Array.isArray(e)},v=function(e,t){return new r.init(e,t)};v.noConflict=function(){return e.$=o,e.jBone=s,v},r=v.fn=v.prototype={init:function(e,t){var n,i,r,o;if(!e)return this;if(f(e)){if(i=a.exec(e))return this[0]=d.createElement(i[1]),this.length=1,g(t)&&this.attr(t),this;if((i=l.exec(e))&&i[1]){for(o=d.createDocumentFragment(),r=d.createElement("div"),r.innerHTML=e;r.lastChild;)o.appendChild(r.firstChild);return n=u.call(o.childNodes),v.merge(this,n)}if(v.isElement(t))return v(t).find(e);try{return n=d.querySelectorAll(e),v.merge(this,n)}catch(s){return this}}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?e():e instanceof v?e:v.makeArray(e,this)},pop:[].pop,push:[].push,reverse:[].reverse,shift:[].shift,sort:[].sort,splice:[].splice,slice:[].slice,indexOf:[].indexOf,forEach:[].forEach,unshift:[].unshift,concat:[].concat,join:[].join,every:[].every,some:[].some,filter:[].filter,map:[].map,reduce:[].reduce,reduceRight:[].reduceRight,length:0},r.constructor=v,r.init.prototype=r,v.setId=function(t){var n=t.jid;t===e?n="window":void 0===t.jid&&(t.jid=n=++v._cache.jid),v._cache.events[n]||(v._cache.events[n]={})},v.getData=function(t){t=t instanceof v?t[0]:t;var n=t===e?"window":t.jid;return{jid:n,events:v._cache.events[n]}},v.isElement=function(e){return e&&e instanceof v||e instanceof HTMLElement||f(e)},v._cache={events:{},jid:0},v.merge=function(e,t){for(var n=t.length,i=e.length,r=0;n>r;)e[i++]=t[r++];return e.length=i,e},v.contains=function(e,t){var n;return e.reverse().some(function(e){return e.contains(t)?n=e:void 0}),n},v.extend=function(e){var t,n,i,r;return c.call(arguments,1).forEach(function(o){if(o)for(t=h(o),n=t.length,i=0,r=e;n>i;i++)r[t[i]]=o[t[i]]}),e},v.makeArray=function(e,t){var i=t||[];return null!==e&&(n(e)?v.merge(i,f(e)?[e]:e):i.push(e)),i},v.Event=function(e,t){var n,i;return e.type&&!t&&(t=e,e=e.type),n=e.split(".").splice(1).join("."),i=e.split(".")[0],e=d.createEvent("Event"),e.initEvent(i,!0,!0),v.extend(e,{namespace:n,isDefaultPrevented:function(){return e.defaultPrevented}},t)},r.on=function(e){var t,n,r,o,s,a,l,u,c=arguments,h=this.length,d=0;for(2===c.length?t=c[1]:(n=c[1],t=c[2]),u=function(u){v.setId(u),s=v.getData(u).events,e.split(" ").forEach(function(e){a=e.split(".")[0],r=e.split(".").splice(1).join("."),s[a]=s[a]||[],o=function(e){e.namespace&&e.namespace!==r||(l=null,n?(~v(u).find(n).indexOf(e.target)||(l=v.contains(v(u).find(n),e.target)))&&(l=l||e.target,e=new i(e,{currentTarget:l}),t.call(l,e)):t.call(u,e))},s[a].push({namespace:r,fn:o,originfn:t}),u.addEventListener&&u.addEventListener(a,o,!1)})};h>d;d++)u(this[d]);return this},r.one=function(e){var t,n,i,r=arguments,o=0,s=this.length;for(2===r.length?t=r[1]:(n=r[1],t=r[2]),i=function(i){e.split(" ").forEach(function(e){var r=function(n){v(i).off(e,r),t.call(i,n)};n?v(i).on(e,n,r):v(i).on(e,r)})};s>o;o++)i(this[o]);return this},r.trigger=function(e){var t,n=[],i=0,r=this.length;if(!e)return this;for(f(e)?n=e.split(" ").map(function(e){return v.Event(e)}):(e=e instanceof Event?e:v.Event(e),n=[e]),t=function(e){n.forEach(function(t){t.type&&e.dispatchEvent&&e.dispatchEvent(t)})};r>i;i++)t(this[i]);return this},r.off=function(e,t){var n,i,r,o,s=0,a=this.length,l=function(e,n,i,r,o){var s;(t&&o.originfn===t||!t)&&(s=o.fn),e[n][i].fn===s&&(r.removeEventListener(n,s),v._cache.events[v.getData(r).jid][n].splice(i,1))};for(r=function(t){var r,s,a;return(n=v.getData(t).events)?!e&&n?h(n).forEach(function(e){for(s=n[e],r=s.length;r--;)l(n,e,r,t,s[r])}):(e.split(" ").forEach(function(e){if(o=e.split(".")[0],i=e.split(".").splice(1).join("."),n[o])for(s=n[o],r=s.length;r--;)a=s[r],(!i||i&&a.namespace===i)&&l(n,o,r,t,a);else i&&h(n).forEach(function(e){for(s=n[e],r=s.length;r--;)a=s[r],a.namespace.split(".")[0]===i.split(".")[0]&&l(n,e,r,t,a)})}),void 0):void 0};a>s;s++)r(this[s]);return this},r.find=function(e){for(var t=[],n=0,i=this.length,r=function(n){m(n.querySelectorAll)&&[].forEach.call(n.querySelectorAll(e),function(e){t.push(e)})};i>n;n++)r(this[n]);return v(t)},r.get=function(e){return this[e]},r.eq=function(e){return v(this[e])},r.parent=function(){for(var e,t=[],n=0,i=this.length;i>n;n++)!~t.indexOf(e=this[n].parentElement)&&e&&t.push(e);return v(t)},r.toArray=function(){return u.call(this)},r.is=function(){var e=arguments;return this.some(function(t){return t.tagName.toLowerCase()===e[0]})},r.has=function(){var e=arguments;return this.some(function(t){return t.querySelectorAll(e[0]).length})},r.attr=function(e,t){var n,i=arguments,r=0,o=this.length;if(f(e)&&1===i.length)return this[0]&&this[0].getAttribute(e);for(2===i.length?n=function(n){n.setAttribute(e,t)}:g(e)&&(n=function(t){h(e).forEach(function(n){t.setAttribute(n,e[n])})});o>r;r++)n(this[r]);return this},r.removeAttr=function(e){for(var t=0,n=this.length;n>t;t++)this[t].removeAttribute(e);return this},r.val=function(e){var t=0,n=this.length;if(0===arguments.length)return this[0]&&this[0].value;for(;n>t;t++)this[t].value=e;return this},r.css=function(t,n){var i,r=arguments,o=0,s=this.length;if(f(t)&&1===r.length)return this[0]&&e.getComputedStyle(this[0])[t];for(2===r.length?i=function(e){e.style[t]=n}:g(t)&&(i=function(e){h(t).forEach(function(n){e.style[n]=t[n]})});s>o;o++)i(this[o]);return this},r.data=function(e,t){var n,i=arguments,r={},o=0,s=this.length,a=function(e,t,n){g(n)?(e.jdata=e.jdata||{},e.jdata[t]=n):e.dataset[t]=n},l=function(e){return"true"===e?!0:"false"===e?!1:e};if(0===i.length)return this[0].jdata&&(r=this[0].jdata),h(this[0].dataset).forEach(function(e){r[e]=l(this[0].dataset[e])},this),r;if(1===i.length&&f(e))return this[0]&&l(this[0].dataset[e]||this[0].jdata&&this[0].jdata[e]);for(1===i.length&&g(e)?n=function(t){h(e).forEach(function(n){a(t,n,e[n])})}:2===i.length&&(n=function(n){a(n,e,t)});s>o;o++)n(this[o]);return this},r.removeData=function(e){for(var t,n,i=0,r=this.length;r>i;i++)if(t=this[i].jdata,n=this[i].dataset,e)t&&t[e]&&delete t[e],delete n[e];else{for(e in t)delete t[e];for(e in n)delete n[e]}return this},r.html=function(e){var t,n=arguments;return 1===n.length&&void 0!==e?this.empty().append(e):0===n.length&&(t=this[0])?t.innerHTML:this},r.append=function(e){var t,n=0,i=this.length;for(f(e)&&l.exec(e)?e=v(e):g(e)||(e=document.createTextNode(e)),e=e instanceof v?e:v(e),t=function(t,n){e.forEach(function(e){n?t.appendChild(e.cloneNode()):t.appendChild(e)})};i>n;n++)t(this[n],n);return this},r.appendTo=function(e){return v(e).append(this),this},r.empty=function(){for(var e,t=0,n=this.length;n>t;t++)for(e=this[t];e.lastChild;)e.removeChild(e.lastChild);return this},r.remove=function(){var e,t=0,n=this.length;for(this.off();n>t;t++)e=this[t],delete e.jdata,e.parentNode&&e.parentNode.removeChild(e);return this},"object"==typeof t&&t&&"object"==typeof t.exports?t.exports=v:"function"==typeof define&&define.amd?(define(function(){return v}),e.jBone=e.$=v):"object"==typeof e&&"object"==typeof e.document&&(e.jBone=e.$=v)}(window)},{}],51:[function(e,t){var n;t.exports=n={rel:function(e){var t,n,i,r;return t=e.offsetX,n=e.offsetY,null==t&&(i=r.getBoundingClientRect(),r=e.target||e.srcElement,null==t&&(t=e.clientX-i.left,n=e.clientY-i.top),null==t&&(t=e.pageX-r.offsetLeft,n=e.pageY-r.offsetTop),null==t)?(console.log(e,"no mouse event defined. your browser sucks"),void 0):[t,n]},abs:function(e){var t,n;return t=e.pageX,n=e.pageY,null==t&&(t=e.layerX,n=e.layerY),null==t&&(t=e.clientX,n=e.clientY),null==t&&(t=e.x,n=e.y),[t,n]},wheelDelta:function(e){var t,n;return t=[e.deltaX,e.deltaY],null==t[0]&&(n=Math.floor(e.detail/3),t=[0,e.mozMovementX*n]),t}}},{}],52:[function(e,t){function n(e,t){function n(){4===m.readyState&&k()}function r(){var e=null;if(m.response?e=m.response:"text"!==m.responseType&&m.responseType||(e=m.responseText||m.responseXML),_)try{e=JSON.parse(e)}catch(t){}return e}function c(){return 1223===m.status?204:m.status}function h(e){var t=null;if(0===e||e>=400&&600>e){var n=("string"==typeof x?x:!1)||a[String(e).charAt(0)];t=new Error(n),t.statusCode=e}return t}function d(){var e=c(),n=h(e),i={body:r(),statusCode:e,statusText:m.statusText,raw:m};i.headers=m.getAllResponseHeaders?s(m.getAllResponseHeaders()):{},t(n,i,i.body)}function f(){var e=c(),n=h(e);m.status=m.statusCode=e,m.body=r(),m.headers=s(m.getAllResponseHeaders()),t(n,m,m.body)}function g(e){t(e,m)}"string"==typeof e&&(e={uri:e}),e=e||{},t=o(t);var m=e.xhr||null;m||(m=e.cors||e.useXDR?new u:new l);var p,v=m.url=e.uri||e.url,b=m.method=e.method||"GET",x=e.body||e.data,w=m.headers=e.headers||{},y=!!e.sync,_=!1,k=e.response?d:f;if("json"in e&&(_=!0,w.Accept="application/json","GET"!==b&&"HEAD"!==b&&(w["Content-Type"]="application/json",x=JSON.stringify(e.json))),m.onreadystatechange=n,m.onload=k,m.onerror=g,m.onprogress=function(){},m.ontimeout=i,m.open(b,v,!y),(e.withCredentials||e.cors&&e.withCredentials!==!1)&&(m.withCredentials=!0),y||(m.timeout="timeout"in e?e.timeout:5e3),m.setRequestHeader)for(p in w)w.hasOwnProperty(p)&&m.setRequestHeader(p,w[p]);else if(e.headers)throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(m.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(m),m.send(x),m}function i(){}var r=e("global/window"),o=e("once"),s=e("parse-headers"),a={0:"Internal XMLHttpRequest Error",4:"4xx Client Error",5:"5xx Server Error"},l=r.XMLHttpRequest||i,u="withCredentials"in new l?l:r.XDomainRequest;t.exports=n},{"global/window":53,once:54,"parse-headers":58}],53:[function(e,t){(function(e){t.exports="undefined"!=typeof window?window:"undefined"!=typeof e?e:{}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],54:[function(e,t){function n(e){var t=!1;return function(){return t?void 0:(t=!0,e.apply(this,arguments))}}t.exports=n,n.proto=n(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return n(this)},configurable:!0})})},{}],55:[function(e,t){function n(e,t,n){if(!s(t))throw new TypeError("iterator must be a function");arguments.length<3&&(n=this),"[object Array]"===a.call(e)?i(e,t,n):"string"==typeof e?r(e,t,n):o(e,t,n)}function i(e,t,n){for(var i=0,r=e.length;r>i;i++)l.call(e,i)&&t.call(n,e[i],i,e)}function r(e,t,n){for(var i=0,r=e.length;r>i;i++)t.call(n,e.charAt(i),i,e)}function o(e,t,n){for(var i in e)l.call(e,i)&&t.call(n,e[i],i,e)}var s=e("is-function");t.exports=n;var a=Object.prototype.toString,l=Object.prototype.hasOwnProperty},{"is-function":56}],56:[function(e,t){function n(e){var t=i.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}t.exports=n;var i=Object.prototype.toString},{}],57:[function(e,t,n){function i(e){return e.replace(/^\s*|\s*$/g,"")}n=t.exports=i,n.left=function(e){return e.replace(/^\s*/,"")},n.right=function(e){return e.replace(/\s*$/,"")}},{}],58:[function(e,t){var n=e("trim"),i=e("for-each"),r=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return i(n(e).split("\n"),function(e){var i=e.indexOf(":"),o=n(e.slice(0,i)).toLowerCase(),s=n(e.slice(i+1));"undefined"==typeof t[o]?t[o]=s:r(t[o])?t[o].push(s):t[o]=[t[o],s]}),t}},{"for-each":55,trim:57}],59:[function(e,t,n){(function(){var e=this,i=e._,r=Array.prototype,o=Object.prototype,s=Function.prototype,a=r.push,l=r.slice,u=r.concat,c=o.toString,h=o.hasOwnProperty,d=Array.isArray,f=Object.keys,g=s.bind,m=function(e){return e instanceof m?e:this instanceof m?(this._wrapped=e,void 0):new m(e)};"undefined"!=typeof n?("undefined"!=typeof t&&t.exports&&(n=t.exports=m),n._=m):e._=m,m.VERSION="1.7.0";var p=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)};case 4:return function(n,i,r,o){return e.call(t,n,i,r,o)}}return function(){return e.apply(t,arguments)}};m.iteratee=function(e,t,n){return null==e?m.identity:m.isFunction(e)?p(e,t,n):m.isObject(e)?m.matches(e):m.property(e)},m.each=m.forEach=function(e,t,n){if(null==e)return e;t=p(t,n);var i,r=e.length;if(r===+r)for(i=0;r>i;i++)t(e[i],i,e);else{var o=m.keys(e);for(i=0,r=o.length;r>i;i++)t(e[o[i]],o[i],e)}return e},m.map=m.collect=function(e,t,n){if(null==e)return[];t=m.iteratee(t,n);for(var i,r=e.length!==+e.length&&m.keys(e),o=(r||e).length,s=Array(o),a=0;o>a;a++)i=r?r[a]:a,s[a]=t(e[i],i,e);return s};var v="Reduce of empty array with no initial value";m.reduce=m.foldl=m.inject=function(e,t,n,i){null==e&&(e=[]),t=p(t,i,4);var r,o=e.length!==+e.length&&m.keys(e),s=(o||e).length,a=0;if(arguments.length<3){if(!s)throw new TypeError(v);n=e[o?o[a++]:a++]}for(;s>a;a++)r=o?o[a]:a,n=t(n,e[r],r,e);return n},m.reduceRight=m.foldr=function(e,t,n,i){null==e&&(e=[]),t=p(t,i,4);var r,o=e.length!==+e.length&&m.keys(e),s=(o||e).length;if(arguments.length<3){if(!s)throw new TypeError(v);n=e[o?o[--s]:--s]}for(;s--;)r=o?o[s]:s,n=t(n,e[r],r,e);return n},m.find=m.detect=function(e,t,n){var i;return t=m.iteratee(t,n),m.some(e,function(e,n,r){return t(e,n,r)?(i=e,!0):void 0}),i},m.filter=m.select=function(e,t,n){var i=[];return null==e?i:(t=m.iteratee(t,n),m.each(e,function(e,n,r){t(e,n,r)&&i.push(e)}),i)},m.reject=function(e,t,n){return m.filter(e,m.negate(m.iteratee(t)),n)},m.every=m.all=function(e,t,n){if(null==e)return!0;t=m.iteratee(t,n);var i,r,o=e.length!==+e.length&&m.keys(e),s=(o||e).length;for(i=0;s>i;i++)if(r=o?o[i]:i,!t(e[r],r,e))return!1;return!0},m.some=m.any=function(e,t,n){if(null==e)return!1;t=m.iteratee(t,n);var i,r,o=e.length!==+e.length&&m.keys(e),s=(o||e).length;for(i=0;s>i;i++)if(r=o?o[i]:i,t(e[r],r,e))return!0;return!1},m.contains=m.include=function(e,t){return null==e?!1:(e.length!==+e.length&&(e=m.values(e)),m.indexOf(e,t)>=0)},m.invoke=function(e,t){var n=l.call(arguments,2),i=m.isFunction(t);return m.map(e,function(e){return(i?t:e[t]).apply(e,n)})},m.pluck=function(e,t){return m.map(e,m.property(t))},m.where=function(e,t){return m.filter(e,m.matches(t))},m.findWhere=function(e,t){return m.find(e,m.matches(t))},m.max=function(e,t,n){var i,r,o=-1/0,s=-1/0;if(null==t&&null!=e){e=e.length===+e.length?e:m.values(e);for(var a=0,l=e.length;l>a;a++)i=e[a],i>o&&(o=i)}else t=m.iteratee(t,n),m.each(e,function(e,n,i){r=t(e,n,i),(r>s||r===-1/0&&o===-1/0)&&(o=e,s=r)});return o},m.min=function(e,t,n){var i,r,o=1/0,s=1/0;if(null==t&&null!=e){e=e.length===+e.length?e:m.values(e);for(var a=0,l=e.length;l>a;a++)i=e[a],o>i&&(o=i)}else t=m.iteratee(t,n),m.each(e,function(e,n,i){r=t(e,n,i),(s>r||1/0===r&&1/0===o)&&(o=e,s=r)});return o},m.shuffle=function(e){for(var t,n=e&&e.length===+e.length?e:m.values(e),i=n.length,r=Array(i),o=0;i>o;o++)t=m.random(0,o),t!==o&&(r[o]=r[t]),r[t]=n[o];return r},m.sample=function(e,t,n){return null==t||n?(e.length!==+e.length&&(e=m.values(e)),e[m.random(e.length-1)]):m.shuffle(e).slice(0,Math.max(0,t))},m.sortBy=function(e,t,n){return t=m.iteratee(t,n),m.pluck(m.map(e,function(e,n,i){return{value:e,index:n,criteria:t(e,n,i)}}).sort(function(e,t){var n=e.criteria,i=t.criteria;if(n!==i){if(n>i||void 0===n)return 1;if(i>n||void 0===i)return-1}return e.index-t.index}),"value")};var b=function(e){return function(t,n,i){var r={};return n=m.iteratee(n,i),m.each(t,function(i,o){var s=n(i,o,t);e(r,i,s)}),r}};m.groupBy=b(function(e,t,n){m.has(e,n)?e[n].push(t):e[n]=[t]}),m.indexBy=b(function(e,t,n){e[n]=t}),m.countBy=b(function(e,t,n){m.has(e,n)?e[n]++:e[n]=1}),m.sortedIndex=function(e,t,n,i){n=m.iteratee(n,i,1);for(var r=n(t),o=0,s=e.length;s>o;){var a=o+s>>>1;n(e[a])t?[]:l.call(e,0,t)},m.initial=function(e,t,n){return l.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},m.last=function(e,t,n){return null==e?void 0:null==t||n?e[e.length-1]:l.call(e,Math.max(e.length-t,0))},m.rest=m.tail=m.drop=function(e,t,n){return l.call(e,null==t||n?1:t)},m.compact=function(e){return m.filter(e,m.identity)};var x=function(e,t,n,i){if(t&&m.every(e,m.isArray))return u.apply(i,e);for(var r=0,o=e.length;o>r;r++){var s=e[r];m.isArray(s)||m.isArguments(s)?t?a.apply(i,s):x(s,t,n,i):n||i.push(s)}return i};m.flatten=function(e,t){return x(e,t,!1,[])},m.without=function(e){return m.difference(e,l.call(arguments,1))},m.uniq=m.unique=function(e,t,n,i){if(null==e)return[];m.isBoolean(t)||(i=n,n=t,t=!1),null!=n&&(n=m.iteratee(n,i));for(var r=[],o=[],s=0,a=e.length;a>s;s++){var l=e[s];if(t)s&&o===l||r.push(l),o=l;else if(n){var u=n(l,s,e);m.indexOf(o,u)<0&&(o.push(u),r.push(l))}else m.indexOf(r,l)<0&&r.push(l)}return r},m.union=function(){return m.uniq(x(arguments,!0,!0,[]))},m.intersection=function(e){if(null==e)return[];for(var t=[],n=arguments.length,i=0,r=e.length;r>i;i++){var o=e[i];if(!m.contains(t,o)){for(var s=1;n>s&&m.contains(arguments[s],o);s++);s===n&&t.push(o)}}return t},m.difference=function(e){var t=x(l.call(arguments,1),!0,!0,[]);return m.filter(e,function(e){return!m.contains(t,e)})},m.zip=function(e){if(null==e)return[];for(var t=m.max(arguments,"length").length,n=Array(t),i=0;t>i;i++)n[i]=m.pluck(arguments,i);return n},m.object=function(e,t){if(null==e)return{};for(var n={},i=0,r=e.length;r>i;i++)t?n[e[i]]=t[i]:n[e[i][0]]=e[i][1];return n},m.indexOf=function(e,t,n){if(null==e)return-1;var i=0,r=e.length;if(n){if("number"!=typeof n)return i=m.sortedIndex(e,t),e[i]===t?i:-1;i=0>n?Math.max(0,r+n):n}for(;r>i;i++)if(e[i]===t)return i;return-1},m.lastIndexOf=function(e,t,n){if(null==e)return-1;var i=e.length;for("number"==typeof n&&(i=0>n?i+n+1:Math.min(i,n+1));--i>=0;)if(e[i]===t)return i;return-1},m.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=n||1;for(var i=Math.max(Math.ceil((t-e)/n),0),r=Array(i),o=0;i>o;o++,e+=n)r[o]=e;return r};var w=function(){};m.bind=function(e,t){var n,i;if(g&&e.bind===g)return g.apply(e,l.call(arguments,1));if(!m.isFunction(e))throw new TypeError("Bind must be called on a function");return n=l.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,n.concat(l.call(arguments)));w.prototype=e.prototype;var r=new w;w.prototype=null;var o=e.apply(r,n.concat(l.call(arguments)));return m.isObject(o)?o:r}},m.partial=function(e){var t=l.call(arguments,1);return function(){for(var n=0,i=t.slice(),r=0,o=i.length;o>r;r++)i[r]===m&&(i[r]=arguments[n++]);for(;n=i)throw new Error("bindAll must be passed function names");for(t=1;i>t;t++)n=arguments[t],e[n]=m.bind(e[n],e);return e},m.memoize=function(e,t){var n=function(i){var r=n.cache,o=t?t.apply(this,arguments):i;return m.has(r,o)||(r[o]=e.apply(this,arguments)),r[o]};return n.cache={},n},m.delay=function(e,t){var n=l.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},m.defer=function(e){return m.delay.apply(m,[e,1].concat(l.call(arguments,1)))},m.throttle=function(e,t,n){var i,r,o,s=null,a=0;n||(n={});var l=function(){a=n.leading===!1?0:m.now(),s=null,o=e.apply(i,r),s||(i=r=null)};return function(){var u=m.now();a||n.leading!==!1||(a=u);var c=t-(u-a);return i=this,r=arguments,0>=c||c>t?(clearTimeout(s),s=null,a=u,o=e.apply(i,r),s||(i=r=null)):s||n.trailing===!1||(s=setTimeout(l,c)),o}},m.debounce=function(e,t,n){var i,r,o,s,a,l=function(){var u=m.now()-s;t>u&&u>0?i=setTimeout(l,t-u):(i=null,n||(a=e.apply(o,r),i||(o=r=null)))};return function(){o=this,r=arguments,s=m.now();var u=n&&!i;return i||(i=setTimeout(l,t)),u&&(a=e.apply(o,r),o=r=null),a}},m.wrap=function(e,t){return m.partial(t,e)},m.negate=function(e){return function(){return!e.apply(this,arguments)}},m.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,i=e[t].apply(this,arguments);n--;)i=e[n].call(this,i);return i}},m.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},m.before=function(e,t){var n;return function(){return--e>0?n=t.apply(this,arguments):t=null,n}},m.once=m.partial(m.before,2),m.keys=function(e){if(!m.isObject(e))return[];if(f)return f(e);var t=[];for(var n in e)m.has(e,n)&&t.push(n);return t},m.values=function(e){for(var t=m.keys(e),n=t.length,i=Array(n),r=0;n>r;r++)i[r]=e[t[r]];return i},m.pairs=function(e){for(var t=m.keys(e),n=t.length,i=Array(n),r=0;n>r;r++)i[r]=[t[r],e[t[r]]];return i},m.invert=function(e){for(var t={},n=m.keys(e),i=0,r=n.length;r>i;i++)t[e[n[i]]]=n[i];return t},m.functions=m.methods=function(e){var t=[];for(var n in e)m.isFunction(e[n])&&t.push(n);return t.sort()},m.extend=function(e){if(!m.isObject(e))return e;for(var t,n,i=1,r=arguments.length;r>i;i++){t=arguments[i];for(n in t)h.call(t,n)&&(e[n]=t[n])}return e},m.pick=function(e,t,n){var i,r={};if(null==e)return r;if(m.isFunction(t)){t=p(t,n);for(i in e){var o=e[i];t(o,i,e)&&(r[i]=o)}}else{var s=u.apply([],l.call(arguments,1));e=new Object(e);for(var a=0,c=s.length;c>a;a++)i=s[a],i in e&&(r[i]=e[i])}return r},m.omit=function(e,t,n){if(m.isFunction(t))t=m.negate(t);else{var i=m.map(u.apply([],l.call(arguments,1)),String);t=function(e,t){return!m.contains(i,t)}}return m.pick(e,t,n)},m.defaults=function(e){if(!m.isObject(e))return e;for(var t=1,n=arguments.length;n>t;t++){var i=arguments[t];for(var r in i)void 0===e[r]&&(e[r]=i[r])}return e},m.clone=function(e){return m.isObject(e)?m.isArray(e)?e.slice():m.extend({},e):e},m.tap=function(e,t){return t(e),e};var y=function(e,t,n,i){if(e===t)return 0!==e||1/e===1/t;if(null==e||null==t)return e===t;e instanceof m&&(e=e._wrapped),t instanceof m&&(t=t._wrapped);var r=c.call(e);if(r!==c.call(t))return!1;switch(r){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!==+e?+t!==+t:0===+e?1/+e===1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t}if("object"!=typeof e||"object"!=typeof t)return!1;for(var o=n.length;o--;)if(n[o]===e)return i[o]===t;var s=e.constructor,a=t.constructor;if(s!==a&&"constructor"in e&&"constructor"in t&&!(m.isFunction(s)&&s instanceof s&&m.isFunction(a)&&a instanceof a))return!1;n.push(e),i.push(t);var l,u;if("[object Array]"===r){if(l=e.length,u=l===t.length)for(;l--&&(u=y(e[l],t[l],n,i)););}else{var h,d=m.keys(e);if(l=d.length,u=m.keys(t).length===l)for(;l--&&(h=d[l],u=m.has(t,h)&&y(e[h],t[h],n,i)););}return n.pop(),i.pop(),u};m.isEqual=function(e,t){return y(e,t,[],[])},m.isEmpty=function(e){if(null==e)return!0;if(m.isArray(e)||m.isString(e)||m.isArguments(e))return 0===e.length;for(var t in e)if(m.has(e,t))return!1;return!0},m.isElement=function(e){return!(!e||1!==e.nodeType)},m.isArray=d||function(e){return"[object Array]"===c.call(e)},m.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},m.each(["Arguments","Function","String","Number","Date","RegExp"],function(e){m["is"+e]=function(t){return c.call(t)==="[object "+e+"]"}}),m.isArguments(arguments)||(m.isArguments=function(e){return m.has(e,"callee")}),"function"!=typeof/./&&(m.isFunction=function(e){return"function"==typeof e||!1}),m.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},m.isNaN=function(e){return m.isNumber(e)&&e!==+e},m.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"===c.call(e)},m.isNull=function(e){return null===e},m.isUndefined=function(e){return void 0===e},m.has=function(e,t){return null!=e&&h.call(e,t)},m.noConflict=function(){return e._=i,this},m.identity=function(e){return e},m.constant=function(e){return function(){return e}},m.noop=function(){},m.property=function(e){return function(t){return t[e]}},m.matches=function(e){var t=m.pairs(e),n=t.length;return function(e){if(null==e)return!n;e=new Object(e);for(var i=0;n>i;i++){var r=t[i],o=r[0];if(r[1]!==e[o]||!(o in e))return!1}return!0}},m.times=function(e,t,n){var i=Array(Math.max(0,e));t=p(t,n,1);for(var r=0;e>r;r++)i[r]=t(r);return i},m.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},m.now=Date.now||function(){return(new Date).getTime()};var _={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},k=m.invert(_),S=function(e){var t=function(t){return e[t]},n="(?:"+m.keys(e).join("|")+")",i=RegExp(n),r=RegExp(n,"g");return function(e){return e=null==e?"":""+e,i.test(e)?e.replace(r,t):e}};m.escape=S(_),m.unescape=S(k),m.result=function(e,t){if(null==e)return void 0;var n=e[t];return m.isFunction(n)?e[t]():n};var E=0;m.uniqueId=function(e){var t=++E+"";return e?e+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var C=/(.)^/,j={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},z=/\\|'|\r|\n|\u2028|\u2029/g,M=function(e){return"\\"+j[e]};m.template=function(e,t,n){!t&&n&&(t=n),t=m.defaults({},t,m.templateSettings);var i=RegExp([(t.escape||C).source,(t.interpolate||C).source,(t.evaluate||C).source].join("|")+"|$","g"),r=0,o="__p+='";e.replace(i,function(t,n,i,s,a){return o+=e.slice(r,a).replace(z,M),r=a+t.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?o+="'+\n((__t=("+i+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var s=new Function(t.variable||"obj","_",o)}catch(a){throw a.source=o,a}var l=function(e){return s.call(this,e,m)},u=t.variable||"obj";return l.source="function("+u+"){\n"+o+"}",l},m.chain=function(e){var t=m(e);return t._chain=!0,t};var N=function(e){return this._chain?m(e).chain():e};m.mixin=function(e){m.each(m.functions(e),function(t){var n=m[t]=e[t];m.prototype[t]=function(){var e=[this._wrapped];return a.apply(e,arguments),N.call(this,n.apply(m,e))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];m.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],N.call(this,n)}}),m.each(["concat","join","slice"],function(e){var t=r[e];m.prototype[e]=function(){return N.call(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this)},{}],60:[function(e,t){var n;n=e("underscore"),t.exports=function(e){var t;return e=e.map(function(e){return e.get("seq")}),t=new Array(e.length),n.each(e,function(e){return n.each(e,function(e,n){return null==t[n]&&(t[n]={}),null==t[n][e]&&(t[n][e]=0),t[n][e]++})}),n.reduce(t,function(e,t){var i;return i=n.keys(t),e+=n.max(i,function(e){return t[e]})},"")}},{underscore:59}],61:[function(e,t){var n;t.exports=n=function(e,t){return void 0===t?(console.warn("bug on consenus calc"),void 0):e.each(function(e){var n,i,r,o,s,a;for(r=e.get("seq"),i=0,o=0,n=s=0,a=r.length-1;a>=0?a>=s:s>=a;n=a>=0?++s:--s)"-"!==r[n]&&"-"!==t[n]&&(o++,r[n]===t[n]&&i++);return e.set("identity",i/o)})}},{}],62:[function(e,t){t.exports.consensus=e("./ConsensusCalc")},{"./ConsensusCalc":60}],63:[function(e,t){var n,i;i=e("backbone-thin").Model,t.exports=n=i.extend({defaults:{scheme:"taylor",colorBackground:!0,showLowerCase:!0,opacity:.6}})},{"backbone-thin":5}],64:[function(e,t){var n,i,r,o;i=e("backbone-thin").Model,r=e("../algo/ConsensusCalc"),o=e("underscore"),t.exports=n=i.extend({defaults:{scaling:"lin"},initialize:function(){return null==this.get("hidden")?this.set("hidden",[]):void 0},calcHiddenColumns:function(e){var t,n,i,r,o;for(t=this.get("hidden"),i=e,r=0,o=t.length;o>r;r++)n=t[r],i>=n&&i++;return i-e},_calcConservationPre:function(e){var t,n,i,s;return console.log(e.length),e.length>1e3?void 0:(t=r(e),e=e.map(function(e){return e.get("seq")}),i=o.max(e,function(e){return e.length}).length,s=new Array(i),n=new Array(i),o.each(e,function(e){return o.each(e,function(e,i){return s[i]=s[i]+1||1,t[i]===e?n[i]=n[i]+1||1:void 0})}),[n,s,i])},calcConservation:function(e){return"exp"===this.attributes.scaling?this.calcConservationExp(e):"log"===this.attributes.scaling?this.calcConservationLog(e):"lin"===this.attributes.scaling?this.calcConservationLin(e):void 0 +},calcConservationLin:function(e){var t,n,i,r,o,s,a;for(s=this._calcConservationPre(e),n=s[0],r=s[1],i=s[2],t=o=0,a=i-1;a>=0?a>=o:o>=a;t=a>=0?++o:--o)n[t]=n[t]/r[t];return this.set("conserv",n),n},calcConservationLog:function(e){var t,n,i,r,o,s,a;for(s=this._calcConservationPre(e),n=s[0],r=s[1],i=s[2],t=o=0,a=i-1;a>=0?a>=o:o>=a;t=a>=0?++o:--o)n[t]=Math.log(n[t]+1)/Math.log(r[t]+1);return this.set("conserv",n),n},calcConservationExp:function(e){var t,n,i,r,o,s,a;for(s=this._calcConservationPre(e),n=s[0],r=s[1],i=s[2],t=o=0,a=i-1;a>=0?a>=o:o>=a;t=a>=0?++o:--o)n[t]=Math.exp(n[t]+1)/Math.exp(r[t]+1);return this.set("conserv",n),n}})},{"../algo/ConsensusCalc":60,"backbone-thin":5,underscore:59}],65:[function(e,t){var n,i;i=e("backbone-thin").Model,t.exports=n=i.extend({defaults:{registerMouseHover:!1,registerMouseClicks:!0,importProxy:"https://cors-anywhere.herokuapp.com/",eventBus:!0}})},{"backbone-thin":5}],66:[function(e,t){var n,i,r;i=e("backbone-thin").Model,r=e("../algo/ConsensusCalc"),t.exports=n=i.extend({defaults:{consenus:""},getConsensus:function(e){var t;if(!(e.length>1e3))return t=r(e),this.set("consenus",t),t}})},{"../algo/ConsensusCalc":60,"backbone-thin":5}],67:[function(e,t){var n,i,r,o,s,a;a=e("underscore"),i=e("backbone-thin").Model,s=i.extend({defaults:{type:"super"}}),o=s.extend({defaults:a.extend({},s.prototype.defaults,{type:"row",seqId:""}),inRow:function(e){return e===this.get("seqId")},inColumn:function(){return!0},getLength:function(){return 1}}),n=s.extend({defaults:a.extend({},s.prototype.defaults,{type:"column",xStart:-1,xEnd:-1}),inRow:function(){return!0},inColumn:function(e){return e>=xStart&&xEnd>=e},getLength:function(){return xEnd-xStart}}),r=o.extend(a.extend({},a.pick(n,"inColumn"),a.pick(n,"getLength"),{defaults:a.extend({},n.prototype.defaults,o.prototype.defaults,{type:"pos"})})),t.exports.sel=s,t.exports.possel=r,t.exports.rowsel=o,t.exports.columnsel=n},{"backbone-thin":5,underscore:59}],68:[function(e,t){var n,i,r,o;r=e("./Selection"),o=e("underscore"),n=e("backbone-thin").Collection,t.exports=i=n.extend({model:r.sel,initialize:function(e,t){return this.g=t.g,this.listenTo(this.g,"residue:click",function(e){return this._handleE(e.evt,new r.possel({xStart:e.rowPos,xEnd:e.rowPos,seqId:e.seqId}))}),this.listenTo(this.g,"row:click",function(e){return this._handleE(e.evt,new r.rowsel({xStart:e.rowPos,xEnd:e.rowPos,seqId:e.seqId}))}),this.listenTo(this.g,"column:click",function(e){return this._handleE(e.evt,new r.columnsel({xStart:e.rowPos,xEnd:e.rowPos+e.stepSize-1}))})},getSelForRow:function(e){return this.filter(function(t){return t.inRow(e)})},getSelForColumns:function(e){return this.filter(function(t){return t.inColumn(e)})},getBlocksForRow:function(e,t){var n,i,r,o,s,a,l,u;for(r=this.filter(function(t){return t.inRow(e)}),n=[],o=0,s=r.length;s>o;o++){if(i=r[o],"row"===i.attributes.type){n=function(){l=[];for(var e=0;t>=0?t>=e:e>=t;t>=0?e++:e--)l.push(e);return l}.apply(this);break}n=n.concat(function(){u=[];for(var e=a=i.attributes.xStart,t=i.attributes.xEnd;t>=a?t>=e:e>=t;t>=a?e++:e--)u.push(e);return u}.apply(this))}return n},getAllColumnBlocks:function(e){var t,n,i,r,s,a,l,u,c;for(i=e.maxLen,s=e.withPos,t=[],n=e.withPos?this.filter(function(e){return null!=e.get("xStart")}):this.filter(function(e){return"column"===e.get("type")}),a=0,l=n.length;l>a;a++)r=n[a],t=t.concat(function(){c=[];for(var e=u=r.attributes.xStart,t=r.attributes.xEnd;t>=u?t>=e:e>=t;t>=u?e++:e--)c.push(e);return c}.apply(this));return t=o.uniq(t)},invertRow:function(e){var t,n,i,s,a,l;for(s=this.where({type:"row"}),s=o.map(s,function(e){return e.attributes.seqId}),n=o.filter(e,function(e){return s.indexOf(e)>=0?!1:!0}),i=[],a=0,l=n.length;l>a;a++)t=n[a],i.push(new r.rowsel({seqId:t}));return console.log(i),this.reset(i)},invertCol:function(e){var t,n,i,s,a,l,u,c;if(s=this.where({type:"column"}),s=o.reduce(s,function(e,t){var n,i;return e.concat(function(){i=[];for(var e=n=t.attributes.xStart,r=t.attributes.xEnd;r>=n?r>=e:e>=r;r>=n?e++:e--)i.push(e);return i}.apply(this))},[]),n=o.filter(e,function(e){return s.indexOf(e)>=0?!1:!0}),0!==n.length){for(i=[],console.log(n),l=a=n[0],u=0,c=n.length;c>u;u++)t=n[u],a+1===t?a=t:(i.push(new r.columnsel({xStart:l,xEnd:a})),l=a=t);return l!==a&&i.push(new r.columnsel({xStart:l,xEnd:n[n.length-1]})),this.reset(i)}},_handleE:function(e,t){return e.ctrlKey||e.metaKey?this.add(t):this.reset([t])},_reduceColumns:function(){return this.each(function(e,t,n){var i,r,s,a,l,u,c,h,d,f,g;for(i=o.filter(n,function(e){return"column"===e.get("type")}),c=e.get("xStart"),u=e.get("xEnd"),s=o.filter(i,function(e){return e.get("xEnd")===c-1}),h=0,f=s.length;f>h;h++)r=s[h],r.set("xEnd",c);for(l=o.filter(i,function(e){return e.get("xStart")===u+1}),d=0,g=l.length;g>d;d++)a=l[d],a.set("xStart",u);return s.length>0||l.length>0?(console.log("removed el"),e.collection.remove(e)):void 0})}})},{"./Selection":67,"backbone-thin":5,underscore:59}],69:[function(e,t){var n,i;n=e("backbone-thin").Model,t.exports=i=n.extend({defaults:{overviewBox:30,headerBox:-1,alignmentBody:0}})},{"backbone-thin":5}],70:[function(e,t){var n,i;n=e("backbone-thin").Model,t.exports=i=n.extend({defaults:{sequences:!0,markers:!0,metacell:!1,conserv:!0,overviewbox:!1,labels:!0,labelName:!0,labelId:!0,labelPartition:!1,labelCheckbox:!1}})},{"backbone-thin":5}],71:[function(e,t){var n,i;n=e("backbone-thin").Model,t.exports=i=n.extend({constructor:function(e,t){return n.apply(this,arguments),this.g=t.g,this},defaults:{alignmentWidth:"auto",alignmentHeight:195,columnWidth:15,rowHeight:15,labelWidth:100,metaWidth:100,textVisible:!0,labelIdLength:30,labelFontsize:"13px",labelLineHeight:"13px",markerFontsize:"10px",stepSize:1,markerStepSize:2,residueFont:"13px mono",canvasEventScale:1,boxRectHeight:5,boxRectWidth:5,menuFontsize:"20px",menuItemFontsize:"18px",menuItemLineHeight:"18px",menuMarginLeft:"5px",menuPadding:"3px 5px 3px 5px",_alignmentScrollLeft:0,_alignmentScrollTop:0},getAlignmentWidth:function(e){return"auto"===this.get("alignmentWidth")?this.get("columnWidth")*e:this.get("alignmentWidth")},setLeftOffset:function(e){var t;return t=(e-1)*this.get("columnWidth"),t=Math.max(0,t),this.set("_alignmentScrollLeft",t)},setTopOffset:function(e){var t;return t=(e-1)*this.get("rowHeight"),t=Math.max(0,t),this.set("_alignmentScrollTop",t)},getLabelWidth:function(){var e;return e=0,this.g.vis.get("labels")&&(e+=this.get("labelWidth")),this.g.vis.get("metacell")&&(e+=this.get("metaWidth")),e},_adjustWidth:function(e,t){var n,i,r,o;return r=null!=e.parentNode&&0!==e.parentNode.offsetWidth?e.parentNode.offsetWidth:document.body.clientWidth-35,i=r-this.getLabelWidth(),n=this.getAlignmentWidth(t.getMaxLength()-this.g.columns.get("hidden").length),o=Math.min(i,n),o=Math.floor(o/this.get("columnWidth"))*this.get("columnWidth"),this.set("alignmentWidth",o)},_checkScrolling:function(e,t){var n,i;return n=e[0],i=e[1],this.set("_alignmentScrollLeft",n,t),this.set("_alignmentScrollTop",i,t)}})},{"backbone-thin":5}],72:[function(e,t){t.exports.msa=e("./msa"),t.exports.model=e("./model"),t.exports.algo=e("./algo"),t.exports.menu=e("./menu"),t.exports.utils=e("./utils"),t.exports.selection=e("./g/selection/Selection"),t.exports.view=e("backbone-viewj"),t.exports.boneView=e("backbone-childs"),t.exports._=e("underscore"),t.exports.$=e("jbone"),t.exports.version="0.1.0"},{"./algo":62,"./g/selection/Selection":67,"./menu":74,"./model":89,"./msa":90,"./utils":92,"backbone-childs":3,"backbone-viewj":10,jbone:50,underscore:59}],73:[function(e,t){var n,i,r,o,s,a,l,u,c,h,d;d=e("backbone-childs"),a=e("./views/ImportMenu"),o=e("./views/FilterMenu"),c=e("./views/SelectionMenu"),h=e("./views/VisMenu"),n=e("./views/ColorMenu"),u=e("./views/OrderingMenu"),r=e("./views/ExtraMenu"),i=e("./views/ExportMenu"),s=e("./views/HelpMenu"),t.exports=l=d.extend({initialize:function(e){return this.msa=e.msa,this.addView("10_import",new a({model:this.msa.seqs,g:this.msa.g})),this.addView("20_filter",new o({model:this.msa.seqs,g:this.msa.g})),this.addView("30_selection",new c({model:this.msa.seqs,g:this.msa.g})),this.addView("40_vis",new h({model:this.msa.seqs,g:this.msa.g})),this.addView("50_color",new n({model:this.msa.seqs,g:this.msa.g})),this.addView("60_ordering",new u({model:this.msa.seqs,g:this.msa.g})),this.addView("70_extra",new r({model:this.msa.seqs,g:this.msa.g})),this.addView("80_export",new i({model:this.msa.seqs,g:this.msa.g,msa:this.msa})),this.addView("90_help",new s({g:this.msa.g}))},render:function(){return this.renderSubviews(),this.el.setAttribute("class","biojs_msa_menubar"),this.el.appendChild(document.createElement("p"))}})},{"./views/ColorMenu":76,"./views/ExportMenu":77,"./views/ExtraMenu":78,"./views/FilterMenu":79,"./views/HelpMenu":80,"./views/ImportMenu":81,"./views/OrderingMenu":82,"./views/SelectionMenu":83,"./views/VisMenu":84,"backbone-childs":3}],74:[function(e,t){t.exports.defaultmenu=e("./defaultmenu"),t.exports.menubuilder=e("./menubuilder")},{"./defaultmenu":73,"./menubuilder":75}],75:[function(e,t){var n,i,r,o;n=e("../utils/bmath"),r=e("jbone"),o=e("backbone-viewj"),t.exports=i=o.extend({setName:function(e){return this.name=e,this._nodes=[]},addNode:function(e,t,n){var i;return null!=n&&(i=n.style),null==this._nodes&&(this._nodes=[]),this._nodes.push({label:e,callback:t,style:i})},buildDOM:function(){return this._buildM({nodes:this._nodes,name:this.name})},_buildM:function(e){var t,i,o,s,a,l,u,c,h,d,f,g,m;for(h=e.nodes,u=e.name,a=document.createElement("div"),a.className="dropdown dropdown-tip",a.id="adrop-"+n.uniqueId(),a.style.display="none",l=document.createElement("ul"),l.className="dropdown-menu",f=0,g=h.length;g>f;f++){c=h[f],s=document.createElement("li"),s.textContent=c.label,m=c.style;for(o in m)d=m[o],s.style[o]=d;s.addEventListener("click",c.callback),null!=this.g&&(s.style.lineHeight=this.g.zoomer.get("menuItemLineHeight")),l.appendChild(s)}return a.appendChild(l),i=document.createDocumentFragment(),t=document.createElement("a"),t.textContent=u,t.className="biojs_msa_menubar_alink",null!=this.g&&(l.style.fontSize=this.g.zoomer.get("menuItemFontsize"),t.style.fontSize=this.g.zoomer.get("menuFontsize"),t.style.marginLeft=this.g.zoomer.get("menuMarginLeft"),t.style.padding=this.g.zoomer.get("menuPadding")),r(t).on("click",function(e){return function(n){return e._showMenu(n,a,t),window.setTimeout(function(){return r(document.body).one("click",function(){return console.log("next click"),a.style.display="none"})},5)}}(this)),i.appendChild(a),i.appendChild(t),i},_showMenu:function(e,t,n){var i;return t.style.display="block",t.style.position="absolute",i=n.getBoundingClientRect(),t.style.left=i.left+"px",t.style.top=i.top+n.offsetHeight+"px"}})},{"../utils/bmath":91,"backbone-viewj":10,jbone:50}],76:[function(e,t){var n,i,r,o;i=e("../menubuilder"),o=e("underscore"),r=e("dom-helper"),t.exports=n=i.extend({initialize:function(e){return this.g=e.g,this.el.style.display="inline-block",this.listenTo(this.g.colorscheme,"change",function(){return this.render()})},render:function(){var e,t,n,i,o,s;for(t=this.setName("Color scheme"),e=this.getColorschemes(),o=0,s=e.length;s>o;o++)n=e[o],this.addScheme(t,n);return i="Background",i=this.g.colorscheme.get("colorBackground")?"Hide "+i:"Show "+i,this.addNode(i,function(e){return function(){return e.g.colorscheme.set("colorBackground",!e.g.colorscheme.get("colorBackground"))}}(this)),this.grey(t),r.removeAllChilds(this.el),this.el.appendChild(this.buildDOM()),this},addScheme:function(e,t){var n,i;return i={},n=this.g.colorscheme.get("scheme"),n===t.id&&(i.backgroundColor="#77ED80"),this.addNode(t.name,function(e){return function(){return e.g.colorscheme.set("scheme",t.id)}}(this),{style:i})},getColorschemes:function(){var e;return e=[],e.push({name:"Zappo",id:"zappo"}),e.push({name:"Taylor",id:"taylor"}),e.push({name:"Hydrophobicity",id:"hydro"}),e.push({name:"Lesk",id:"lesk"}),e.push({name:"Cinema",id:"cinema"}),e.push({name:"MAE",id:"mae"}),e.push({name:"Clustal",id:"clustal"}),e.push({name:"Clustal2",id:"clustal2"}),e.push({name:"Turn",id:"turn"}),e.push({name:"Strand",id:"strand"}),e.push({name:"Buried",id:"buried"}),e.push({name:"Helix",id:"helix"}),e.push({name:"Nucleotide",id:"nucleotide"}),e.push({name:"Purine",id:"purine"}),e.push({name:"PID",id:"pid"}),e.push({name:"No color",id:"foo"}),e},grey:function(){return this.addNode("Grey",function(e){return function(){return e.g.colorscheme.set("showLowerCase",!1),e.model.each(function(e){var t,n;return n=e.get("seq"),t=[],o.each(n,function(e,n){return e===e.toLowerCase()?t.push(n):void 0}),e.set("grey",t)})}}(this)),this.addNode("Grey by threshold",function(e){return function(){var t,n,i,r,o,s,a;for(o=prompt("Enter threshold (in percent)",20),o/=100,r=e.model.getMaxLength(),t=e.g.columns.get("conserv"),n=[],i=s=0,a=r-1;a>=0?a>=s:s>=a;i=a>=0?++s:--s)console.log(t[i]),t[i]=l;n=l+=1)r[n]=r[n].toJSON();else r=e.model.toJSON(),console.log("no selection found");return o=i["export"](r),t=new Blob([o],{type:"text/plain"}),s(t,"selection.fasta")}}(this)),this.addNode("Export image",function(e){return function(){var t,n;return t=e.msa.getView("stage").getView("body").getView("seqblock").el,null!=t?(n=t.toDataURL("image/png"),s(o(n),"biojs-msa.png","image/png")):void 0}}(this)),this.el.appendChild(this.buildDOM()),this}})},{"../menubuilder":75,"biojs-io-fasta":void 0,blueimp_canvastoblob:46,"browser-saveas":47,underscore:59}],78:[function(e,t){var n,i,r,o;i=e("../menubuilder"),o=e("../../algo/ConsensusCalc"),r=e("../../model/Sequence"),t.exports=n=i.extend({initialize:function(e){return this.g=e.g,this.el.style.display="inline-block"},render:function(){return this.setName("Extras"),this.addNode("Add consensus seq",function(e){return function(){var t,n;return t=o(e.model),console.log(t),n=new r({seq:t,id:"0c",name:"consenus"}),e.model.add(n),e.model.comparator=function(e){return e.get("id")},e.model.sort()}}(this)),this.addNode("Increase font size",function(e){return function(){return e.g.zoomer.set("columnWidth",e.g.zoomer.get("columnWidth")+2),e.g.zoomer.set("labelWidth",e.g.zoomer.get("columnWidth")+5),e.g.zoomer.set("rowHeight",e.g.zoomer.get("rowHeight")+2),e.g.zoomer.set("labelFontSize",e.g.zoomer.get("labelFontSize")+2)}}(this)),this.addNode("Decrease font size",function(e){return function(){return e.g.zoomer.set("columnWidth",e.g.zoomer.get("columnWidth")-2),e.g.zoomer.set("rowHeight",e.g.zoomer.get("rowHeight")-2),e.g.zoomer.set("labelFontSize",e.g.zoomer.get("labelFontSize")-2),e.g.zoomer.get("columnWidth")<8?e.g.zoomer.set("textVisible",!1):void 0}}(this)),this.addNode("Bar chart exp scaling",function(e){return function(){return e.g.columns.set("scaling","exp")}}(this)),this.addNode("Bar chart linear scaling",function(e){return function(){return e.g.columns.set("scaling","lin")}}(this)),this.addNode("Bar chart log scaling",function(e){return function(){return e.g.columns.set("scaling","log")}}(this)),this.addNode("Minimized width",function(e){return function(){return e.g.zoomer.set("alignmentWidth",600)}}(this)),this.addNode("Minimized height",function(e){return function(){return e.g.zoomer.set("alignmentHeight",120)}}(this)),this.addNode("Jump to a column",function(e){return function(){var t;return t=prompt("Column","20"),0>t||t>e.model.getMaxLength()||isNaN(t)?(alert("invalid column"),void 0):e.g.zoomer.setLeftOffset(t)}}(this)),this.el.appendChild(this.buildDOM()),this}})},{"../../algo/ConsensusCalc":60,"../../model/Sequence":88,"../menubuilder":75}],79:[function(e,t){var n,i,r;i=e("../menubuilder"),r=e("underscore"),t.exports=n=i.extend({initialize:function(e){return this.g=e.g,this.el.style.display="inline-block"},render:function(){return this.setName("Filter"),this.addNode("Hide columns by threshold",function(e){return function(){var t,n,i,r,o,s,a;for(o=prompt("Enter threshold (in percent)",20),o/=100,r=e.model.getMaxLength(),n=[],t=e.g.columns.get("conserv"),i=s=0,a=r-1;a>=0?a>=s:s>=a;i=a>=0?++s:--s)t[i]=0?u>=l:l>=u;r=u>=0?++l:--l)n=0,a=0,e.model.each(function(e){return"-"===e.get("seq")[r]&&n++,a++}),t=n/a,t>s&&i.push(r);return e.g.columns.set("hidden",i)}}(this)),this.addNode("Hide seqs by identity",function(e){return function(){var t;return t=prompt("Enter threshold (in percent)",20),t/=100,e.model.each(function(e){return e.get("identity")=0?e.set("hidden",!0):void 0})}}(this)),this.addNode("Hide seqs by gaps",function(e){return function(){var t;return t=prompt("Enter threshold (in percent)",40),e.model.each(function(e){var n,i;return i=e.get("seq"),n=r.reduce(i,function(e,t){return"-"===t&&e++,e},0),console.log(n),n>t?e.set("hidden",!0):void 0})}}(this)),this.addNode("Reset",function(e){return function(){return e.g.columns.set("hidden",[]),e.model.each(function(e){return e.get("hidden")?e.set("hidden",!1):void 0})}}(this)),this.el.appendChild(this.buildDOM()),this}})},{"../menubuilder":75,underscore:59}],80:[function(e,t){var n,i;i=e("../menubuilder"),t.exports=n=i.extend({initialize:function(e){return this.g=e.g},render:function(){return this.setName("Help"),this.addNode("About the project",function(){return function(){return window.open("https://github.com/greenify/biojs-vis-msa")}}(this)),this.addNode("Report issues",function(){return function(){return window.open("https://github.com/greenify/biojs-vis-msa/issues")}}(this)),this.addNode("User manual",function(){return function(){return window.open("https://github.com/greenify/biojs-vis-msa/wiki")}}(this)),this.el.style.display="inline-block",this.el.appendChild(this.buildDOM()),this}})},{"../menubuilder":75}],81:[function(e,t){var n,i,r,o,s;n=e("biojs-io-clustal"),i=e("biojs-io-fasta").parse,o=e("../menubuilder"),s=e("../../utils/proxy").corsURL,t.exports=r=o.extend({initialize:function(e){return this.g=e.g,this.el.style.display="inline-block"},render:function(){return this.setName("Import"),this.addNode("FASTA",function(e){return function(){var t;return t=prompt("URL","/test/dummy/samples/p53.clustalo.fasta"),t=s(t,e.g),i.read(t,function(t){var n;return n=e.g.zoomer.toJSON(),n.labelWidth=200,n.boxRectHeight=2,n.boxRectWidth=2,e.model.reset([]),e.g.zoomer.set(n),e.model.reset(t),e.g.columns.calcConservation(e.model)})}}(this)),this.addNode("CLUSTAL",function(e){return function(){var t;return t=prompt("URL","/test/dummy/samples/p53.clustalo.clustal"),t=s(t,e.g),n.read(t,function(t){var n;return n=e.g.zoomer.toJSON(),n.labelWidth=200,n.boxRectHeight=2,n.boxRectWidth=2,e.model.reset([]),e.g.zoomer.set(n),e.model.reset(t),e.g.columns.calcConservation(e.model)})}}(this)),this.addNode("add your own Parser",function(){return function(){return window.open("https://github.com/biojs/biojs2")}}(this)),this.el.appendChild(this.buildDOM()),this}})},{"../../utils/proxy":93,"../menubuilder":75,"biojs-io-clustal":void 0,"biojs-io-fasta":void 0}],82:[function(e,t){var n,i,r,o;n=e("../menubuilder"),r=e("dom-helper"),o=e("underscore"),t.exports=i=n.extend({initialize:function(e){return this.g=e.g,this.order="ID",this.el.style.display="inline-block"},setOrder:function(e){return this.order=e,this.render()},render:function(){var e,t,n,i,o;for(this.setName("Ordering"),e=this.getComparators(),i=0,o=e.length;o>i;i++)n=e[i],this._addNode(n);return t=this.buildDOM(),r.removeAllChilds(this.el),this.el.appendChild(t),this},_addNode:function(e){var t,n;return n=e.text,t={},n===this.order&&(t.backgroundColor="#77ED80"),this.addNode(n,function(t){return function(){return null!=e.precode&&e.precode(),t.model.comparator=e.comparator,t.model.sort(),t.setOrder(e.text)}}(this),{style:t})},getComparators:function(){var e;return e=[],e.push({text:"ID",comparator:"id"}),e.push({text:"ID Desc",comparator:function(e,t){return-e.get("id").localeCompare(t.get("id"))}}),e.push({text:"Label",comparator:"name"}),e.push({text:"Label Desc",comparator:function(e,t){return-e.get("name").localeCompare(t.get("name"))}}),e.push({text:"Seq",comparator:"seq"}),e.push({text:"Seq Desc",comparator:function(e,t){return-e.get("seq").localeCompare(t.get("seq"))}}),e.push({text:"Identity",comparator:"identity"}),e.push({text:"Identity Desc",comparator:function(e){return-e.get("identity")}}),e.push({text:"Partition codes",comparator:"partition",precode:function(e){return function(){return e.g.vis.set("labelPartition",!0),e.model.each(function(e){return e.set("partition",o.random(1,3))})}}(this)}),e}})},{"../menubuilder":75,"dom-helper":49,underscore:59}],83:[function(e,t){var n,i,r;r=e("../../g/selection/Selection"),n=e("../menubuilder"),t.exports=i=n.extend({initialize:function(e){return this.g=e.g,this.el.style.display="inline-block"},render:function(){return this.setName("Selection"),this.addNode("Find Motif (supports RegEx)",function(e){return function(){var t,n,i,o,s;return o=prompt("your search","D"),o=new RegExp(o,"gi"),s=e.g.selcol,n=[],t=i=100042,e.model.each(function(e){var i,s,a,l,u;for(l=e.get("seq"),u=[];a=o.exec(l);)s=a.index,i={xStart:s,xEnd:s+a[0].length-1,seqId:e.get("id")},n.push(new r.possel(i)),u.push(t=Math.min(s,t));return u}),0===n.length&&alert("no selection found"),s.reset(n),t===i&&(t=0),e.g.zoomer.setLeftOffset(t)}}(this)),this.addNode("Invert columns",function(e){return function(){var t;return e.g.selcol.invertCol(function(){t=[];for(var n=0,i=e.model.getMaxLength();i>=0?i>=n:n>=i;i>=0?n++:n--)t.push(n);return t}.apply(this))}}(this)),this.addNode("Invert rows",function(e){return function(){return e.g.selcol.invertRow(e.model.pluck("id"))}}(this)),this.addNode("Reset",function(e){return function(){return e.g.selcol.reset()}}(this)),this.el.appendChild(this.buildDOM()),this}})},{"../../g/selection/Selection":67,"../menubuilder":75}],84:[function(e,t){var n,i,r;i=e("../menubuilder"),r=e("dom-helper"),t.exports=n=i.extend({initialize:function(e){return this.g=e.g,this.el.style.display="inline-block",this.listenTo(this.g.vis,"change",this.render)},render:function(){var e,t,n,i;for(this.setName("Vis. elements"),t=this.getVisElements(),n=0,i=t.length;i>n;n++)e=t[n],this._addVisEl(e);return this.addNode("Reset",function(e){return function(){return e.g.vis.set("labels",!0),e.g.vis.set("sequences",!0),e.g.vis.set("metacell",!0),e.g.vis.set("conserv",!0),e.g.vis.set("labelId",!0),e.g.vis.set("labelName",!0),e.g.vis.set("labelCheckbox",!1)}}(this)),this.addNode("Toggle mouseover events",function(e){return function(){return e.g.config.set("registerMouseHover",!e.g.config.get("registerMouseHover"))}}(this)),r.removeAllChilds(this.el),this.el.appendChild(this.buildDOM()),this},_addVisEl:function(e){var t,n;return n={},this.g.vis.get(e.id)?(t="Hide ",n.color="red"):(t="Show ",n.color="green"),this.addNode(t+e.name,function(t){return function(){return t.g.vis.set(e.id,!t.g.vis.get(e.id))}}(this),{style:n})},getVisElements:function(){var e;return e=[],e.push({name:"Markers",id:"markers"}),e.push({name:"Labels",id:"labels"}),e.push({name:"Sequences",id:"sequences"}),e.push({name:"Meta info",id:"metacell"}),e.push({name:"Overviewbox",id:"overviewbox"}),e.push({name:"conserv",id:"conserv"}),e.push({name:"LabelName",id:"labelName"}),e.push({name:"LabelId",id:"labelId"}),e.push({name:"LabelCheckbox",id:"labelCheckbox"}),e}})},{"../menubuilder":75,"dom-helper":49}],85:[function(e,t){var n,i;n=e("./Feature"),i=e("backbone-thin").Model,t.exports=n=i.extend({defaults:{xStart:-1,xEnd:-1,height:-1,text:"",fillColor:"red",fillOpacity:.5,type:"rectangle",borderSize:1,borderColor:"black",borderOpacity:.5,validate:!0},validate:function(){return isNaN(this.attributes.xStart||isNaN(this.attributes.xEnd))?"features need integer start and end.":void 0},contains:function(e){return this.attributes.xStart<=e&&e<=this.attributes.xEnd}})},{"./Feature":85,"backbone-thin":5}],86:[function(e,t){var n,i,r,o;i=e("./Feature"),n=e("backbone-thin").Collection,o=e("underscore"),t.exports=r=n.extend({model:i,constructor:function(){return this.startOnCache=[],this.on("all",function(){return this.startOnCache=[]},this),n.apply(this,arguments)},startOn:function(e){return null==this.startOnCache[e]&&(this.startOnCache[e]=this.where({xStart:e})),this.startOnCache[e]},contains:function(e){return this.reduce(function(t,n){return n||t.contains(e)},!1)},getMinRows:function(){var e,t,n;return e=this.max(function(e){return e.get("xEnd")}),t=function(){var t,i;for(i=[],n=t=1;e>=1?e>=t:t>=e;n=e>=1?++t:--t)i.push(0);return i}(),this.each(function(e){var i,r,o,s;for(s=[],n=i=r=e.get("xStart"),o=feature.get("xEnd");o>=i;n=i+=1)s.push(t[n]++);return s}),o.max(t)}})},{"./Feature":85,"backbone-thin":5,underscore:59}],87:[function(e,t){var n,i,r;r=e("./Sequence"),n=e("backbone-thin").Collection,t.exports=i=n.extend({model:r,constructor:function(){return n.apply(this,arguments),this.on("all",function(){return this.lengthCache=null},this),this.lengthCache=null,this},getMaxLength:function(){return 0===this.models.length?0:(null===this.lengthCache&&(this.lengthCache=this.max(function(e){return e.get("seq").length}).get("seq").length),this.lengthCache)},prev:function(e,t){var n;return n=this.indexOf(e)-1,0>n&&t&&(n=this.length-1),this.at(n)},next:function(e,t){var n;return n=this.indexOf(e)+1,n===this.length&&t&&(n=0),this.at(n)},calcHiddenSeqs:function(e){var t,n,i;for(n=e,t=i=0;n>=0?n>=i:i>=n;t=n>=0?++i:--i)this.at(t).get("hidden")&&n++;return n-e}})},{"./Sequence":88,"backbone-thin":5}],88:[function(e,t){var n,i,r;i=e("backbone-thin").Model,n=e("./FeatureCol"),t.exports=r=i.extend({defaults:{name:"",id:"",seq:""},initialize:function(){return this.set("grey",[]),this.set("features",new n)}})},{"./FeatureCol":86,"backbone-thin":5}],89:[function(e,t){t.exports.seq=e("./Sequence"),t.exports.seqcol=e("./SeqCollection"),t.exports.feature=e("./Feature"),t.exports.featurecol=e("./FeatureCol")},{"./Feature":85,"./FeatureCol":86,"./SeqCollection":87,"./Sequence":88}],90:[function(e,t){var n,i,r,o,s,a,l,u,c,h,d,f;l=e("./model/SeqCollection"),n=e("./g/colorator"),o=e("./g/consensus"),i=e("./g/columns"),r=e("./g/config"),a=e("./g/selection/SelectionCol"),h=e("./g/visibility"),c=e("./g/visOrdering"),d=e("./g/zoomer"),f=e("backbone-childs"),s=e("biojs-events"),u=e("./views/Stage"),t.exports=f.extend({initialize:function(e){var t;return null==e.columns&&(e.columns={}),null==e.conf&&(e.conf={}),null==e.vis&&(e.vis={}),null==e.zoomer&&((null!=(t=e.visorder)?t:e.zoomer={})||(e.visorder={})),this.g=s.mixin({}),(void 0===e.seqs||0===e.seqs.length)&&console.log("warning. empty seqs."),this.seqs=new l(e.seqs),this.g.config=new r(e.conf),this.g.consensus=new o,this.g.columns=new i(e.columns),this.g.colorscheme=new n,this.g.selcol=new a([],{g:this.g}),this.g.vis=new h(e.vis),this.g.visorder=new c(e.visorder),this.g.zoomer=new d(e.zoomer,{g:this.g}),this.addView("stage",new u({model:this.seqs,g:this.g})),this.el.setAttribute("class","biojs_msa_div"),this.g.config.get("eventBus")===!0?this.startEventBus():void 0},startEventBus:function(){var e,t,n,i,r;for(e=["config","consensus","columns","colorscheme","selcol","vis","visorder","zoomer"],r=[],n=0,i=e.length;i>n;n++)t=e[n],r.push(this._proxyToG(t));return r},_proxyToG:function(e){return this.listenTo(this.g[e],"all",function(t,n,i){return"change"!==t?this.g.trigger(e+":"+t,i):void 0})},render:function(){return this.renderSubviews(),this.g.vis.set("loaded",!0),this}})},{"./g/colorator":63,"./g/columns":64,"./g/config":65,"./g/consensus":66,"./g/selection/SelectionCol":68,"./g/visOrdering":69,"./g/visibility":70,"./g/zoomer":71,"./model/SeqCollection":87,"./views/Stage":100,"backbone-childs":3,"biojs-events":14}],91:[function(e,t){var n;t.exports=n=function(){function e(){}return e.randomInt=function(e,t){var n,i;return null==t&&(n=[0,e],e=n[0],t=n[1]),e>t&&(i=[t,e],e=i[0],t=i[1]),Math.floor(Math.random()*(t-e+1)+e)},e.uniqueId=function(e){var t;for(null==e&&(e=8),t="";t.length=0&&"/"===t[0]?t:(t=t.replace("www.",""),t=t.replace("http://",""),t=e.g.config.get("importProxy")+t)}}(this)}},{}],94:[function(e,t){var n,i,r;i=e("biojs-model").seq,n=e("./bmath"),r=t.exports={_generateSequence:function(e){var t,n,i,r,o;for(i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",t=r=0,o=e-1;o>=r;t=r+=1)i+=n.charAt(Math.floor(Math.random()*n.length));return i},getDummySequences:function(e,t){var o,s,a;for(s=[],null==e&&(e=n.getRandomInt(3,5)),null==t&&(t=n.getRandomInt(50,200)),o=a=1;e>=a;o=a+=1)s.push(new i(r._generateSequence(t),"seq"+o,"r"+o));return s}}},{"./bmath":91,"biojs-model":27}],95:[function(e,t){var n,i,r,o,s,a;a="http://www.w3.org/2000/svg",s=function(e,t){var n,i;for(n in t)i=t[n],e.setAttributeNS(null,n,i);return e},n=function(e){var t;return t=document.createElementNS(a,"svg"),t.setAttribute("width",e.width),t.setAttribute("height",e.height),t},o=function(e){var t;return t=document.createElementNS(a,"rect"),s(t,e)},i=function(e){var t;return t=document.createElementNS(a,"line"),s(t,e)},r=function(e){var t;return t=document.createElementNS(a,"polygon"),s(t,e)},t.exports.rect=o,t.exports.line=i,t.exports.polygon=r,t.exports.base=n},{}],96:[function(e,t){var n,i,r;r=e("backbone-childs"),i=e("./CanvasSeqBlock"),n=e("./labels/LabelBlock"),t.exports=r.extend({initialize:function(e){var t,r;return this.g=e.g,t=new n({model:this.model,g:this.g}),t.ordering=-1,this.addView("labelblock",t),this.g.vis.get("sequences")&&(r=new i({model:this.model,g:this.g}),r.ordering=0,this.addView("seqblock",r)),this.listenTo(this.g.zoomer,"change:alignmentHeight",this.adjustHeight),this.listenTo(this.g.columns,"change:hidden",this.adjustHeight)},render:function(){return this.renderSubviews(),this.el.className="biojs_msa_albody",this.el.style.whiteSpace="nowrap",this.adjustHeight(),this +},adjustHeight:function(){return this.el.style.height="auto"===this.g.zoomer.get("alignmentHeight")?this.g.zoomer.get("rowHeight")*this.model.length+5:this.g.zoomer.get("alignmentHeight"),this.el.style.width=this.getWidth()+15},getWidth:function(){var e;return e=0,this.g.vis.get("labels")&&(e+=this.g.zoomer.get("labelWidth")),this.g.vis.get("metacell")&&(e+=this.g.zoomer.get("metaWidth")),this.g.vis.get("sequences")&&(e+=this.g.zoomer.get("alignmentWidth")),e}})},{"./CanvasSeqBlock":98,"./labels/LabelBlock":104,"backbone-childs":3}],97:[function(e,t){var n,i;i=e("biojs-events"),t.exports=n=function(){function e(e){this.g=e,this.cache={},this.cacheHeight=0,this.cacheWidth=0}return e.prototype.getFontTile=function(e,t,n){return(t!==this.cacheWidth||n!==this.cacheHeight)&&(this.cacheHeight=n,this.cacheWidth=t,this.cache={}),void 0===this.cache[e]&&this.createTile(e,t,n),this.cache[e]},e.prototype.createTile=function(e,t,n){var i;return i=this.cache[e]=document.createElement("canvas"),i.width=t,i.height=n,this.ctx=i.getContext("2d"),this.ctx.font=this.g.zoomer.get("residueFont"),this.ctx.textBaseline="middle",this.ctx.textAlign="center",this.ctx.fillText(e,t/2,n/2,t)},e}()},{"biojs-events":14}],98:[function(e,t){var n,i,r,o,s,a;i=e("backbone-childs"),s=e("mouse-pos"),r=e("biojs-util-colorschemes").selector,a=e("underscore"),o=e("jbone"),n=e("./CanvasCharCache"),t.exports=i.extend({tagName:"canvas",initialize:function(e){return this.g=e.g,this.listenTo(this.g.zoomer,"change:_alignmentScrollLeft change:_alignmentScrollTop",function(e,t,n){return null==(null!=n?n.origin:void 0)||"canvasseq"!==n.origin?this.render():void 0}),this.listenTo(this.g.columns,"change:hidden",this.render),this.listenTo(this.g.zoomer,"change:alignmentWidth",this.render),this.listenTo(this.g.colorscheme,"change",this.render),this.listenTo(this.g.selcol,"reset add",this.render),this.el.style.display="inline-block",this.el.style.overflowX="hidden",this.el.style.overflowY="hidden",this.el.className="biojs_msa_seqblock",this.ctx=this.el.getContext("2d"),this.cache=new n(this.g),this.throttleTime=0,this.throttleCounts=0,this.throttledDraw=null!=document.documentElement.style.webkitAppearance?function(){var e,t;return e=+new Date,this.draw(),this.throttleTime+=+new Date-e,this.throttleCounts++,this.throttleCounts>15?(t=Math.ceil(this.throttleTime/this.throttleCounts),console.log("avgDrawTime/WebKit",t),this.throttledDraw=this.draw):void 0}:a.throttle(this.throttledDraw,30),this.manageEvents()},throttledDraw:function(){var e,t;return e=+new Date,this.draw(),this.throttleTime+=+new Date-e,this.throttleCounts++,this.throttleCounts>15?(t=Math.ceil(this.throttleTime/this.throttleCounts),console.log("avgDrawTime",t),t*=1.2,t=Math.max(20,t),this.throttledDraw=a.throttle(this.draw,t)):void 0},manageEvents:function(){var e;return e={},e.mousedown="_onmousedown",e.touchstart="_ontouchstart",this.g.config.get("registerMouseClicks")&&(e.dblclick="_onclick"),this.g.config.get("registerMouseHover")&&(e.mousein="_onmousein",e.mouseout="_onmouseout"),e.mousewheel="_onmousewheel",e.DOMMouseScroll="_onmousewheel",this.delegateEvents(e),this.listenTo(this.g.config,"change:registerMouseHover",this.manageEvents),this.listenTo(this.g.config,"change:registerMouseClick",this.manageEvents),this.dragStart=[]},draw:function(){var e;return this.el.width=this.el.width,e=this.g.zoomer.get("rowHeight"),this.ctx.globalAlpha=this.g.colorscheme.get("opacity"),this.drawSeqs(function(e){return this.drawSeq(e,this._drawRect)}),this.ctx.globalAlpha=1,this.drawSeqs(function(e){return this.drawSeq(e,this._drawLetter)}),this.drawSeqs(this.drawSeqExtended)},drawSeqs:function(e){var t,n,i,r,o,s,a,l;for(i=this.g.zoomer.get("rowHeight"),t=this.g.columns.get("hidden"),r=Math.max(0,Math.abs(Math.ceil(-this.g.zoomer.get("_alignmentScrollTop")/i))),o=-Math.abs(-this.g.zoomer.get("_alignmentScrollTop")%i),l=[],n=s=r,a=this.model.length-1;a>=s;n=s+=1)if(!this.model.at(n).get("hidden")){if(e.call(this,{model:this.model.at(n),y:o,hidden:t}),o+=i,o>this.el.height)break;l.push(void 0)}return l},drawSeq:function(e,t){var n,i,r,o,s,a,l,u,c,h,d,f,g;for(l=e.model.get("seq"),h=e.y,s=this.g.zoomer.get("columnWidth"),o=this.g.zoomer.get("rowHeight"),u=Math.max(0,Math.abs(Math.ceil(-this.g.zoomer.get("_alignmentScrollLeft")/s))),c=-Math.abs(-this.g.zoomer.get("_alignmentScrollLeft")%s),a={rectWidth:s,rectHeight:o,y:h},i=this.el.width,g=[],r=d=u,f=l.length-1;f>=d;r=d+=1)if(n=l[r],n=n.toUpperCase(),a.x=c,a.c=n,e.hidden.indexOf(r)<0){if(t(this,a),c+=s,c>i)break;g.push(void 0)}return g},_drawRect:function(e,t){var n;return n=e.color[t.c],null!=n?(e.ctx.fillStyle=n,e.ctx.fillRect(t.x,t.y,t.rectWidth,t.rectHeight)):void 0},_drawLetter:function(e,t){return e.ctx.drawImage(e.cache.getFontTile(t.c,t.rectWidth,t.rectHeight),t.x,t.y,t.rectWidth,t.rectHeight)},drawSeqExtended:function(e){var t,n,i,r,o,s,a,l,u,c,h,d,f,g,m,p,v,b,x;for(u=e.model.get("seq"),a=this.g.zoomer.get("columnWidth"),s=this.g.zoomer.get("rowHeight"),c=Math.max(0,Math.abs(Math.ceil(-this.g.zoomer.get("_alignmentScrollLeft")/a))),d=-Math.abs(-this.g.zoomer.get("_alignmentScrollLeft")%a),f=d-c*a,l=this._getSelection(e.model),b=this._getPrevNextSelection(e.model),o=b[0],r=b[1],n=e.model.get("features"),g=e.y,i=m=c,x=u.length-1;x>=m;i=m+=1)if(h=n.startOn(i),!(e.hidden.indexOf(i)>=0)){if(h.length>0)for(p=0,v=h.length;v>p;p++)t=h[p],this.appendFeature({f:t,xZero:d,yZero:g});if(d+=a,d>this.el.width)break}return this._appendSelection({model:e.model,xZero:f,yZero:g,hidden:e.hidden})},render:function(){return this.el.setAttribute("height",this.g.zoomer.get("alignmentHeight")),this.el.setAttribute("width",this.g.zoomer.get("alignmentWidth")),this.g.zoomer._adjustWidth(this.el,this.model),this.g.zoomer._checkScrolling(this._checkScrolling([this.g.zoomer.get("_alignmentScrollLeft"),this.g.zoomer.get("_alignmentScrollTop")]),{header:"canvasseq"}),this.color=r.getColor(this.g.colorscheme.get("scheme")),this.throttledDraw(),this},_onmousemove:function(e,t){var n,i,r,o,a,l,u,c,h;if(0!==this.dragStart.length){for(n=s.abs(e),o=[n[0]-this.dragStart[0],n[1]-this.dragStart[1]],a=this.g.zoomer.get("canvasEventScale"),t&&(a=3),i=u=0;1>=u;i=u+=1)o[i]=o[i]*a;for(r=[this.dragStartScroll[0]-o[0],this.dragStartScroll[1]-o[1]],i=c=0;1>=c;i=c+=1)r[i]=Math.round(r[i]);for(l=this._checkScrolling(r),this.g.zoomer._checkScrolling(l,{origin:"canvasseq"}),i=h=0;1>=h;i=h+=1)l[i]!==r[i]&&(0===l[i]?(this.dragStart[i]=n[i],this.dragStartScroll[i]=0):this.dragStart[i]=n[i]-l[i]);return this.throttledDraw(),null!=e.preventDefault?(e.preventDefault(),e.stopPropagation()):void 0}},_ontouchmove:function(e){return this._onmousemove(e.changedTouches[0],!0),e.preventDefault(),e.stopPropagation()},_onmousedown:function(e){return this.dragStart=s.abs(e),this.dragStartScroll=[this.g.zoomer.get("_alignmentScrollLeft"),this.g.zoomer.get("_alignmentScrollTop")],o(document.body).on("mousemove.overmove",function(e){return function(t){return e._onmousemove(t)}}(this)),o(document.body).on("mouseup.overup",function(e){return function(){return e._cleanup()}}(this)),e.preventDefault()},_ontouchstart:function(e){return this.dragStart=s.abs(e.changedTouches[0]),this.dragStartScroll=[this.g.zoomer.get("_alignmentScrollLeft"),this.g.zoomer.get("_alignmentScrollTop")],o(document.body).on("touchmove.overtmove",function(e){return function(t){return e._ontouchmove(t)}}(this)),o(document.body).on("touchend.overtend touchleave.overtleave touchcancel.overtcanel",function(e){return function(t){return e._touchCleanup(t)}}(this))},_onmousewinout:function(e){return e.toElement===document.body.parentNode?this._cleanup():void 0},_cleanup:function(){return this.dragStart=[],o(document.body).off(".overmove"),o(document.body).off(".overup"),o(document.body).off(".overout")},_touchCleanup:function(e){return e.changedTouches.length>0&&this._onmousemove(e.changedTouches[0],!0),this.dragStart=[],o(document.body).off(".overtmove"),o(document.body).off(".overtend"),o(document.body).off(".overtleave"),o(document.body).off(".overtcancel")},_onmousewheel:function(e){var t;return t=s.wheelDelta(e),this.g.zoomer.set("_alignmentScrollLeft",this.g.zoomer.get("_alignmentScrollLeft")+t[0]),this.g.zoomer.set("_alignmentScrollTop",this.g.zoomer.get("_alignmentScrollTop")+t[1]),e.preventDefault()},_onclick:function(e){return this.g.trigger("residue:click",this._getClickPos(e)),this.throttledDraw()},_onmousein:function(e){return this.g.trigger("residue:click",this._getClickPos(e)),this.throttledDraw()},_onmouseout:function(e){return this.g.trigger("residue:click",this._getClickPos(e)),this.throttledDraw()},_getClickPos:function(e){var t,n,i,r;return t=s.rel(e),t[0]+=this.g.zoomer.get("_alignmentScrollLeft"),t[1]+=this.g.zoomer.get("_alignmentScrollTop"),i=Math.floor(t[0]/this.g.zoomer.get("columnWidth")),r=Math.floor(t[1]/this.g.zoomer.get("rowHeight")),i+=this.g.columns.calcHiddenColumns(i),r+=this.model.calcHiddenSeqs(r),i=Math.max(0,i),r=Math.max(0,r),n=this.model.at(r).get("id"),{seqId:n,rowPos:i,evt:e}},_checkScrolling:function(e){var t,n,i;for(n=[this.model.getMaxLength()*this.g.zoomer.get("columnWidth")-this.g.zoomer.get("alignmentWidth"),this.model.length*this.g.zoomer.get("rowHeight")-this.g.zoomer.get("alignmentHeight")],t=i=0;1>=i;t=i+=1)e[t]>n[t]&&(e[t]=n[t]),e[t]<0&&(e[t]=0);return e},_getSelection:function(e){var t,n,i,r,o,s,l,u,c,h,d,f,g;if(t=e.get("seq").length,o=[],s=this.g.selcol.getSelForRow(e.get("id")),i=a.find(s,function(e){return"row"===e.get("type")}),null!=i)for(n=l=0,d=t-1;d>=l;n=l+=1)o.push(n);else if(s.length>0)for(u=0,h=s.length;h>u;u++)for(r=s[u],n=c=f=r.get("xStart"),g=r.get("xEnd");g>=c;n=c+=1)o.push(n);return o},appendFeature:function(e){var t,n,i,r,o,s;return o=e.f,r=this.g.zoomer.get("columnWidth"),i=this.g.zoomer.get("rowHeight"),s=(o.get("xEnd")-o.get("xStart"))*r,n=this.ctx.lineWidth,this.ctx.lineWidth=3,t=this.ctx.strokeStyle,this.ctx.strokeStyle=o.get("fillColor"),this.ctx.strokeRect(e.xZero,e.yZero,s,i),this.ctx.strokeStyle=t,this.ctx.lineWidth=n},_appendSelection:function(e){var t,n,i,r,o,s,a,l,u,c,h,d,f;if(u=e.model.get("seq"),l=this._getSelection(e.model),h=this._getPrevNextSelection(e.model),s=h[0],o=h[1],n=this.g.zoomer.get("columnWidth"),t=this.g.zoomer.get("rowHeight"),0!==l.length){for(i=0,f=[],a=c=0,d=u.length-1;d>=c;a=c+=1)e.hidden.indexOf(a)>=0?f.push(i++):(r=a-i,l.indexOf(a)>=0&&(0===r||l.indexOf(a-1)<0)?f.push(this._renderSelection({n:a,k:r,selection:l,mPrevSel:s,mNextSel:o,xZero:e.xZero,yZero:e.yZero,model:e.model})):f.push(void 0));return f}},_renderSelection:function(e){var t,n,i,r,o,s,a,l,u,c,h,d,f,g,m,p,v,b,x,w,y;for(p=e.xZero,v=e.yZero,c=e.n,a=e.k,h=e.selection,u=e.mPrevSel,l=e.mNextSel,d=0,s=b=c,w=e.model.get("seq").length-1;w>=b&&h.indexOf(s)>=0;s=b+=1)d++;for(r=this.g.zoomer.get("columnWidth"),i=this.g.zoomer.get("rowHeight"),f=r*d+1,o=this.g.columns.get("hidden"),this.ctx.beginPath(),n=this.ctx.lineWidth,this.ctx.lineWidth=3,t=this.ctx.strokeStyle,this.ctx.strokeStyle="#FF0000",p+=a*r,g=0,s=x=0,y=d-1;y>=0?y>=x:x>=y;s=y>=0?++x:--x)m=c+s,o.indexOf(m)>=0||(null!=u&&u.indexOf(m)>=0||(this.ctx.moveTo(p+g,v),this.ctx.lineTo(g+r+p,v)),null!=l&&l.indexOf(m)>=0||(this.ctx.moveTo(g+p,i+v),this.ctx.lineTo(g+r+p,i+v)),g+=r);return this.ctx.moveTo(p,v),this.ctx.lineTo(p,i+v),this.ctx.moveTo(p+f,v),this.ctx.lineTo(p+f,i+v),this.ctx.stroke(),this.ctx.strokeStyle=t,this.ctx.lineWidth=n},_getPrevNextSelection:function(e){var t,n,i,r;return r=e.collection.prev(e),i=e.collection.next(e),null!=r&&(n=this._getSelection(r)),null!=i&&(t=this._getSelection(i)),[n,t]}})},{"./CanvasCharCache":97,"backbone-childs":3,"biojs-util-colorschemes":29,jbone:50,"mouse-pos":51,underscore:59}],99:[function(e,t){var n,i,r,o,s,a,l;a=e("backbone-viewj"),o=e("mouse-pos"),s=e("../g/selection/Selection"),i=e("biojs-util-colorschemes").selector,r=e("jbone"),l=e("underscore"),t.exports=n=a.extend({className:"biojs_msa_overviewbox",tagName:"canvas",initialize:function(e){return this.g=e.g,this.listenTo(this.g.zoomer,"change:boxRectWidth change:boxRectHeight",this.render),this.listenTo(this.g.selcol,"add reset change",this.render),this.listenTo(this.g.columns,"change:hidden",this.render),this.listenTo(this.g.colorscheme,"change:showLowerCase",this.render),this.listenTo(this.model,"change",l.debounce(this.render,5)),this.color=i.getColor(this.g.colorscheme.get("scheme")),this.listenTo(this.g.colorscheme,"change:scheme",function(){return this.color=i.getColor(this.g.colorscheme.get("scheme")),this.render()}),this.dragStart=[]},events:{click:"_onclick",mousedown:"_onmousedown"},render:function(){var e,t,n,i,r,o,s,a,l,u,c,h,d,f,g;for(this._createCanvas(),this.el.textContent="overview",this.ctx.fillStyle="#999999",this.ctx.fillRect(0,0,this.el.width,this.el.height),s=this.g.zoomer.get("boxRectWidth"),o=this.g.zoomer.get("boxRectHeight"),n=this.g.columns.get("hidden"),l=this.g.colorscheme.get("showLowerCase"),c=-o,i=h=0,f=this.model.length-1;f>=h;i=h+=1)if(a=this.model.at(i).get("seq"),u=0,c+=o,this.model.at(i).get("hidden"))console.log(this.model.at(i).get("hidden")),this.ctx.fillStyle="grey",this.ctx.fillRect(0,c,a.length*s,o);else for(r=d=0,g=a.length-1;g>=d;r=d+=1)e=a[r],l&&(e=e.toUpperCase()),t=this.color[e],n.indexOf(r)>=0&&(t="grey"),null!=t&&(this.ctx.fillStyle=t,this.ctx.fillRect(u,c,s,o)),u+=s;return this._drawSelection()},_drawSelection:function(){var e,t,n,i,r,o,s,a,l;if(!(this.dragStart.length>0)||this.prolongSelection){for(r=this.g.zoomer.get("boxRectWidth"),i=this.g.zoomer.get("boxRectHeight"),t=i*this.model.length,this.ctx.fillStyle="#ffff00",this.ctx.globalAlpha=.9,e=a=0,l=this.g.selcol.length-1;l>=a;e=a+=1)o=this.g.selcol.at(e),"column"===o.get("type")?this.ctx.fillRect(r*o.get("xStart"),0,r*(o.get("xEnd")-o.get("xStart")+1),t):"row"===o.get("type")?(s=this.model.filter(function(e){return e.get("id")===o.get("seqId")})[0],n=this.model.indexOf(s),this.ctx.fillRect(0,i*n,r*s.get("seq").length,i)):"pos"===o.get("type")&&(s=this.model.filter(function(e){return e.get("id")===o.get("seqId")})[0],n=this.model.indexOf(s),this.ctx.fillRect(r*o.get("xStart"),i*n,r*(o.get("xEnd")-o.get("xStart")+1),i));return this.ctx.globalAlpha=1}},_onclick:function(e){return this.g.trigger("meta:click",{seqId:this.model.get("id",{evt:e})})},_onmousemove:function(e){var t;if(0!==this.dragStart.length)return this.render(),this.ctx.fillStyle="#ffff00",this.ctx.globalAlpha=.9,t=this._calcSelection(o.abs(e)),this.ctx.fillRect(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0]),e.preventDefault(),e.stopPropagation()},_onmousedown:function(e){return this.dragStart=o.abs(e),this.dragStartRel=o.rel(e),this.prolongSelection=e.ctrlKey||e.metaKey?!0:!1,r(document.body).on("mousemove.overmove",function(e){return function(t){return e._onmousemove(t)}}(this)),r(document.body).on("mouseup.overup",function(e){return function(t){return e._onmouseup(t)}}(this)),this.dragStart},_calcSelection:function(e){var t,n,i,r,o;for(t=[e[0]-this.dragStart[0],e[1]-this.dragStart[1]],n=r=0;1>=r;n=r+=1)t[n]=this.dragStartRel[n]+t[n];for(i=[[this.dragStartRel[0],t[0]],[this.dragStartRel[1],t[1]]],n=o=0;1>=o;n=o+=1)i[n][1]=l;n=++l)o[0][n]=Math.floor(o[0][n]/this.g.zoomer.get("boxRectWidth"));for(n=u=0;1>=u;n=++u)o[1][n]=Math.floor(o[1][n]/this.g.zoomer.get("boxRectHeight"));for(o[0][1]=Math.min(this.model.getMaxLength()-1,o[0][1]),o[1][1]=Math.min(this.model.length-1,o[1][1]),a=[],i=c=h=o[1][0],d=o[1][1];d>=c;i=c+=1)t={seqId:this.model.at(i).get("id"),xStart:o[0][0],xEnd:o[0][1]},a.push(new s.possel(t));return this.dragStart=[],this.prolongSelection?this.g.selcol.add(a):this.g.selcol.reset(a),this.g.zoomer.setLeftOffset(o[0][0]),this.g.zoomer.setTopOffset(o[1][0])}},_onmouseup:function(e){return this._endSelection(o.abs(e))},_onmouseout:function(e){return this._endSelection(o.abs(e))},_createCanvas:function(){var e,t;return t=this.g.zoomer.get("boxRectWidth"),e=this.g.zoomer.get("boxRectHeight"),this.el.height=this.model.length*e,this.el.width=this.model.getMaxLength()*t,this.ctx=this.el.getContext("2d"),this.el.style.overflow="scroll",this.el.style.cursor="crosshair"}})},{"../g/selection/Selection":67,"backbone-viewj":10,"biojs-util-colorschemes":29,jbone:50,"mouse-pos":51,underscore:59}],100:[function(e,t){var n,i,r,o,s,a;o=e("backbone-childs"),n=e("./AlignmentBody"),i=e("./header/HeaderBlock"),r=e("./OverviewBox"),s=e("../algo/identityCalc"),a=e("underscore"),t.exports=o.extend({initialize:function(e){return this.g=e.g,this.draw(),this.listenTo(this.model,"reset",function(){return this.isNotDirty=!1,this.rerender()}),this.listenTo(this.model,"change:hidden",a.debounce(this.rerender,10)),this.listenTo(this.model,"sort",this.rerender),this.listenTo(this.model,"add",function(){return console.log("seq add")}),this.listenTo(this.g.vis,"change:sequences",this.rerender),this.listenTo(this.g.vis,"change:overviewbox",this.rerender),this.listenTo(this.g.visorder,"change",this.rerender)},draw:function(){var e,t,o,a;return this.removeViews(),this.isNotDirty||(t=this.g.consensus.getConsensus(this.model),s(this.model,t),this.isNotDirty=!0),this.g.vis.get("overviewbox")&&(a=new r({model:this.model,g:this.g}),a.ordering=this.g.visorder.get("overviewBox"),this.addView("overviewbox",a)),o=new i({model:this.model,g:this.g}),o.ordering=this.g.visorder.get("headerBox"),this.addView("headerblock",o),e=new n({model:this.model,g:this.g}),e.ordering=this.g.visorder.get("alignmentBody"),this.addView("body",e)},render:function(){return this.renderSubviews(),this.el.className="biojs_msa_stage",this},rerender:function(){return this.draw(),this.render()}})},{"../algo/identityCalc":61,"./AlignmentBody":96,"./OverviewBox":99,"./header/HeaderBlock":102,"backbone-childs":3,underscore:59}],101:[function(e,t){var n,i,r,o;o=e("backbone-viewj"),i=e("dom-helper"),r=e("../../utils/svg"),n=o.extend({className:"biojs_msa_conserv",initialize:function(e){return this.g=e.g,this.listenTo(this.g.zoomer,"change:stepSize change:labelWidth change:columnWidth",this.render),this.listenTo(this.g.vis,"change:labels change:metacell",this.render),this.listenTo(this.g.columns,"change:scaling",this.render),this.listenTo(this.model,"reset",this.render),this.manageEvents()},render:function(){var e,t,n,o,s,a,l,u,c,h,d,f,g,m,p;for(this.g.columns.calcConservation(this.model),i.removeAllChilds(this.el),u=this.model.getMaxLength(),t=this.g.zoomer.get("columnWidth"),a=20,f=t*(u-this.g.columns.get("hidden").length),console.log(this.g.columns.get("hidden")),h=r.base({height:a,width:f}),h.style.display="inline-block",h.style.cursor="pointer",d=this.g.zoomer.get("stepSize"),o=this.g.columns.get("hidden"),g=0,l=0;u>l;)if(o.indexOf(l)>=0)l+=d;else{for(f=t*d,e=0,s=m=0,p=d-1;p>=0?p>=m:m>=p;s=p>=0?++m:--m)e+=this.g.columns.get("conserv")[l];n=a*(e/d),c=r.rect({x:g,y:a-n,width:f-t/4,height:n,style:"stroke:red;stroke-width:1;"}),c.rowPos=l,h.appendChild(c),g+=f,l+=d}return this.el.appendChild(h),this},_onclick:function(e){var t,n,i,r,o,s;for(n=e.target.rowPos,i=this.g.zoomer.get("stepSize"),s=[],t=r=0,o=i-1;o>=r;t=r+=1)s.push(this.g.trigger("bar:click",{rowPos:n+t,evt:e}));return s},manageEvents:function(){var e;return e={},this.g.config.get("registerMouseClicks")&&(e.click="_onclick"),this.g.config.get("registerMouseHover")&&(e.mousein="_onmousein",e.mouseout="_onmouseout"),this.delegateEvents(e),this.listenTo(this.g.config,"change:registerMouseHover",this.manageEvents),this.listenTo(this.g.config,"change:registerMouseClick",this.manageEvents)},_onmousein:function(e){var t;return t=this.g.zoomer.get("stepSize"*e.rowPos),this.g.trigger("bar:mousein",{rowPos:t,evt:e})},_onmouseout:function(e){var t;return t=this.g.zoomer.get("stepSize"*e.rowPos),this.g.trigger("bar:mouseout",{rowPos:t,evt:e})}}),t.exports=n},{"../../utils/svg":95,"backbone-viewj":10,"dom-helper":49}],102:[function(e,t){var n,i,r,o,s;i=e("./MarkerView"),n=e("./ConservationView"),o=e("../../algo/identityCalc"),r=e("backbone-childs"),s=e("underscore"),t.exports=r.extend({initialize:function(e){return this.g=e.g,this.blockEvents=!1,this.listenTo(this.g.vis,"change:markers change:conserv",function(){return this.draw(),this.render()}),this.listenTo(this.g.vis,"change",this._setSpacer),this.listenTo(this.g.zoomer,"change:alignmentWidth",function(){return this._adjustWidth()}),this.listenTo(this.g.zoomer,"change:_alignmentScrollLeft",this._adjustScrollingLeft),this.listenTo(this.g.columns,"change:hidden",function(){return this.draw(),this.render()}),this.draw(),this._onscroll=this._sendScrollEvent,this.g.vis.once("change:loaded",this._adjustScrollingLeft,this)},events:{scroll:"_onscroll"},draw:function(){var e,t,r;return this.removeViews(),this.isNotDirty||(e=this.g.consensus.getConsensus(this.model),o(this.model,e),this.isNotDirty=!0),this.g.vis.get("conserv")&&(t=new n({model:this.model,g:this.g}),t.ordering=-20,this.addView("conserv",t)),this.g.vis.get("markers")?(r=new i({model:this.model,g:this.g}),r.ordering=-10,this.addView("marker",r)):void 0},render:function(){return this.renderSubviews(),this._setSpacer(),this.el.className="biojs_msa_header",this.el.style.overflowX="auto",this._adjustWidth(),this._adjustScrollingLeft(),this},_sendScrollEvent:function(){return this.blockEvents||this.g.zoomer.set("_alignmentScrollLeft",this.el.scrollLeft,{origin:"header"}),this.blockEvents=!1},_adjustScrollingLeft:function(e,t,n){var i;return null==(null!=n?n.origin:void 0)||"header"!==n.origin?(i=this.g.zoomer.get("_alignmentScrollLeft"),this.blockEvents=!0,this.el.scrollLeft=i):void 0},_setSpacer:function(){return this.el.style.marginLeft=this._getLabelWidth()+"px"},_getLabelWidth:function(){var e;return e=0,this.g.vis.get("labels")&&(e+=this.g.zoomer.get("labelWidth")),this.g.vis.get("metacell")&&(e+=this.g.zoomer.get("metaWidth")),e},_adjustWidth:function(){return this.el.style.width=this.g.zoomer.get("alignmentWidth")+"px"}})},{"../../algo/identityCalc":61,"./ConservationView":101,"./MarkerView":103,"backbone-childs":3,underscore:59}],103:[function(e,t){var n,i,r,o,s;s=e("backbone-viewj"),i=e("dom-helper"),o=e("../../utils/svg"),r=e("jbone"),n=s.extend({className:"biojs_msa_marker",initialize:function(e){return this.g=e.g,this.listenTo(this.g.zoomer,"change:stepSize change:labelWidth change:columnWidth change:markerStepSize change:markerFontsize",this.render),this.listenTo(this.g.vis,"change:labels change:metacell",this.render),this.manageEvents()},render:function(){var e,t,n,r,o,s,a;for(i.removeAllChilds(this.el),this.el.style.fontSize=this.g.zoomer.get("markerFontsize"),t=document.createElement("span"),r=0,e=this.g.zoomer.get("columnWidth"),o=this.model.getMaxLength(),a=this.g.zoomer.get("stepSize"),n=this.g.columns.get("hidden");o>r;)n.indexOf(r)>=0?(this.markerHidden(s,r,a),r+=a):(s=document.createElement("span"),s.style.width=e*a+"px",s.style.display="inline-block",s.textContent=(r+1)%this.g.zoomer.get("markerStepSize")===0?r+1:".",s.rowPos=r,r+=a,t.appendChild(s));return this.el.appendChild(t),this},markerHidden:function(e,t,n){var i,s,a,l,u,c,h,d,f,g,m;for(i=this.g.columns.get("hidden").slice(0),u=Math.max(0,t-n),h=!0,a=g=u;t>=g;a=g+=1)h&=i.indexOf(a)>=0;if(!h){for(c=this.model.getMaxLength(),l=0,s=-1,t=m=t;c>=m&&(s>=0||(s=i.indexOf(t)),i.indexOf(t)>=0);t=m+=1)l++;return d=o.base({height:10,width:10}),d.style.position="relative",f=o.polygon({points:"0,0 5,5 10,0",style:"fill:lime;stroke:purple;stroke-width:1"}),r(f).on("click",function(e){return function(){return i.splice(s,l),e.g.columns.set("hidden",i)}}(this)),d.appendChild(f),e.appendChild(d),d}},manageEvents:function(){var e;return e={},this.g.config.get("registerMouseClicks")&&(e.click="_onclick"),this.g.config.get("registerMouseHover")&&(e.mousein="_onmousein",e.mouseout="_onmouseout"),this.delegateEvents(e),this.listenTo(this.g.config,"change:registerMouseHover",this.manageEvents),this.listenTo(this.g.config,"change:registerMouseClick",this.manageEvents)},_onclick:function(e){var t,n;return t=e.target.rowPos,n=this.g.zoomer.get("stepSize"),this.g.trigger("column:click",{rowPos:t,stepSize:n,evt:e})},_onmousein:function(e){var t,n;return t=this.g.zoomer.get("stepSize"*e.rowPos),n=this.g.zoomer.get("stepSize"),this.g.trigger("column:mousein",{rowPos:t,stepSize:n,evt:e})},_onmouseout:function(e){var t,n;return t=this.g.zoomer.get("stepSize"*e.rowPos),n=this.g.zoomer.get("stepSize"),this.g.trigger("column:mouseout",{rowPos:t,stepSize:n,evt:e})}}),t.exports=n},{"../../utils/svg":95,"backbone-viewj":10,"dom-helper":49,jbone:50}],104:[function(e,t){var n,i;n=e("./LabelRowView"),i=e("backbone-childs"),t.exports=i.extend({initialize:function(e){return this.g=e.g,this.draw(),this.listenTo(this.g.zoomer,"change:_alignmentScrollTop",this._adjustScrollingTop),this.g.vis.once("change:loaded",this._adjustScrollingTop,this)},draw:function(){var e,t,i,r,o;for(this.removeViews(),o=[],e=i=0,r=this.model.length-1;r>=i;e=i+=1)this.model.at(e).get("hidden")||(t=new n({model:this.model.at(e),g:this.g}),t.ordering=e,o.push(this.addView("row_"+e,t)));return o},events:{scroll:"_sendScrollEvent"},_sendScrollEvent:function(){return this.g.zoomer.set("_alignmentScrollTop",this.el.scrollTop,{origin:"label"})},_adjustScrollingTop:function(){return this.el.scrollTop=this.g.zoomer.get("_alignmentScrollTop")},render:function(){return this.renderSubviews(),this.el.className="biojs_msa_labelblock",this.el.style.display="inline-block",this.el.style.verticalAlign="top",this.el.style.height=this.g.zoomer.get("alignmentHeight")+"px",this.el.style.overflowY="auto",this.el.style.overflowX="hidden",this.el.style.fontSize=""+this.g.zoomer.get("labelFontsize"),this.el.style.lineHeight=""+this.g.zoomer.get("labelLineHeight"),this}})},{"./LabelRowView":105,"backbone-childs":3}],105:[function(e,t){var n,i,r;r=e("backbone-childs"),n=e("./LabelView"),i=e("./MetaView"),t.exports=r.extend({initialize:function(e){return this.g=e.g,this.draw(),this.listenTo(this.g.vis,"change:labels",this.drawR),this.listenTo(this.g.vis,"change:metacell",this.drawR)},draw:function(){return this.removeViews(),this.g.vis.get("labels")&&this.addView("labels",new n({model:this.model,g:this.g})),this.g.vis.get("metacell")?this.addView("metacell",new i({model:this.model,g:this.g})):void 0},drawR:function(){return this.draw(),this.render()},render:function(){return this.renderSubviews(),this.el.setAttribute("class","biojs_msa_labelrow"),this.el.style.height=this.g.zoomer.get("rowHeight"),this}})},{"./LabelView":106,"./MetaView":107,"backbone-childs":3}],106:[function(e,t){var n,i,r;r=e("backbone-viewj"),i=e("dom-helper"),n=r.extend({initialize:function(e){return this.seq=e.seq,this.g=e.g,this.manageEvents()},manageEvents:function(){var e;return e={},this.g.config.get("registerMouseClicks")&&(e.click="_onclick"),this.g.config.get("registerMouseHover")&&(e.mousein="_onmousein",e.mouseout="_onmouseout"),this.delegateEvents(e),this.listenTo(this.g.config,"change:registerMouseHover",this.manageEvents),this.listenTo(this.g.config,"change:registerMouseClick",this.manageEvents),this.listenTo(this.g.vis,"change:labelName",this.render),this.listenTo(this.g.vis,"change:labelId",this.render),this.listenTo(this.g.vis,"change:labelPartition",this.render),this.listenTo(this.g.vis,"change:labelCheckbox",this.render)},render:function(){var e,t,n,r;return i.removeAllChilds(this.el),this.el.style.width=""+this.g.zoomer.get("labelWidth")+"px",this.el.style.height=""+this.g.zoomer.get("rowHeight")+"px",this.el.setAttribute("class","biojs_msa_labels"),this.g.vis.get("labelCheckbox")&&(e=document.createElement("input"),e.setAttribute("type","checkbox"),e.value=this.model.get("id"),e.name="seq",this.el.appendChild(e)),this.g.vis.get("labelId")&&(t=document.createElement("span"),t.textContent=this.model.get("id"),t.style.width=this.g.zoomer.get("labelIdLength"),t.style.display="inline-block",this.el.appendChild(t)),this.g.vis.get("labelPartition")&&(r=document.createElement("span"),r.style.width=15,r.textContent=this.model.get("partition"),r.style.display="inline-block",this.el.appendChild(t),this.el.appendChild(r)),this.g.vis.get("labelName")&&(n=document.createElement("span"),n.textContent=this.model.get("name"),this.el.appendChild(n)),this.el.style.overflow=scroll,this},_onclick:function(e){var t;return t=this.model.get("id"),this.g.trigger("row:click",{seqId:t,evt:e})},_onmousein:function(e){var t;return t=this.model.get("id"),this.g.trigger("row:mouseout",{seqId:t,evt:e})},_onmouseout:function(e){var t;return t=this.model.get("id"),this.g.trigger("row:mouseout",{seqId:t,evt:e})}}),t.exports=n},{"backbone-viewj":10,"dom-helper":49}],107:[function(e,t){var n,i,r,o,s;o=e("backbone-viewj"),n=e("../../menu/menubuilder"),s=e("underscore"),r=e("dom-helper"),t.exports=i=o.extend({className:"biojs_msa_metaview",initialize:function(e){return this.g=e.g},events:{click:"_onclick",mousein:"_onmousein",mouseout:"_onmouseout"},render:function(){var e,t,i,o,a,l,u;return r.removeAllChilds(this.el),this.el.style.display="inline-block",u=this.g.zoomer.get("metaWidth"),this.el.style.width=u-5,this.el.style.paddingRight=5,l=this.model.get("seq"),t=s.reduce(l,function(e,t){return"-"===t&&e++,e},0),t=(t/l.length).toFixed(1),e=document.createElement("span"),e.textContent=t,e.style.display="inline-block",e.style.width=35,this.el.appendChild(e),i=this.model.get("identity"),o=document.createElement("span"),o.textContent=i.toFixed(2),o.style.display="inline-block",o.style.width=40,this.el.appendChild(o),a=new n("↗"),a.addNode("Uniprot",function(){return function(){return window.open("http://beta.uniprot.org/uniprot/Q7T2N8")}}(this)),this.el.appendChild(a.buildDOM()),this.el.width=10,this.el.style.height=""+this.g.zoomer.get("rowHeight")+"px",this.el.style.cursor="pointer"},_onclick:function(e){return this.g.trigger("meta:click",{seqId:this.model.get("id",{evt:e})})},_onmousein:function(e){return this.g.trigger("meta:mousein",{seqId:this.model.get("id",{evt:e})})},_onmouseout:function(e){return this.g.trigger("meta:mouseout",{seqId:this.model.get("id",{evt:e})})}})},{"../../menu/menubuilder":75,"backbone-viewj":10,"dom-helper":49,underscore:59}],"biojs-io-clustal":[function(e,t){var n,i,r,o,s={}.hasOwnProperty,a=function(e,t){function n(){this.constructor=e}for(var i in t)s.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e};o=e("./strings"),i=e("./generic_reader"),r=e("./seq"),t.exports=n=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return a(t,e),t.parse=function(e){var t,n,i,s,a,l,u,c,h,d;if(h=[],a="[object Array]"===Object.prototype.toString.call(e)?e:e.split("\n"),a[0].slice(0,6)===!1)throw new Error("Invalid CLUSTAL Header");for(n=0,t=1,c=0;n=h.length?h.push(new r(d,i,c)):h[c].seq+=d,c++):console.log(s)):t=1:t=1;return h},t}(i)},{"./generic_reader":17,"./seq":18,"./strings":19}],"biojs-io-fasta":[function(e,t){t.exports.parse=e("./parser"),t.exports.writer=e("./writer")},{"./parser":21,"./writer":24}],"biojs-vis-msa":[function(e,t){"undefined"==typeof biojs&&(biojs={}),"undefined"==typeof biojs.vis&&(biojs.vis={}),window.msa=biojs.vis.msa=t.exports=e("./index"),"undefined"==typeof biojs.io&&(biojs.io={}),window.biojs.io.fasta=e("biojs-io-fasta"),window.biojs.io.clustal=e("biojs-io-clustal"),window.biojs.xhr=e("nets"),window.biojsVisMsa=window.msa,e("./build/msa.css")},{"./build/msa.css":1,"./index":2,"biojs-io-clustal":void 0,"biojs-io-fasta":void 0,nets:void 0}],nets:[function(e,t){function n(e,t,n){i(e,t,n)}var i=e("request");t.exports=n},{request:52}]},{},["biojs-vis-msa"]); \ No newline at end of file diff --git a/visualizations/biojs-msa/templates/biojs-msa.mako b/visualizations/biojs-msa/templates/biojs-msa.mako new file mode 100644 index 00000000000..4c257aba118 --- /dev/null +++ b/visualizations/biojs-msa/templates/biojs-msa.mako @@ -0,0 +1,74 @@ +<% + # based on scatterplot + + default_title = "BioJS MSA of '" + hda.name + "'" + info = hda.name + if hda.info: + info += ' : ' + hda.info + + # Use root for resource loading. + root = h.url_for( '/' ) +%> +## ---------------------------------------------------------------------------- + + + + + +${title or default_title} | ${visualization_display_name} +${h.javascript_link( root + 'plugins/visualizations/biojs-msa/static/msa.min.js' )} + + + +## ---------------------------------------------------------------------------- + +
+

${title or default_title}

+

${info}

+
+ +
+
+ + + + +