From c220f6d55a0fbf4854e18f3f9571a71c2ae8d63d Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Mon, 25 Oct 2021 17:15:14 -0400 Subject: [PATCH] The surgical in-place fix to prebuilt msa.js to account for 'at' being in array now in ff/chrome --- config/plugins/visualizations/msa/src/msa.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/plugins/visualizations/msa/src/msa.js b/config/plugins/visualizations/msa/src/msa.js index e44545e56d0..a29fb7f2614 100755 --- a/config/plugins/visualizations/msa/src/msa.js +++ b/config/plugins/visualizations/msa/src/msa.js @@ -10,7 +10,7 @@ Mn[Zt]=Mn[Jt]=Mn[Yt]=Mn[Qt]=Mn[te]=Mn[ee]=Mn[ne]=Mn[re]=Mn[ie]=!0,Mn[Ct]=Mn[Tt]= */ !function(o){function s(t){var e=t.length,n="undefined"==typeof t?"undefined":i(t);return!_(n)&&t!==o&&(!(1!==t.nodeType||!e)||b(n)||0===e||"number"==typeof e&&e>0&&e-1 in t)}function u(t,e){var n,r;this.originalEvent=t,r=function(t,e){"preventDefault"===t?this[t]=function(){return this.defaultPrevented=!0,e[t]()}:"stopImmediatePropagation"===t?this[t]=function(){return this.immediatePropagationStopped=!0,e[t]()}:_(e[t])?this[t]=function(){return e[t]()}:this[t]=e[t]};for(n in t)(t[n]||"function"==typeof t[n])&&r.call(this,n,t);x.extend(this,e,{isImmediatePropagationStopped:function(){return!!this.immediatePropagationStopped}})}var a,l=o.$,c=o.jBone,f=/^<(\w+)\s*\/?>$/,h=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,d=[].slice,p=[].splice,g=Object.keys,v=document,m=function(t){return"string"==typeof t},y=function(t){return t instanceof Object},_=function(t){return"[object Function]"==={}.toString.call(t)},b=function(t){return Array.isArray(t)},x=function(t,e){return new a.init(t,e)};x.noConflict=function(){return o.$=l,o.jBone=c,x},a=x.fn=x.prototype={init:function(t,e){var n,r,i,o;if(!t)return this;if(m(t)){if(r=f.exec(t))return this[0]=v.createElement(r[1]),this.length=1,y(e)&&this.attr(e),this;if((r=h.exec(t))&&r[1]){for(o=v.createDocumentFragment(),i=v.createElement("div"),i.innerHTML=t;i.lastChild;)o.appendChild(i.firstChild);return n=d.call(o.childNodes),x.merge(this,n)}if(x.isElement(e))return x(e).find(t);try{return n=v.querySelectorAll(t),x.merge(this,n)}catch(s){return this}}return t.nodeType?(this[0]=t,this.length=1,this):_(t)?t():t instanceof x?t:x.makeArray(t,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},a.constructor=x,a.init.prototype=a,x.setId=function(t){var e=t.jid;t===o?e="window":void 0===t.jid&&(t.jid=e=++x._cache.jid),x._cache.events[e]||(x._cache.events[e]={})},x.getData=function(t){t=t instanceof x?t[0]:t;var e=t===o?"window":t.jid;return{jid:e,events:x._cache.events[e]}},x.isElement=function(t){return t&&t instanceof x||t instanceof HTMLElement||m(t)},x._cache={events:{},jid:0},a.pushStack=function(t){return x.merge(this.constructor(),t)},x.merge=function(t,e){for(var n=e.length,r=t.length,i=0;i=e;)t.push(n--);return t}(),"break"):void(i=i.concat(function(){var t=[],e=n.attributes.xStart;if(n.attributes.xStart<=n.attributes.xEnd)for(;e<=n.attributes.xEnd;)t.push(e++);else for(;e>=n.attributes.xEnd;)t.push(e--);return t}()))},s=0;s=r.attributes.xEnd;)t.push(e--);return t}())},s=0;s=0)}),s=[],u=0;u=e.attributes.xEnd;)t.push(n--);return t}())},[]),n=(0,i.filter)(t,function(t){return!(e.indexOf(t)>=0)});if(0!==n.length){for(var o,s=[],u=n[0],a=u,l=0;l0||l.length>0)return t.collection.remove(t)})}});e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.xhr=e.seqs=e.parser=e.newick=e.matrix=e.gff=e.fasta=e.clustal=void 0;var i=n(61),o=r(i),s=n(62),u=r(s),a=n(63),l=r(a),c=n(65),f=r(c),h=n(67),d=r(h),p=n(11),g=r(p),v=n(24),m=r(v);e.clustal=o["default"],e.fasta=u["default"],e.gff=l["default"],e.matrix=f["default"],e.newick=d["default"],e.parser=g["default"],e.seqs=m["default"];var y=n(21);e.xhr=y;var _="imported";"undefined"!=typeof IO_VERSION&&(_=IO_VERSION),e.version=_},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i=n(21),o={};e["default"]=o,o.read=function(t,e){var n=function(t){return function(n,r,i){return o._onRetrieval(n,i,e,t)}}(this);return"undefined"==typeof e?new Promise(function(r,o){e=function(t,e){t?o(t):r(e)},i(t,n)}):i(t,n)},o._onRetrieval=function(t,e,n,r){var i=void 0;return"undefined"!=typeof t&&(i=r.parse(e)),n.call(r,t,i)},o.extend=function(t,e){return extend(o,t,e)},o.mixin=function(t){var e=["read"];return"object"!==("undefined"==typeof t?"undefined":r(t))&&(t=t.prototype),e.forEach(function(e){t[e]=o[e]},this),t}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="http://www.w3.org/2000/svg",r=function(t,e){for(var n in e){var r=e[n];t.setAttributeNS(null,n,r)}return t},i=function(t){var e=document.createElementNS(n,"svg");return e.setAttribute("width",t.width),e.setAttribute("height",t.height),e},o=function(t){return r(document.createElementNS(n,"rect"),t)},s=function(t){return r(document.createElementNS(n,"line"),t)},u=function(t){return r(document.createElementNS(n,"polygon"),t)};e.base=i,e.line=s,e.rect=o,e.polygon=u},function(t,e,n){"use strict";var r=n(71);r.onAll=function(t,e){return this.on("all",t,e),this},r.oldMixin=r.mixin,r.mixin=function(t){r.oldMixin(t);for(var e=["onAll"],n=0;ne){var r=[e,t];t=r[0],e=r[1]}return Math.floor(Math.random()*(e-t+1)+t)}},{key:"uniqueId",value:function(){for(var t=arguments.length<=0||void 0===arguments[0]?8:arguments[0],e="";e.length0){n=t.seqs.filter(function(t){return n.indexOf(t.get("id"))>=0});for(var i=n.length-1,o=0;0=i;0=r;0=0&&t.apply(e,arguments),o()}},o=function(){if(r++,r===e)return t.call(n)};return i}};e["default"]=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=function(t){return this.g=t.g,this},o={corsURL:function(t){return document.URL.indexOf("localhost")>=0&&"/"===t[0]?t:"."===t.charAt(0)||"/"===t.charAt(0)?t:(this.g.config.get("importProxyStripHttp")&&(t=t.replace("http://",""),t=t.replace("https://","")),t=this.g.config.get("importProxy")+t)}};(0,r.extend)(i.prototype,o),e["default"]=i},function(t,e){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,n){"use strict";function r(t,e){for(var n=0;n0&&(g=setTimeout(function(){p=!0,f.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",r(t)},t.timeout)),f.setRequestHeader)for(d in _)_.hasOwnProperty(d)&&f.setRequestHeader(d,_[d]);else if(t.headers&&!i(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(f.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(f),f.send(y),f}function a(t){if("document"===t.responseType)return t.responseXML;var e=204===t.status&&t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}function l(){}var c=n(147),f=n(52),h=n(150),d=n(151);t.exports=s,s.XMLHttpRequest=c.XMLHttpRequest||l,s.XDomainRequest="withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:c.XDomainRequest,r(["get","put","post","patch","head","delete"],function(t){s["delete"===t?"del":t]=function(e,n,r){return n=o(e,n,r),n.method=t.toUpperCase(),u(n)}})},function(t,e,n){"use strict";t.exports=n(56)},function(t,e,n){var r,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(s){"object"===o(e)?t.exports=s():(r=s,i="function"==typeof r?r.call(e,n,e,t):r,!(void 0!==i&&(t.exports=i)))}(function(){"use strict";var t={has:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},extend:function(t){for(var e=1;e=1?(r=u.shift(),i=u.join(" ")):r=t,r){var a=r.split("|");for(e=a.pop(),s.en=e;0!=a.length;){var l=a.shift(),c=a.shift();o[l]=c}}else e=r;if(i){var f=i.split("=");if(f.length>1){var h,d;f.length-1,f.forEach(function(t){t=t.trim();var e,r=t.split(" ");r.length>1?(d=r.pop(),e=r.join(" ")):e=t,h?s[h.toLowerCase()]=e:n=e,h=d})}else n=f.shift()}var p={name:e,ids:o,details:s};return n&&(p.desc=n),p};var r={sp:{link:"http://www.uniprot.org/%s",name:"Uniprot"},tr:{link:"http://www.uniprot.org/%s",name:"Trembl"},gb:{link:"http://www.ncbi.nlm.nih.gov/nuccore/%s",name:"Genbank"},pdb:{link:"http://www.rcsb.org/pdb/explore/explore.do?structureId=%s",name:"PDB"}};n.buildLinks=function(t){var e={};return t=t||{},Object.keys(t).forEach(function(n){if(n in r){var i=r[n],o=i.link.replace("%s",t[n]);e[i.name]=o}}),e},n.contains=function(t,e){return"".indexOf.call(t,e,0)!==-1},n.splitNChars=function(t,e){var n,r;e=e||80;var i=[];for(n=0,r=t.length-1;n<=r;n+=e)i.push(t.substr(n,e));return i},n.reverse=function(t){return t.split("").reverse().join("")},n.complement=function(t){var e=t+"",n=[[/g/g,"0"],[/c/g,"1"],[/0/g,"c"],[/1/g,"g"],[/G/g,"0"],[/C/g,"1"],[/0/g,"C"],[/1/g,"G"],[/a/g,"0"],[/t/g,"1"],[/0/g,"t"],[/1/g,"a"],[/A/g,"0"],[/T/g,"1"],[/0/g,"T"],[/1/g,"A"]];for(var r in n)e=e.replace(n[r][0],n[r][1]);return e},n.reverseComplement=function(t){return n.reverse(n.complement(t))},n.model=function(t,e,n){this.seq=t,this.name=e,this.id=n,this.ids={}}},function(t,e,n){"use strict";var r,i=n(1).Model;n(90),t.exports=r=i.extend({constructor:function(t,e){return this.g=e.g,i.apply(this,arguments),this},defaults:{currentSize:5,step:1,originalSize:!1,scaleCategories:[{columnWidth:1,markerStepSize:20,stepSize:0},{columnWidth:3,markerStepSize:20,stepSize:0},{columnWidth:5,markerStepSize:10,stepSize:0},{columnWidth:9,markerStepSize:5,stepSize:1},{columnWidth:15,markerStepSize:2,stepSize:1},{columnWidth:20,markerStepSize:1,stepSize:1},{columnWidth:30,markerStepSize:1,stepSize:1},{columnWidth:45,markerStepSize:1,stepSize:1}]},initialize:function(t){var e=this.get("scaleCategories"),n=this.g.zoomer.get("columnWidth")||this._getScaleInfo().columnWidth,r=_.find(e,{columnWidth:n});if(!r){var i=this._insertScaleCategory(n);r=e[i],this.set("currentSize",i+1)}var o=this.get("currentSize");return this.set("originalSize",o),this.setSize(o),this},_insertScaleCategory:function(t){var e=this.get("scaleCategories"),n=_.findLastIndex(e,function(e){return e.columnWidthe[1]?e[1]:t,this.set("currentSize",t);var n=this._getScaleInfo();return this.g.zoomer.set({columnWidth:n.columnWidth,stepSize:n.stepSize,markerStepSize:n.markerStepSize}),this},getSize:function(){return this.get("currentSize")},_getScaleInfo:function(){var t=this.getSize(),e=this.get("scaleCategories");return t>0&&t<=e.length?e[t-1]:void console.error("out of bounds")}})},function(t,e,n){"use strict";var r,i=n(99),o=n(1).Model;t.exports=r=o.extend({defaults:{scheme:"taylor",colorBackground:!0,showLowerCase:!0,opacity:.6},initialize:function(t,e,n){return this.colors=new i({seqs:e,conservation:function(){return n.scale(n.conservation())}}),n.on("reset",function(){if("dyn"===this.getSelectedScheme().type){var t;if(t="reset",this.getSelectedScheme().indexOf(t)>=0)return this.getSelectedScheme().reset()}},this)},addStaticScheme:function(t,e){return this.colors.addStaticScheme(t,e)},addDynScheme:function(t,e){return this.colors.addDynScheme(t,e)},getScheme:function(t){return this.colors.getScheme(t)},getSelectedScheme:function(){return this.colors.getScheme(this.get("scheme"))}})},function(t,e,n){"use strict";var r,i=n(1).Model;t.exports=r=i.extend({initialize:function(t,e){return null==this.get("hidden")&&this.set("hidden",[]),this.stats=e},calcHiddenColumns:function(t){for(var e,n=this.get("hidden"),r=t,i=0;i0){var e=t.at(0),n=e.get("ids");if(void 0!==n&&0===Object.keys(n).length)return this.defaults.metaLinks=!1}}})},function(t,e,n){"use strict";var r,i=n(1).Model;t.exports=r=i.extend({constructor:function(t,e){return this.calcDefaults(e.model),i.apply(this,arguments),this.g=e.g,this.listenTo(this,"change:labelIdLength change:labelNameLength change:labelPartLength change:labelCheckLength",function(){return this.trigger("change:labelWidth",this.getLabelWidth())},this),this.listenTo(this,"change:metaLinksWidth change:metaIdentWidth change:metaGapWidth",function(){return this.trigger("change:metaWidth",this.getMetaWidth())},this),this},defaults:{alignmentWidth:"auto",alignmentHeight:225,columnWidth:15,rowHeight:15,autoResize:!0,labelIdLength:20,labelNameLength:100,labelPartLength:15,labelCheckLength:15,labelFontsize:13,labelLineHeight:"13px",markerFontsize:"10px",stepSize:1,markerStepSize:2,markerHeight:20,residueFont:"13",canvasEventScale:1,minLetterDrawSize:11,boxRectHeight:2,boxRectWidth:2,overviewboxPaddingTop:10,metaGapWidth:35,metaIdentWidth:40,_alignmentScrollLeft:0,_alignmentScrollTop:0},calcDefaults:function(t){return t.getMaxLength()<200&&t.length<30&&(this.defaults.boxRectWidth=this.defaults.boxRectHeight=5),this},getAlignmentWidth:function(t){return this.get("autoResize")&&void 0!==t?this.get("columnWidth")*t:void 0===this.get("alignmentWidth")||"auto"===this.get("alignmentWidth")||0===this.get("alignmentWidth")?this._adjustWidth():this.get("alignmentWidth")},setLeftOffset:function(t){var e=t;return e=Math.max(0,e),e-=this.g.columns.calcHiddenColumns(e),this.set("_alignmentScrollLeft",e*this.get("columnWidth"))},setTopOffset:function(t){for(var e=Math.max(0,t-1),n=0,r=0;0=e;00&&(e=Math.min(e,t)),this.set("alignmentHeight",e)},setEl:function(t,e){return this.el=t,this.model=e},_checkScrolling:function(t,e){var n=t[0],r=t[1];return this.set("_alignmentScrollLeft",n,e),this.set("_alignmentScrollTop",r,e)},getMaxAlignmentHeight:function(){var t=0;return this.model.each(function(e){return t+=e.attributes.height||1}),t*this.get("rowHeight")},getMaxAlignmentWidth:function(){return this.model.getMaxLength()*this.get("columnWidth")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(50),s=r(o),u=n(1).Collection,a=u.extend({model:s["default"],constructor:function(){return this.startOnCache=[],this.on("all",function(){return this.startOnCache=[]},this),u.apply(this,arguments)},startOn:function(t){return null==this.startOnCache[t]&&(this.startOnCache[t]=this.where({xStart:t})),this.startOnCache[t]},contains:function(t){return this.reduce(function(e,n){return n||e.contains(t)},!1)},getFeatureOnRow:function(t,e){return this.filter(function(n){return n.get("row")===t&&n.get("xStart")<=e&&e<=n.get("xEnd")})},assignRows:function(){var t=this.max(function(t){return t.get("xEnd")}).attributes.xEnd,e=function(){for(var e=[],n=0;0=t;0=i;rn&&(n=e[o]),e[o]++;return t.set("row",n)}),(0,i.max)(e)},getCurrentHeight:function(){return this.max(function(t){return t.get("row")}).attributes.row+1},getMinRows:function(){var t=this.max(function(t){return t.get("xEnd")}).attributes.xEnd,e=function(){for(var e=[],n=0;0=t;0=i;r=e;00)return this.at(0).set("ref",!0)},setRef:function(t){var e=this.get(t);return this.each(function(n){if(t.cid)return e.cid===n.cid?n.set("ref",!0):n.set("ref",!1)}),this.g.config.set("hasRef",!0),this.trigger("change:reference",t)}});e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(34),o=r(i),s=n(1).Model,u=s.extend({defaults:{name:"",id:"",seq:"",height:1,ref:!1},initialize:function(){if(this.set("grey",[]),null==this.get("features"))return this.set("features",new o["default"])}});e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.exporter=e.file=e.seqgen=e.proxy=e.bmath=void 0;var i=n(15),o=r(i),s=n(19),u=r(s),a=n(39),l=r(a),c=n(17),f=r(c),h=n(16),d=r(h);e.bmath=o["default"],e.proxy=u["default"],e.seqgen=l["default"],e.file=f["default"],e.exporter=d["default"]},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t,e){for(var n=e.name||e.url||"",r=n.split("."),i=r[r.length-1]||"",o=0;o"===t.substring(0,1)||"fasta"==e||"fa"==e)&&"fasta"},i=function(t,e){return("("===t.substring(0,1)||"nwk"==e)&&"newick"},o=function(t,e){if(t.length<=10)return!1;var n=t.split("\n");return n[0].indexOf("gff")>=0||e.indexOf("gff")>=0?"gff":n[0].indexOf("#")<0&&2===n[0].split("\t").length&&"gff"},s=[n,r,i,o]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(15),o=r(i),s=n(72).seq,u=n(48),a={_generateSequence:function(t){for(var e="",n=t-1,r=0;0=n;0=t;1=t;1=f;0=p;0=t;1=0&&o0?0:u-1;return arguments.length<3&&(i=n[s?s[a]:a],a+=t),e(n,r,i,s,a,u)}}function s(t){return function(e,n,r){n=j(n,r);for(var i=A(e),o=t>0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+u,s):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(g.call(r,s,u),S.isNaN),o>=0?o+s:-1;for(o=t>0?s:u-1;o>=0&&o=0&&e<=z};S.each=S.forEach=function(t,e,n){e=k(e,n);var r,i;if(C(t))for(r=0,i=t.length;r=0},S.invoke=function(t,e){var n=g.call(arguments,2),r=S.isFunction(e);return S.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},S.pluck=function(t,e){return S.map(t,S.property(e))},S.where=function(t,e){return S.filter(t,S.matcher(e))},S.findWhere=function(t,e){return S.find(t,S.matcher(e))},S.max=function(t,e,n){var r,i,o=-(1/0),s=-(1/0);if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;uo&&(o=r)}else e=j(e,n),S.each(t,function(t,n,r){i=e(t,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=t,s=i)});return o},S.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;ur||void 0===n)return 1;if(ne?(s&&(clearTimeout(s),s=null),u=l,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(a,c)),o}},S.debounce=function(t,e,n){var r,i,o,s,u,a=function l(){var a=S.now()-s;a=0?r=setTimeout(l,e-a):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=S.now();var l=n&&!r;return r||(r=setTimeout(a,e)),l&&(u=t.apply(o,i),o=i=null),u}},S.wrap=function(t,e){return S.partial(e,t)},S.negate=function(t){return function(){return!t.apply(this,arguments)}},S.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},S.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},S.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},S.once=S.partial(S.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];S.keys=function(t){if(!S.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)S.has(t,n)&&e.push(n);return L&&a(t,e),e},S.allKeys=function(t){if(!S.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&a(t,e),e},S.values=function(t){for(var e=S.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},P=S.invert(F),B=function(t){var e=function(e){return t[e]},n="(?:"+S.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};S.escape=B(F),S.unescape=B(P),S.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),S.isFunction(r)?r.call(t):r};var W=0;S.uniqueId=function(t){var e=++W+"";return t?t+e:e},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(t){return"\\"+H[t]};S.template=function(t,e,n){!e&&n&&(e=n),e=S.defaults({},e,S.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,u){return o+=t.slice(i,u).replace(U,V),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"), -e}),o+="';\n",e.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(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var a=function(t){return s.call(this,t,S)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},S.chain=function(t){var e=S(t);return e._chain=!0,e};var $=function(t,e){return t._chain?S(e).chain():e};S.mixin=function(t){S.each(S.functions(t),function(e){var n=S[e]=t[e];S.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),$(this,n.apply(S,t))}})},S.mixin(S),S.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=f[t];S.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],$(this,n)}}),S.each(["concat","join","slice"],function(t){var e=f[t];S.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}}),S.prototype.value=function(){return this._wrapped},S.prototype.valueOf=S.prototype.toJSON=S.prototype.value,S.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return S}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(void 0)},function(t,e){"use strict";function n(t){var e={};return t.split(";").forEach(function(t){var n,r,i;t.indexOf("=")>0?(n=t.split("="),r=n[0],i=n[1],e[r]=i):t.indexOf(" ")>0&&(n=t.split(" "),r=n[0],i=n[1].replace(/"/g,""),e[r]=i)}),e}function r(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function i(t,e,n){return 3===t.length?i(t[0],t[1],t[2]):"#"+r(t)+r(e)+r(n)}Object.defineProperty(e,"__esModule",{value:!0}),e.extractKeys=n,e.rgbToHex=i,e["default"]={extractKeys:n,rgbToHex:i}},function(t,e){"use strict";t.exports=function(t,e,n){t.beginPath(),t.moveTo(0,e),t.lineTo(n,e),t.lineWidth=1,t.strokeStyle="#999999",t.stroke()}},function(t,e){"use strict";t.exports=function(t,e,n,r,i,o,s){t.font=o+"px Arial",t.textAlign=s?"right":"center",t.fillStyle="#666666",t.fillText(i,e+r/2,n)}},function(t,e){"use strict";t.exports=function(t,e,n,r,i){i=i||"#999999",t.beginPath(),t.moveTo(e,n),t.lineTo(e,n+r),t.lineWidth=1,t.strokeStyle=i,t.stroke()}},function(t,e){"use strict";var n;t.exports=n={rel:function(t){var e,n,r,i;return e=t.offsetX,n=t.offsetY,void 0==e&&(r=i.getBoundingClientRect(),i=t.target||t.srcElement,void 0==e&&(e=t.clientX-r.left,n=t.clientY-r.top),void 0==e&&(e=t.pageX-i.offsetLeft,n=t.pageY-i.offsetTop),void 0==e)?void console.log(t,"no mouse event defined. your browser sucks"):[e,n]},abs:function(t){var e,n;return e=t.pageX,n=t.pageY,void 0==e&&(e=t.layerX,n=t.layerY),void 0==e&&(e=t.clientX,n=t.clientY),void 0==e&&(e=t.x,n=t.y),[e,n]},wheelDelta:function(t){var e;return e=[t.deltaX,t.deltaY],void 0==e[0]&&t.mozMovementX&&(e=[0,t.mozMovementX]),isNaN(e[0])&&(e[0]=0),isNaN(e[1])&&(e[1]=0),e}}},function(t,e,n){"use strict";var r=n(110),i=function s(t,e){if(!this||this.constructor!==s)return new s(t);if(void 0===t||"string"==typeof t)throw new TypeError("you need to give the seq stat an array");this.resetSeqs(t),this.alphabetSize=4,this._useBackground=!1,this.useGaps=!1,this.ignoredChars=["-","*"],r.extend(this,e)};i.prototype.addSeq=function(t){this.seqs.push(t),this._reset()},i.prototype.removeSeq=function(t){"number"==typeof t?this.seqs.splice(t,1):r.each(this.seqs,function(e,n){t===e&&this.seqs.splice(n,1)}.bind(this)),this._reset()},i.prototype.addSeqs=function(t){t.forEach(function(t){this.addSeq(t)}.bind(this))},i.prototype.resetSeqs=function(t){if(this.seqs=[],!t instanceof Array||"at"in t){this.mseqs=t;var e=function(){var t=this.mseqs.pluck("seq");this.resetSeqs(t)};t.on("add change reset ",e,this),e.call(this)}else this.addSeqs(t),this._reset(),this.trigger("reset")};var o=["consensus","frequency","maxLength","ic","gaps"];i.prototype._reset=function(){for(var t=0;t=0||(void 0===e[r]&&(e[r]={}),void 0===e[r][t]&&(e[r][t]=0),e[r][t]++,void 0===n[r]&&(n[r]=0),n[r]++)})}),r.each(e,function(t,i){return r.each(t,function(t,r){return e[i][r]=t/n[i]})}),this._frequency=e,e},i.prototype.backgroundCalc=function(){var t={},e=0;return r.each(this.seqs,function(n){r.each(n,function(n){return void 0===t[n]&&(t[n]=0),t[n]++,e++})}),t=r.mapValues(t,function(t){return t/e}),this._background=t,t},i.prototype.icCalc=function(){var t=this.frequency();if(this._useBackground)var e=this.background();var n=this.ignoredChars,i=this._useBackground,o=r.map(t,function(t){return r.reduce(t,function(t,r,o){return n.indexOf(o)>=0?t:(i&&(r/=e[o]),t-r*(Math.log(r)/Math.log(2)))},0)});return this._ic=o,o},i.prototype.conservation=function(t){var e=this.ic(),n=this.gaps(),i=this;t=t||this.alphabetSize;var o=Math.log(t)/Math.log(2),s=0;return r.map(e,function(t){var e=o-t;return i.useGaps&&(e*=1-n[s++]),e})},i.prototype.conservResidue=function(t){var e,n=t?t.alphabetSize:void 0,i=this.ignoredChars;e=void 0!==t&&t.scaled?this.scale(this.conservation(n)):this.conservation(n);var o,s=this.frequency();return r.map(s,function(t,n){o=r.reject(r.keys(t),function(t){return i.indexOf(t)>=0});var s={};return r.each(o,function(r){s[r]=t[r]*e[n]}),s})},i.prototype.conservResidue2=function(t){var e=this.frequency(),n=this.conservation(t),i=this.background();return r.map(e,function(t,o){return r.map(t,function(t){var s=r.reduce(e[o],function(t,e){return t+e/i[o]},0);return t/i[o]/s*n[o]},0)})},i.prototype.scale=function(t,e){e=e||this.alphabetSize;var n=Math.log(e)/Math.log(2);return r.map(t,function(t){return t/n})},i.prototype.maxLengthCalc=function(){return 0===this.seqs.length?0:r.max(this.seqs,function(t){return t.length}).length},i.prototype.consensusCalc=function(){var t=new Array(this.maxLength());return r.each(this.seqs,function(e){r.each(e,function(e,n){void 0===t[n]&&(t[n]={}),void 0===t[n][e]&&(t[n][e]=0),t[n][e]++})}),this._consensus=r.reduce(t,function(t,e){var n;return n=r.keys(e),t+=r.max(n,function(t){return e[t]})},""),this._consensus},i.prototype.identityCalc=function(t){var e=t||this.consensus();return this._identity=this.seqs.map(function(t){for(var n=0,r=0,i=0;i=0&&o0?0:u-1;return arguments.length<3&&(i=n[s?s[a]:a],a+=t),e(n,r,i,s,a,u)}}function s(t){return function(e,n,r){n=j(n,r);for(var i=A(e),o=t>0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+u,s):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(g.call(r,s,u),S.isNaN),o>=0?o+s:-1;for(o=t>0?s:u-1;o>=0&&o=0&&e<=z};S.each=S.forEach=function(t,e,n){e=k(e,n);var r,i;if(C(t))for(r=0,i=t.length;r=0},S.invoke=function(t,e){var n=g.call(arguments,2),r=S.isFunction(e);return S.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},S.pluck=function(t,e){return S.map(t,S.property(e))},S.where=function(t,e){return S.filter(t,S.matcher(e))},S.findWhere=function(t,e){return S.find(t,S.matcher(e))},S.max=function(t,e,n){var r,i,o=-(1/0),s=-(1/0);if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;uo&&(o=r)}else e=j(e,n),S.each(t,function(t,n,r){i=e(t,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=t,s=i)});return o},S.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;ur||void 0===n)return 1;if(ne?(s&&(clearTimeout(s),s=null),u=l,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(a,c)),o}},S.debounce=function(t,e,n){var r,i,o,s,u,a=function l(){var a=S.now()-s;a=0?r=setTimeout(l,e-a):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=S.now();var l=n&&!r;return r||(r=setTimeout(a,e)),l&&(u=t.apply(o,i),o=i=null),u}},S.wrap=function(t,e){return S.partial(e,t)},S.negate=function(t){return function(){return!t.apply(this,arguments)}},S.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},S.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},S.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},S.once=S.partial(S.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];S.keys=function(t){if(!S.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)S.has(t,n)&&e.push(n);return L&&a(t,e),e},S.allKeys=function(t){if(!S.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&a(t,e),e},S.values=function(t){for(var e=S.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},P=S.invert(F),B=function(t){var e=function(e){return t[e]},n="(?:"+S.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};S.escape=B(F),S.unescape=B(P),S.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),S.isFunction(r)?r.call(t):r};var W=0;S.uniqueId=function(t){var e=++W+"";return t?t+e:e},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(t){return"\\"+H[t]};S.template=function(t,e,n){!e&&n&&(e=n),e=S.defaults({},e,S.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,u){return o+=t.slice(i,u).replace(U,V),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.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(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var a=function(t){return s.call(this,t,S)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},S.chain=function(t){var e=S(t);return e._chain=!0,e};var $=function(t,e){return t._chain?S(e).chain():e};S.mixin=function(t){S.each(S.functions(t),function(e){var n=S[e]=t[e];S.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),$(this,n.apply(S,t))}})},S.mixin(S),S.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=f[t];S.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],$(this,n)}}),S.each(["concat","join","slice"],function(t){var e=f[t];S.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}}),S.prototype.value=function(){return this._wrapped},S.prototype.valueOf=S.prototype.toJSON=S.prototype.value,S.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return S}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(void 0)},function(t,e,n){"use strict";var r=n(22),i=n(23),o=n(42),s=n(41),u=[],a=u.slice,l=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,o.extend({silent:!0},e))},c={add:!0,remove:!0,merge:!0},f={add:!0,remove:!1};o.extend(l.prototype,r,{model:s,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return Backbone.sync.apply(this,arguments)},add:function(t,e){return this.set(t,o.extend({merge:!1},e,f))},remove:function(t,e){var n=!o.isArray(t);t=n?[t]:o.clone(t),e||(e={});for(var r=0,i=t.length;r0&&(n=t.split(" "),r=n[0],i=n[1].replace(/"/g,""),e[r]=i)}),e}function r(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function i(t,e,n){return 3===t.length?i(t[0],t[1],t[2]):"#"+r(t)+r(e)+r(n)}Object.defineProperty(e,"__esModule",{value:!0}),e.extractKeys=n,e.rgbToHex=i,e["default"]={extractKeys:n,rgbToHex:i}},function(t,e){"use strict";t.exports=function(t,e,n){t.beginPath(),t.moveTo(0,e),t.lineTo(n,e),t.lineWidth=1,t.strokeStyle="#999999",t.stroke()}},function(t,e){"use strict";t.exports=function(t,e,n,r,i,o,s){t.font=o+"px Arial",t.textAlign=s?"right":"center",t.fillStyle="#666666",t.fillText(i,e+r/2,n)}},function(t,e){"use strict";t.exports=function(t,e,n,r,i){i=i||"#999999",t.beginPath(),t.moveTo(e,n),t.lineTo(e,n+r),t.lineWidth=1,t.strokeStyle=i,t.stroke()}},function(t,e){"use strict";var n;t.exports=n={rel:function(t){var e,n,r,i;return e=t.offsetX,n=t.offsetY,void 0==e&&(r=i.getBoundingClientRect(),i=t.target||t.srcElement,void 0==e&&(e=t.clientX-r.left,n=t.clientY-r.top),void 0==e&&(e=t.pageX-i.offsetLeft,n=t.pageY-i.offsetTop),void 0==e)?void console.log(t,"no mouse event defined. your browser sucks"):[e,n]},abs:function(t){var e,n;return e=t.pageX,n=t.pageY,void 0==e&&(e=t.layerX,n=t.layerY),void 0==e&&(e=t.clientX,n=t.clientY),void 0==e&&(e=t.x,n=t.y),[e,n]},wheelDelta:function(t){var e;return e=[t.deltaX,t.deltaY],void 0==e[0]&&t.mozMovementX&&(e=[0,t.mozMovementX]),isNaN(e[0])&&(e[0]=0),isNaN(e[1])&&(e[1]=0),e}}},function(t,e,n){"use strict";var r=n(110),i=function s(t,e){if(!this||this.constructor!==s)return new s(t);if(void 0===t||"string"==typeof t)throw new TypeError("you need to give the seq stat an array");this.resetSeqs(t),this.alphabetSize=4,this._useBackground=!1,this.useGaps=!1,this.ignoredChars=["-","*"],r.extend(this,e)};i.prototype.addSeq=function(t){this.seqs.push(t),this._reset()},i.prototype.removeSeq=function(t){"number"==typeof t?this.seqs.splice(t,1):r.each(this.seqs,function(e,n){t===e&&this.seqs.splice(n,1)}.bind(this)),this._reset()},i.prototype.addSeqs=function(t){t.forEach(function(t){this.addSeq(t)}.bind(this))},i.prototype.resetSeqs=function(t){if(this.seqs=[],!t instanceof Array||"_byId"in t){this.mseqs=t;var e=function(){var t=this.mseqs.pluck("seq");this.resetSeqs(t)};t.on("add change reset ",e,this),e.call(this)}else this.addSeqs(t),this._reset(),this.trigger("reset")};var o=["consensus","frequency","maxLength","ic","gaps"];i.prototype._reset=function(){for(var t=0;t=0||(void 0===e[r]&&(e[r]={}),void 0===e[r][t]&&(e[r][t]=0),e[r][t]++,void 0===n[r]&&(n[r]=0),n[r]++)})}),r.each(e,function(t,i){return r.each(t,function(t,r){return e[i][r]=t/n[i]})}),this._frequency=e,e},i.prototype.backgroundCalc=function(){var t={},e=0;return r.each(this.seqs,function(n){r.each(n,function(n){return void 0===t[n]&&(t[n]=0),t[n]++,e++})}),t=r.mapValues(t,function(t){return t/e}),this._background=t,t},i.prototype.icCalc=function(){var t=this.frequency();if(this._useBackground)var e=this.background();var n=this.ignoredChars,i=this._useBackground,o=r.map(t,function(t){return r.reduce(t,function(t,r,o){return n.indexOf(o)>=0?t:(i&&(r/=e[o]),t-r*(Math.log(r)/Math.log(2)))},0)});return this._ic=o,o},i.prototype.conservation=function(t){var e=this.ic(),n=this.gaps(),i=this;t=t||this.alphabetSize;var o=Math.log(t)/Math.log(2),s=0;return r.map(e,function(t){var e=o-t;return i.useGaps&&(e*=1-n[s++]),e})},i.prototype.conservResidue=function(t){var e,n=t?t.alphabetSize:void 0,i=this.ignoredChars;e=void 0!==t&&t.scaled?this.scale(this.conservation(n)):this.conservation(n);var o,s=this.frequency();return r.map(s,function(t,n){o=r.reject(r.keys(t),function(t){return i.indexOf(t)>=0});var s={};return r.each(o,function(r){s[r]=t[r]*e[n]}),s})},i.prototype.conservResidue2=function(t){var e=this.frequency(),n=this.conservation(t),i=this.background();return r.map(e,function(t,o){return r.map(t,function(t){var s=r.reduce(e[o],function(t,e){return t+e/i[o]},0);return t/i[o]/s*n[o]},0)})},i.prototype.scale=function(t,e){e=e||this.alphabetSize;var n=Math.log(e)/Math.log(2);return r.map(t,function(t){return t/n})},i.prototype.maxLengthCalc=function(){return 0===this.seqs.length?0:r.max(this.seqs,function(t){return t.length}).length},i.prototype.consensusCalc=function(){var t=new Array(this.maxLength());return r.each(this.seqs,function(e){r.each(e,function(e,n){void 0===t[n]&&(t[n]={}),void 0===t[n][e]&&(t[n][e]=0),t[n][e]++})}),this._consensus=r.reduce(t,function(t,e){var n;return n=r.keys(e),t+=r.max(n,function(t){return e[t]})},""),this._consensus},i.prototype.identityCalc=function(t){var e=t||this.consensus();return this._identity=this.seqs.map(function(t){for(var n=0,r=0,i=0;i=0&&o0?0:u-1;return arguments.length<3&&(i=n[s?s[a]:a],a+=t),e(n,r,i,s,a,u)}}function s(t){return function(e,n,r){n=j(n,r);for(var i=A(e),o=t>0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+u,s):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(g.call(r,s,u),S.isNaN),o>=0?o+s:-1;for(o=t>0?s:u-1;o>=0&&o=0&&e<=z};S.each=S.forEach=function(t,e,n){e=k(e,n);var r,i;if(C(t))for(r=0,i=t.length;r=0},S.invoke=function(t,e){var n=g.call(arguments,2),r=S.isFunction(e);return S.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},S.pluck=function(t,e){return S.map(t,S.property(e))},S.where=function(t,e){return S.filter(t,S.matcher(e))},S.findWhere=function(t,e){return S.find(t,S.matcher(e))},S.max=function(t,e,n){var r,i,o=-(1/0),s=-(1/0);if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;uo&&(o=r)}else e=j(e,n),S.each(t,function(t,n,r){i=e(t,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=t,s=i)});return o},S.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;ur||void 0===n)return 1;if(ne?(s&&(clearTimeout(s),s=null),u=l,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(a,c)),o}},S.debounce=function(t,e,n){var r,i,o,s,u,a=function l(){var a=S.now()-s;a=0?r=setTimeout(l,e-a):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=S.now();var l=n&&!r;return r||(r=setTimeout(a,e)),l&&(u=t.apply(o,i),o=i=null),u}},S.wrap=function(t,e){return S.partial(e,t)},S.negate=function(t){return function(){return!t.apply(this,arguments)}},S.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},S.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},S.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},S.once=S.partial(S.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];S.keys=function(t){if(!S.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)S.has(t,n)&&e.push(n);return L&&a(t,e),e},S.allKeys=function(t){if(!S.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&a(t,e),e},S.values=function(t){for(var e=S.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},P=S.invert(F),B=function(t){var e=function(e){return t[e]},n="(?:"+S.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};S.escape=B(F),S.unescape=B(P),S.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),S.isFunction(r)?r.call(t):r};var W=0;S.uniqueId=function(t){var e=++W+"";return t?t+e:e},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(t){return"\\"+H[t]};S.template=function(t,e,n){!e&&n&&(e=n),e=S.defaults({},e,S.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,u){return o+=t.slice(i,u).replace(U,V),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.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(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var a=function(t){return s.call(this,t,S)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},S.chain=function(t){var e=S(t);return e._chain=!0,e};var $=function(t,e){return t._chain?S(e).chain():e};S.mixin=function(t){S.each(S.functions(t),function(e){var n=S[e]=t[e];S.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),$(this,n.apply(S,t))}})},S.mixin(S),S.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=f[t];S.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],$(this,n)}}),S.each(["concat","join","slice"],function(t){var e=f[t];S.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}}),S.prototype.value=function(){return this._wrapped},S.prototype.valueOf=S.prototype.toJSON=S.prototype.value,S.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return S}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(void 0)},function(t,e,n){"use strict";var r=n(22),i=n(23),o=n(42),s=n(41),u=[],a=u.slice,l=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,o.extend({silent:!0},e))},c={add:!0,remove:!0,merge:!0},f={add:!0,remove:!1};o.extend(l.prototype,r,{model:s,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return Backbone.sync.apply(this,arguments)},add:function(t,e){return this.set(t,o.extend({merge:!1},e,f))},remove:function(t,e){var n=!o.isArray(t);t=n?[t]:o.clone(t),e||(e={});for(var r=0,i=t.length;r=0&&o0?0:u-1;return arguments.length<3&&(i=n[s?s[a]:a],a+=t),e(n,r,i,s,a,u)}}function s(t){return function(e,n,r){n=j(n,r);for(var i=A(e),o=t>0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+u,s):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(g.call(r,s,u),S.isNaN),o>=0?o+s:-1;for(o=t>0?s:u-1;o>=0&&o=0&&e<=z};S.each=S.forEach=function(t,e,n){e=k(e,n);var r,i;if(C(t))for(r=0,i=t.length;r=0},S.invoke=function(t,e){var n=g.call(arguments,2),r=S.isFunction(e);return S.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},S.pluck=function(t,e){return S.map(t,S.property(e))},S.where=function(t,e){return S.filter(t,S.matcher(e))},S.findWhere=function(t,e){return S.find(t,S.matcher(e))},S.max=function(t,e,n){var r,i,o=-(1/0),s=-(1/0);if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;uo&&(o=r)}else e=j(e,n),S.each(t,function(t,n,r){i=e(t,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=t,s=i)});return o},S.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;ur||void 0===n)return 1;if(ne?(s&&(clearTimeout(s),s=null),u=l,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(a,c)),o}},S.debounce=function(t,e,n){var r,i,o,s,u,a=function l(){var a=S.now()-s;a=0?r=setTimeout(l,e-a):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=S.now();var l=n&&!r;return r||(r=setTimeout(a,e)),l&&(u=t.apply(o,i),o=i=null),u}},S.wrap=function(t,e){return S.partial(e,t)},S.negate=function(t){return function(){return!t.apply(this,arguments)}},S.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},S.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},S.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},S.once=S.partial(S.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];S.keys=function(t){if(!S.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)S.has(t,n)&&e.push(n);return L&&a(t,e),e},S.allKeys=function(t){if(!S.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&a(t,e),e},S.values=function(t){for(var e=S.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},P=S.invert(F),B=function(t){var e=function(e){return t[e]},n="(?:"+S.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};S.escape=B(F),S.unescape=B(P),S.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),S.isFunction(r)?r.call(t):r};var W=0;S.uniqueId=function(t){var e=++W+"";return t?t+e:e},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(t){return"\\"+H[t]};S.template=function(t,e,n){!e&&n&&(e=n),e=S.defaults({},e,S.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,u){return o+=t.slice(i,u).replace(U,V),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.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(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var a=function(t){return s.call(this,t,S)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},S.chain=function(t){var e=S(t);return e._chain=!0,e};var $=function(t,e){return t._chain?S(e).chain():e};S.mixin=function(t){S.each(S.functions(t),function(e){var n=S[e]=t[e];S.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),$(this,n.apply(S,t))}})},S.mixin(S),S.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=f[t];S.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],$(this,n)}}),S.each(["concat","join","slice"],function(t){var e=f[t];S.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}}),S.prototype.value=function(){return this._wrapped},S.prototype.valueOf=S.prototype.toJSON=S.prototype.value,S.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return S}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(void 0)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),o=r(i),s=n(24),u=r(s),a=void 0;e["default"]=a={parse:function(t){var e=[];if("[object Array]"===Object.prototype.toString.call(t))var n=t;else var n=t.split("\n");if(n[0].slice(0,6)===!1)throw new Error("Invalid CLUSTAL Header");for(var r=0,i=1,o=0;r=e.length){var h=u["default"].getMeta(c.trim());c=h.name;var d=new u["default"].model(f,c,o);d.ids=h.ids||{},d.details=h.details||{};var p=Object.keys(d.ids);p.length>0&&(d.id=d.ids[p[0]]),e.push(d)}else e[o].seq+=f;o++}else console.log("parse error",s)}}else i=1;else i=1}return e}},o["default"].mixin(a)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(24),o=r(i),s=n(69),u=r(s),a=n(11),l=r(a),c=void 0;e["default"]=c={getMeta:o["default"].getMeta,extend:function(t){var e=(0,u["default"])(c);return c.getMeta=t,e},parse:function(t){var e=[];if(!t||0===t.length)return[];"[object Array]"!==Object.prototype.toString.call(t)&&(t=t.split("\n"));for(var n=c,r=n.getMeta,i=0;i"===s[0]||";"===s[0]){var u=s.slice(1).trim(),a=r(u.trim());u=a.name;var l=a.id||e.length,f=new o["default"].model("",a.name,l);f.ids=a.ids||{},f.details=a.details||{},e.push(f)}else f.seq+=s}return e},write:function(t,e){for(var n="",r=0;r"+i.name+"\n",n+=o["default"].splitNChars(i.seq,80).join("\n"),n+="\n"}return n}},l["default"].mixin(c)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),o=r(i),s=n(43),u=r(s),a=n(64),l=r(a),c=function(){};o["default"].mixin(c),e["default"]=c,c.parseLines=function(t){var e=t.split("\n"),n={},r=[];n.type=c._guessType(e);var i=0;if("jalview"===n.type){var o=l["default"].readHeader(e);i=o.offset,n.colors=o.colors,r=o.features}for(var s=i;s=0)break;var u=s.split(/\t/),a=u[0].trim();if("GFF"===a)break;if(2===u.length)if("startgroup"===a)e=u[1].trim();else{if("endgroup"===a){e="";continue}n[u[0]]=i.parseColor(u[1])}else if(u.length>=5){var l=i.parseLine(u);e&&(l.attributes.Parent=e),o.push(l)}}return{offset:r,colors:n,features:o}},i.parseColor=function(t){return t.indexOf(",")>=0?(0,r.rgbToHex)(t.split(",").map(function(t){return parseInt(t)})):6===t.length&&parseInt(t.charAt(0),16)<=16&&"bisque"!==t?"#"+t:t},i.parseLine=function(t){var e={attributes:{}};return e.attributes.Name=t[0].trim(),e.seqname=t[1].trim(),e.start=parseInt(t[3]),e.end=parseInt(t[4]),e.feature=t[5].trim(),"ID_NOT_SPECIFIED"===e.seqname&&(e.seqname=t[2].trim()),e}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(11),o=r(i),s=function u(t){return this.constructor!=u?new u(t):(this.matrix={},this.parsingOrder=[],void 0!=t&&this.parse(t),this)};o["default"].mixin(s),t.exports=s,s.prototype.parse=function(t){return t.split("\n").forEach(function(t){this.parseLine(t)}.bind(this)),this.buildMatrix(),this.matrix},s.read=function(t,e){return(new s).read(t,e)},s.parse=function(t){return(new s).parse(t)},s.prototype.parseLine=function(t){var e=t.charAt(0);if("#"!==e){this.parsingOrder.push(e);for(var n=t.substring(1),r=n.split(/\s+/).filter(function(t){return t.length>0}).map(function(t){return parseInt(t)}),i={},o=0;o=0;t--){var e=this.parsingOrder[t],n=this.matrix[e];for(var r in n)this.matrix[r][e]=n[r]}}},function(t,e){"use strict";function n(t){for(var e=[],n={},i=t.split(/\s*(;|\(|\)|\[|\]|,|:|=)\s*/),o=0;oo;i?s++:s--)r.push(s);return r}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t){t=t||{};for(var e=n(0,arguments.length,!1),r=0;r=0&&o0?0:u-1;return arguments.length<3&&(i=n[s?s[a]:a],a+=t),e(n,r,i,s,a,u)}}function s(t){return function(e,n,r){n=j(n,r);for(var i=A(e),o=t>0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+u,s):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(g.call(r,s,u),S.isNaN),o>=0?o+s:-1;for(o=t>0?s:u-1;o>=0&&o=0&&e<=z};S.each=S.forEach=function(t,e,n){e=k(e,n);var r,i;if(C(t))for(r=0,i=t.length;r=0},S.invoke=function(t,e){var n=g.call(arguments,2),r=S.isFunction(e);return S.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},S.pluck=function(t,e){return S.map(t,S.property(e))},S.where=function(t,e){return S.filter(t,S.matcher(e))},S.findWhere=function(t,e){return S.find(t,S.matcher(e))},S.max=function(t,e,n){var r,i,o=-(1/0),s=-(1/0);if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;uo&&(o=r)}else e=j(e,n),S.each(t,function(t,n,r){i=e(t,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=t,s=i)});return o},S.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;ur||void 0===n)return 1;if(ne?(s&&(clearTimeout(s),s=null),u=l,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(a,c)),o}},S.debounce=function(t,e,n){var r,i,o,s,u,a=function l(){var a=S.now()-s;a=0?r=setTimeout(l,e-a):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=S.now();var l=n&&!r;return r||(r=setTimeout(a,e)),l&&(u=t.apply(o,i),o=i=null),u}},S.wrap=function(t,e){return S.partial(e,t)},S.negate=function(t){return function(){return!t.apply(this,arguments)}},S.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},S.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},S.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},S.once=S.partial(S.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];S.keys=function(t){if(!S.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)S.has(t,n)&&e.push(n);return L&&a(t,e),e},S.allKeys=function(t){if(!S.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&a(t,e),e},S.values=function(t){for(var e=S.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},P=S.invert(F),B=function(t){var e=function(e){return t[e]},n="(?:"+S.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};S.escape=B(F),S.unescape=B(P),S.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),S.isFunction(r)?r.call(t):r};var W=0;S.uniqueId=function(t){var e=++W+"";return t?t+e:e},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(t){return"\\"+H[t]};S.template=function(t,e,n){!e&&n&&(e=n),e=S.defaults({},e,S.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,u){return o+=t.slice(i,u).replace(U,V),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.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(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var a=function(t){return s.call(this,t,S)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},S.chain=function(t){var e=S(t);return e._chain=!0,e};var $=function(t,e){return t._chain?S(e).chain():e};S.mixin=function(t){S.each(S.functions(t),function(e){var n=S[e]=t[e];S.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),$(this,n.apply(S,t))}})},S.mixin(S),S.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=f[t];S.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],$(this,n)}}),S.each(["concat","join","slice"],function(t){var e=f[t];S.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}}),S.prototype.value=function(){return this._wrapped},S.prototype.valueOf=S.prototype.toJSON=S.prototype.value,S.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return S}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(void 0)},function(t,e){"use strict";t.exports={render_x_axis_label:function(){var t="Model Position";this.display_ali_map&&(t="Alignment Column"),this.called_on.find(".logo_xaxis").remove(),this.called_on.prepend('

'+t+"

")},render_y_axis_label:function(){this.dom_element.parent().before('');var t=this.called_on.find(".logo_yaxis"),e=(Math.abs(this.data.max_height),isNaN(this.data.min_height_obs)?0:parseInt(this.data.min_height_obs,10),null),n="Information Content (bits)";e=t[0].getContext("2d"),e.beginPath(),e.moveTo(55,1),e.lineTo(40,1),e.moveTo(55,this.info_content_height),e.lineTo(40,this.info_content_height),e.moveTo(55,this.info_content_height/2),e.lineTo(40,this.info_content_height/2),e.lineWidth=1,e.strokeStyle="#666666",e.stroke(),e.fillStyle="#666666",e.textAlign="right",e.font="bold 10px Arial",e.textBaseline="top",e.fillText(parseFloat(this.data.max_height).toFixed(1),38,0),e.textBaseline="middle",e.fillText(parseFloat(this.data.max_height/2).toFixed(1),38,this.info_content_height/2),e.fillText("0",38,this.info_content_height),"score"===this.data.height_calc&&(n="Score (bits)"),e.save(),e.translate(5,this.height/2-20),e.rotate(-Math.PI/2),e.textAlign="center",e.font="normal 12px Arial",e.fillText(n,1,0),e.restore(),e.fillText("occupancy",55,this.info_content_height+7),this.show_inserts&&(e.fillText("ins. prob.",50,280),e.fillText("ins. len.",46,296))}}},function(t,e){"use strict";var n=null;t.exports=function(){if(!n){var t=document.createElement("canvas");n=!(!t.getContext||!t.getContext("2d"))}return n}},function(t,e){"use strict";t.exports={A:"#FF9966",C:"#009999",D:"#FF0000",E:"#CC0033",F:"#00FF00",G:"#f2f20c",H:"#660033",I:"#CC9933",K:"#663300",L:"#FF9933",M:"#CC99CC",N:"#336666",P:"#0099FF",Q:"#6666CC",R:"#990000",S:"#0000FF",T:"#00FFFF",V:"#FFCC33",W:"#66CC66",Y:"#006600"}},function(t,e){"use strict";t.exports={A:"#cbf751",C:"#5ec0cc",G:"#ffdf59",T:"#b51f16",U:"#b51f16"}},function(t,e,n){"use strict";var r=n(5);t.exports=function(t,e,n){t.find(".logo_settings_switch, .logo_settings .close").on("click",function(t){t.preventDefault(),r(".logo_settings").toggle()}),t.find(".logo_reset").on("click",function(t){t.preventDefault(),e.changeZoom({target:e.default_zoom})}),t.find(".logo_change").on("click",function(t){t.preventDefault()}),t.find(".logo_zoomin").on("click",function(t){t.preventDefault(),e.changeZoom({distance:.1,direction:"+"})}),t.find(".logo_zoomout").on("click",function(t){t.preventDefault(),e.changeZoom({distance:.1,direction:"-"})}),t.find(".logo_scale").on("change",function(t){e.toggleScale(this.value)}),t.find(".logo_color").on("change",function(t){e.toggleColorscheme(this.value)}),t.find(".logo_ali_map").on("change",function(t){e.toggleAliMap(this.value)}),t.find(".logo_position").on("change",function(){this.value.match(/^\d+$/m)&&e.scrollToColumn(this.value,1)}),n.on("dblclick",function(n){console.log("dblclick",e),offset=e.logo_graphic.offset(),x=parseInt(n.pageX-offset.left,10),window_position=n.pageX-t.parent().offset().left,col=e.columnFromCoordinates(x),console.log("col",col),current=e.zoom,current<1?e.changeZoom({target:1,offset:window_position,column:col}):e.changeZoom({target:.3,offset:window_position,column:col})}),r(document).on(t.attr("id")+".scrolledTo",function(t,n,r,i){e.render({target:n})}),r(document).on("keydown",function(t){t.ctrlKey||(61!==t.which&&107!==t.which||(zoom+=.1,e.changeZoom({distance:.1,direction:"+"})),109!==t.which&&0!==t.which||(zoom-=.1,e.changeZoom({distance:.1,direction:"-"})))})}},function(t,e,n){"use strict";_=n(75);var r=n(77),i=n(84),o=n(83),s=n(2),u=n(76),a=n(80),l=n(82),c=n(5);t.exports=s.extend({options:{xaxis:!0,yaxis:!0,height:300,column_width:34,debug:!0,scale_height_enabled:!0,scaled_max:!0,zoom_buttons:!0,colorscheme:"default",data:void 0,start:1,end:void 0,zoom:.4,colors:void 0,divider:!1,show_probs:!1,divider_step:5,show_divider:!1,border:!1,settings:!1,scroller:!0,positionMarker:!0},loadDefault:function(t){this.data=t.data,this.display_ali_map=0,this.alphabet=t.data.alphabet||"dna",this.start=t.start,this.zoom=parseFloat(t.zoom)||.4,this.default_zoom=this.zoom,this.column_width=t.column_width,this.height=t.height,this.canvas_width=5e3,this.scale_height_enabled=t.scale_height_enabled,this.scrollme=null,this.previous_target=0,this.rendered=[],this.previous_zoom=0,void 0==this.data.max_height&&(this.data.max_height=this.calcMaxHeight(this.data.heightArr)),this.data.insert_probs&&this.data.delete_probs||(this.options.show_probs=!1),t.scaled_max?this.data.max_height=t.data.max_height_obs||this.data.max_height||2:this.data.max_height=t.data.max_height_theory||this.data.max_height||2,t.colors?this.changeColors(t.colors):"aa"===this.alphabet?(this.aa_colors=n(78),this.changeColors(this.aa_colors)):(this.dna_colors=n(79),this.changeColors(this.dna_colors))},initialize:function(t){if(!r())return void(this.el.textContent="Your browser doesn't support canvas.");void 0==t.data&&(this.el.textContent="No data added."),_.extend(this.options,t);var e=this.options;if(this.loadDefault(e),this.options.show_probs?this.data.processing&&/^observed|weighted/.test(this.data.processing)?(this.show_inserts=0,this.info_content_height=this.height-14):(this.show_inserts=1,this.info_content_height=this.height-44):this.info_content_height=this.height,this.$el=c(this.el),this.initDivs(),this.options.settings){var n=l(this,e);this.$el.append(n)}a(this.$el,this,this.logo_graphic)},initDivs:function(){var t=f("div");t.className="logo_graphic",this.logo_graphic=c(t);var e=f("div");if(e.className="logo_container",e.style.height=this.height,this.container=c(e),this.container.append(t),this.$el.append(e),this.options.divider){var n=f("div");n.className="logo_divider",this.$el.append(n)}this.dom_element=c(t),this.called_on=this.$el,this.options.xaxis&&u.render_x_axis_label.call(this),this.options.yaxis?u.render_y_axis_label.call(this):this.container[0].style.marginLeft="0px"},render:function(){return i.call(this),this},changeColors:function(t){this.colors=t,void 0!=t&&void 0!=t.type&&(this.colorscheme="dynamic"),this.buildAlphabet()},buildAlphabet:function(){this.letters={};var t=this.colors;if("dynamic"==this.colorscheme){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");t={},e.forEach(function(e){t[e]=""})}for(var n in t)if(t.hasOwnProperty(n)){var r={color:t[n]};this.letters[n]=new o(n,r)}},toggleColorscheme:function(t){var e=this.currentColumn();t?"default"===t?this.colorscheme="default":this.colorscheme="consensus":"default"===this.colorscheme?this.colorscheme="consensus":this.colorscheme="default",this.rendered=[],this.scrollme.reflow(),this.scrollToColumn(e+1),this.scrollToColumn(e)},toggleScale:function(t){var e=this.currentColumn();t?"obs"===t?this.data.max_height=this.data.max_height_obs:this.data.max_height=this.data.max_height_theory:this.data.max_height===this.data.max_height_obs?this.data.max_height=this.data.max_height_theory:this.data.max_height=this.data.max_height_obs,this.rendered=[],this.logoYAxis&&this.logoYAxis.remove(),u.render_y_axis_label.call(this),this.scrollme.reflow(),this.scrollToColumn(e+1),this.scrollToColumn(e)},toggleAliMap:function(t){var e=this.currentColumn();t?"model"===t?this.display_ali_map=0:this.display_ali_map=1:1===this.display_ali_map?this.display_ali_map=0:this.display_ali_map=1,u.render_x_axis_label(this),this.rendered=[],this.scrollme.reflow(),this.scrollToColumn(e+1),this.scrollToColumn(e)},currentColumn:function(){var t=this.scrollme.scroller.getValues().left,e=this.column_width*this.zoom,n=t/e,r=this.container.width()/e/2;return Math.ceil(n+r)},changeZoom:function(t){var e=.3,n=null;if(t.target?e=t.target:t.distance&&(e=(parseFloat(this.zoom)-parseFloat(t.distance)).toFixed(1),"+"===t.direction&&(e=(parseFloat(this.zoom)+parseFloat(t.distance)).toFixed(1))),e>1?e=1:e<.1&&(e=.1),n=this.logo_graphic.width()*e/this.zoom,n>this.container.width())if(t.column){this.zoom=e,this.render({zoom:this.zoom}),this.scrollme.reflow();var r=this.coordinatesFromColumn(t.column);this.scrollme.scroller.scrollTo(r-t.offset)}else{var i=this.currentColumn();this.zoom=e,this.render({zoom:this.zoom}),this.scrollme.reflow(),this.scrollToColumn(i)}return this.zoom},columnFromCoordinates:function(t){return Math.ceil(t/(this.column_width*this.zoom))},coordinatesFromColumn:function(t){return(t-1)*(this.column_width*this.zoom)+this.column_width*this.zoom/2},scrollToColumn:function(t,e){var n=this.logo_container.width()/2,r=this.coordinatesFromColumn(t);this.scrollme.scroller.scrollTo(r-n,0,e)},calcMaxHeight:function(t){return t.reduce(function(t,e){var n=0;for(var r in e)n+=e[r];return n>t?n:t},0)}});var f=function(t){return document.createElement(t)}},function(t,e,n){"use strict";var r=n(5);t.exports=function(t,e){var n=r('
'),i=r('
');if(i.append('x'),t.scale_height_enabled&&t.data.max_height_obsMaximum Observed "+a+'
";if(i.append(l),"score"!==t.data.height_calc&&"aa"===t.data.alphabet&&t.data.probs_arr){var c=null,f=null,h="",d="";"default"===t.colorscheme?c="checked":f="checked",e.help&&(h='help',d='help');var p='
Color Scheme
";i.append(p)}if(t.data.ali_map){var g=null,v=null,m="",y="";0===t.display_ali_map?g="checked":v="checked",e.help&&(m='help',y='help');var _='
Coordinates
";i.append(_)}var b=r('
');return t.zoom_enabled&&b.append(''),i.children().length>0&&(b.append(''),b.append(i)),n.append(b),n}},function(t,e){"use strict";t.exports=function(t,e){e=e||{},this.value=t,this.width=parseInt(e.width,10)||100,"W"===this.value&&(this.width+=30*this.width/100),this.height=parseInt(e.height,10)||100,this.color=e.color||"#000000",this.fontSize=e.fontSize||138,this.scaled=function(){},this.draw=function(t,e,n,r,i,o){var s=e/this.height,u=n/this.width,a=t.font;t.transform(u,0,0,s,r,i),t.fillStyle=o||this.color,t.textAlign="center",t.font="bold "+this.fontSize+"px Arial",t.fillText(this.value,0,0),t.setTransform(1,0,0,1,0,0),t.fillStyle="#000000",t.font=a}}},function(t,e,n){"use strict";function r(t,e,n,r,i){var o=s(t).find("#canv_"+r);return o.length||(s(t).append(''), o=s(t).find("#canv_"+r)),s(o).attr("width",n).attr("height",e),o[0]}var i=n(86),o=n(85),s=n(5);t.exports=function(t){if(this.data){t=t||{};var e=t.zoom||this.zoom,n=t.target||1,s=(t.scaled||null,this.dom_element.parent().attr("width")),u=1,a=null,l=null,c=0;if(this.previous_target=n,t.start&&(this.start=t.start),t.end&&(this.end=t.end),e<=.1?e=.1:e>=1&&(e=1),this.zoom=e,a=this.end||this.data.heightArr.length,l=this.start||1,a=a>this.data.heightArr.length?this.data.heightArr.length:a,a=aa?a:l,l=l>1?l:1,this.y=this.height-20,this.max_width=this.column_width*(a-l+1),s>this.max_width&&(e=1,this.zoom_enabled=!1),this.zoom=e,this.zoomed_column=this.column_width*e,this.total_width=this.zoomed_column*(a-l+1),e<1)for(;this.total_width=1)););n>this.total_width&&(n=this.total_width),this.dom_element.attr({width:this.total_width+"px"}).css({width:this.total_width+"px"}),this.canvas_width=this.total_width;var f=Math.ceil(this.total_width/this.canvas_width);for(this.columns_per_canvas=Math.ceil(this.canvas_width/this.zoomed_column),this.previous_zoom!==this.zoom&&(this.dom_element.find("canvas").remove(),this.previous_zoom=this.zoom,this.rendered=[]),this.canvases=[],this.contexts=[],c=0;ca&&(d=a);var p=(d-h+1)*this.zoomed_column;p>u&&(u=p);var g=u*c,v=g+p;if(ng-g/2)if(this.canvases[c]=r(this.dom_element,this.height,p,c,u),this.contexts[c]=this.canvases[c].getContext("2d"),this.contexts[c].setTransform(1,0,0,1,0,0),this.contexts[c].clearRect(0,0,p,this.height),this.contexts[c].fillStyle="#ffffff",this.contexts[c].fillRect(0,0,v,this.height),this.zoomed_column>12){var m=parseInt(10*e,10);m=m>10?10:m,this.debug&&o.call(this,h,d,c,1),i.call(this,h,d,c,m)}else o.call(this,h,d,c)}!this.scrollme&&this.options.scroller&&(this.scrollme=new EasyScroller(this.dom_element[0],{scrollingX:1,scrollingY:0,eventTarget:this.called_on})),1!==n&&this.scrollme.reflow()}}},function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,u){var a="#ffffff";u?(i>.1?a="#d7301f":i>.05?a="#fc8d59":i>.03&&(a="#fdcc8a"),t.fillStyle=a,t.fillRect(e,n+15,r,10),a="#ffffff",o>9?a="#d7301f":o>7?a="#fc8d59":o>4&&(a="#fdcc8a"),t.fillStyle=a,t.fillRect(e,n+30,r,10)):n+=30,a="#ffffff",s<.75?a="#2171b5":s<.85?a="#6baed6":s<.95&&(a="#bdd7e7"),t.fillStyle=a,t.fillRect(e,n,r,10)}var i=n(44),o=n(46),s=n(45);t.exports=function(t,e,n,u){var a=0,l=t,c=null,f=0,h=Math.abs(this.data.max_height),d=Math.abs(this.data.min_height_obs),p=h+d,g=Math.round(100*Math.abs(this.data.max_height)/p),v=Math.round(this.info_content_height*g/100),m=(this.info_content_height-v,10);for(f=t;f<=e;f++){if(this.data.mmline&&1===this.data.mmline[f-1])this.contexts[n].fillStyle="#cccccc",this.contexts[n].fillRect(a,10,this.zoomed_column,this.height-40);else{var y=this.data.heightArr[f-1],_=0,b=(y.length,0);for(var b in y){var x=[b,y[b]];if(x[1]>.01){var w=parseFloat(x[1])/this.data.max_height,S=a,k=(this.info_content_height-2)*w,j=this.info_content_height-2-_-k,O=null;O="dynamic"===this.colorscheme?this.colors.getColor(x[0],{pos:f-1}):"consensus"===this.colorscheme?this.cmap[f-1][x[0]]||"#7a7a7a":this.colors[x[0]],u?(this.contexts[n].strokeStyle=O,this.contexts[n].strokeRect(S,j,this.zoomed_column,k)):(this.contexts[n].fillStyle=O,this.contexts[n].fillRect(S,j,this.zoomed_column,k)),_+=k}}}this.zoom<.2?m=20:this.zoom<.3&&(m=10),this.options.positionMarker&&f%m===0&&(this.options.show_probs&&o(this.contexts[n],a+this.zoomed_column,this.height-30,parseFloat(this.height),"#dddddd"),o(this.contexts[n],a+this.zoomed_column,0,5),c=this.display_ali_map?this.data.ali_map[f-1]:l,s(this.contexts[n],a-2,10,this.zoomed_column,c,10,!0)),this.options.show_probs&&r(this.contexts[n],a,this.height-42,this.zoomed_column,this.data.insert_probs[f-1],this.data.insert_lengths[f-1],this.data.delete_probs[f-1],this.show_inserts),this.options.show_probs&&(this.show_inserts?i(this.contexts[n],this.height-45,this.total_width):i(this.contexts[n],this.height-15,this.total_width)),this.options.border&&i(this.contexts[n],0,this.total_width),a+=this.zoomed_column,l++}}},function(t,e,n){"use strict";function r(t,e,n,r,o,s,u){var a=n-4,l="#ffffff",c="#555555";u&&(a=n-35),o<.75?(l="#2171b5",c="#ffffff"):o<.85?l="#6baed6":o<.95&&(l="#bdd7e7"),i(t,e,a,o,s,r,l,c)}function i(t,e,n,r,i,o,s,u){t.font=i+"px Arial",t.fillStyle=s,t.fillRect(e,n-10,o,14),t.textAlign="center",t.fillStyle=u,t.fillText(r,e+o/2,n)}function o(t,e){var n=e.ralign?e.x+t.zoomed_column:e.x,r=e.ralign?e.x+2:e.x;l(t.contexts[e.context_num],n,t.height-30,-30-t.height,"#dddddd"),l(t.contexts[e.context_num],n,0,5),c(t.contexts[e.context_num],r,10,t.zoomed_column,e.column_num,e.fontsize,e.ralign)}function s(t,e,n,r,o,s){var u=n-20,a="#ffffff",c="#555555";o>.1?(a="#d7301f",c="#ffffff"):o>.05?a="#fc8d59":o>.03&&(a="#fdcc8a"),i(t,e,u,o,s,r,a,c),o>.03&&l(t,e+r,n-30,-30-n,a)}function u(t,e,n,r,o,s){var u="#ffffff",a="#555555";o>9?(u="#d7301f",a="#ffffff"):o>7?u="#fc8d59":o>4&&(u="#fdcc8a"),i(t,e,n,o,s,r,u,a)}var a=n(44),l=n(46),c=n(45);t.exports=function(t,e,n,i){var c=0,f=t,h=null,d=0,p=Math.abs(this.data.max_height),g=isNaN(this.data.min_height_obs)?0:parseInt(this.data.min_height_obs,10),v=p+Math.abs(g),m=Math.round(100*Math.abs(this.data.max_height)/v),y=Math.round(this.info_content_height*m/100),_=this.info_content_height-y;for(y/this.info_content_height,_/this.info_content_height,e+3<=this.end&&(e+=3),d=t;d<=e;d++){if(this.data.mmline&&1===this.data.mmline[d-1])this.contexts[n].fillStyle="#cccccc",this.contexts[n].fillRect(c,10,this.zoomed_column,this.height-40);else{var b=this.data.heightArr[d-1],x=[];if(b){var w=0,S=(b.length,0),k=null;for(var S in b){var j=b[S],O=[S,j],E=c+this.zoomed_column/2,M=null;if(O[1]>.01){M=parseFloat(O[1])/this.data.max_height;var z=this.info_content_height-2-w,A=(this.info_content_height-2)*M;x[S]=[A,this.zoomed_column,E,z],w+=A}}for(var S in b)x[S]&&this.letters[S]&&(k="dynamic"===this.colorscheme?this.colors.getColor(S,{pos:d-1}):"consensus"===this.colorscheme?this.cmap[d-1][S]||"#7a7a7a":null,this.letters[S].draw(this.contexts[n],x[S][0],x[S][1],x[S][2],x[S][3],k))}}h=this.display_ali_map?this.data.ali_map[d-1]:f,this.options.show_divider&&(this.zoom<.7?d%this.options.divider_step===0&&o(this,{context_num:n,x:c,fontsize:10,column_num:h,ralign:!0}):o(this,{context_num:n,x:c,fontsize:i,column_num:h})),this.options.show_probs&&(r(this.contexts[n],c,this.height,this.zoomed_column,this.data.delete_probs[d-1],i,this.show_inserts),l(this.contexts[n],c,this.height-15,5),this.show_inserts&&(s(this.contexts[n],c,this.height,this.zoomed_column,this.data.insert_probs[d-1],i),u(this.contexts[n],c,this.height-5,this.zoomed_column,this.data.insert_lengths[d-1],i),l(this.contexts[n],c,this.height-45,5),l(this.contexts[n],c,this.height-30,5))),c+=this.zoomed_column,f++}this.options.show_probs&&(this.show_inserts&&(a(this.contexts[n],this.height-30,this.total_width),a(this.contexts[n],this.height-45,this.total_width)),a(this.contexts[n],this.height-15,this.total_width)),this.options.border&&a(this.contexts[n],0,this.total_width)}},function(t,e){"use strict";var n=window.HTMLCanvasElement&&window.HTMLCanvasElement.prototype,r=window.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),i=r&&window.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=(r||o)&&window.atob&&window.ArrayBuffer&&window.Uint8Array&&function(t){var e,n,s,u,a,l;for(e=t.split(",")[0].indexOf("base64")>=0?atob(t.split(",")[1]):decodeURIComponent(t.split(",")[1]),n=new ArrayBuffer(e.length),s=new Uint8Array(n),u=0;u