<commit_before>/*

 HMM logo
 http://github.com/url/here
 Copyright 2013, <NAME>.
 Licensed under the MIT License.
 http://url/to/license
*/
(function(e){function l(){if(!d){var a=document.createElement("canvas");d=!(!a.getContext||!a.getContext("2d"))}return d}function f(a,b){b=b||{};this.value=a;this.width=parseInt(b.width,10)||100;"W"===this.value&&(this.width+=30*this.width/100);this.height=parseInt(b.height,10)||100;this.color=b.color||"#000000";this.fontSize=b.fontSize||138;this.scaled=function(){};this.draw=function(a,b,d,c,p,w){var h=a.font;a.transform(d/this.width,0,0,b/this.height,c,p);a.fillStyle=w||this.color;a.textAlign="center";
a.font="bold "+this.fontSize+"px Arial";a.fillText(this.value,0,0);a.setTransform(1,0,0,1,0,0);a.fillStyle="#000000";a.font=h}}function B(){this.grey="#7a7a7a";this.check_PG=function(a,b,s){s[a].P="#ffff11";s[a].G="#ff7f11";return 1};this.check_R=function(a,b,s){s[a].R=this.grey;for(var d=["Q","K","R"],c=0,c=0;c<d.length;c++)if(b["0.85"][a]===d[c])return s[a].R="#FF9999",1;if("+"===b["0.60"][a]||"R"===b["0.60"][a]||"K"===b["0.60"][a])s[a].R="#FF9999";return 1};this.check_Q=function(a,b,s){s[a].Q=
this.grey;var d=["Q","T","K","R"],c=0;if("b"===b["0.50"][a]||"E"===b["0.50"][a]||"Q"===b["0.50"][a])return s[a].Q="#99FF99",1;for(c=0;c<d.length;c++)if(b["0.85"][a]===d[c])return s[a].Q="#99FF99",1;if("+"===b["0.60"][a]||"K"===b["0.60"][a]||"R"===b["0.50"][a])s[a].Q="#99FF99";return 1};this.check_N=function(a,b,s){s[a].N=this.grey;if("N"===b["0.50"][a])return s[a].N="#99FF99",1;"D"===b["0.85"][a]&&(s[a].N="#99FF99");return 1};this.check_K=function(a,b,s){s[a].K=this.grey;var d=["K","R","Q"],c=0;if("+"===
b["0.60"][a]||"R"===b["0.60"][a]||"K"===b["0.60"][a])return s[a].K="#FF9999",1;for(c=0;c<d.length;c++)if(b["0.85"][a]===d[c]){s[a].K="#FF9999";break}return 1};this.check_E=function(a,b,c){c[a].E=this.grey;var d=["D","E"],e=0;if("+"===b["0.60"][a]||"R"===b["0.60"][a]||"K"===b["0.60"][a])return c[a].E="#FF9999",1;for(e=0;e<d.length;e++)if(b["0.85"][a]===d[e])return c[a].E="#FF9999",1;if("b"===b["0.50"][a]||"E"===b["0.50"][a]||"Q"===b["0.50"][a])c[a].E="#FF9999";return 1};this.check_D=function(a,b,c){c[a].D=
this.grey;var d=["D","E","N"],e=0;if("+"===b["0.60"][a]||"R"===b["0.60"][a]||"K"===b["0.60"][a])return c[a].D="#FF9999",1;for(e=0;e<d.length;e++)if(b["0.85"][a]===d[e])return c[a].D="#FF9999",1;if("-"===b["0.50"][a]||"E"===b["0.60"][a]||"D"===b["0.60"][a])c[a].D="#FF9999";return 1};this.check_ACFILMVW=function(a,b,c){for(var d="ACFLIMVW".split(""),e="ACFHILMVWYPQh".split(""),f=0,p=0,f=0;f<d.length;f++)for(c[a][d[f]]=this.grey,p=0;p<e.length;p++)b["0.60"][a]===e[p]&&(c[a][d[f]]="#9999FF");return 1};
this.check_ST=function(a,b,c){c[a].S=this.grey;c[a].T=this.grey;var d="ACFHILMVWYPQ".split(""),e=0;if("a"===b["0.50"][a]||"S"===b["0.50"][a]||"T"===b["0.50"][a])return c[a].S="#99FF99",c[a].T="#99FF99",1;for(e=0;e<d.length;e++)if(b["0.85"][a]===d[e])return c[a].S="#99FF99",c[a].T="#99FF99",1};this.check_HY=function(a,b,c){c[a].H=this.grey;c[a].Y=this.grey;var d="ACFHILMVWYPQh".split(""),e=0;if("h"===b["0.60"][a])return c[a].H="#99FFFF",c[a].Y="#99FFFF",1;for(e=0;e<d.length;e++)if(b[0.85][a]===d[e]){c[a].H=
"#99FFFF";c[a].Y="#99FFFF";break}return 1};this.color_map=function(a){for(var b=["0.50","0.60","0.80","0.85"],c={W:1,L:1,V:1,I:1,M:1,A:1,F:1,C:1,Y:1,H:1,P:1},d={Q:1,N:1},e={K:1,R:1,H:1},f={S:1,T:1},p={E:1,D:1},w={},h=[],v=0,t=v=0,u=0,g=[],k=null,q={},A=u=null,v=0;v<a.length;v++)for(k=a[v],t=0;t<b.length;t++){A=b[t];q={p:0,o:0,"-":0,"+":0,h:0};for(u=0;u<k.length;u++)g=k[u].split(":"),q[g[0]]=parseFloat(g[1],10),d[g[0]]?q.p+=parseFloat(g[1],10):f[g[0]]?q.o+=parseFloat(g[1],10):p[g[0]]?q["-"]+=parseFloat(g[1],
10):(e[g[0]]&&(q["+"]+=parseFloat(g[1],10)),c[g[0]]&&(q.h+=parseFloat(g[1],10)));var u=A,g=".",r=0,y=null,l=null,E=null,x={".":20,h:11,"+":3,"-":2,o:2,p:2};for(y in q)q.hasOwnProperty(y)&&q[y]>=u&&(l=x[y]||1,E=x[g]||1,l<E?(g=y,r=q[y]):l===E&&q[y]>r&&(g=y,r=q[y]));u=g;w[A]||(w[A]=[]);w[A].push(u)}for(v=0;v<a.length;v++)h[v]={},this.check_D(v,w,h),this.check_R(v,w,h),this.check_Q(v,w,h),this.check_N(v,w,h),this.check_K(v,w,h),this.check_E(v,w,h),this.check_HY(v,w,h),this.check_ACFILMVW(v,w,h),this.check_ST(v,
w,h),this.check_PG(v,w,h);return h}}function c(a){function b(a,b,c){a.beginPath();a.moveTo(0,b);a.lineTo(c,b);a.lineWidth=1;a.strokeStyle="#999999";a.stroke()}function c(a,b,d,e,s){s=s||"#999999";a.beginPath();a.moveTo(b,d);a.lineTo(b,d+e);a.lineWidth=1;a.strokeStyle=s;a.stroke()}function d(a,b,c,e,s,u,g,k){a.font=s+"px Arial";a.fillStyle=g;a.fillRect(b,c-10,u,14);a.textAlign="center";a.fillStyle=k;a.fillText(e,b+u/2,c)}a=a||{};this.column_width=a.column_width||34;this.height=a.height||300;this.data=
a.data||null;this.debug=a.debug||null;this.scale_height_enabled=a.height_toggle||null;this.zoom_enabled=a.zoom_buttons&&"disabled"===a.zoom_buttons?null:!0;this.colorscheme=a.colorscheme||"default";this.display_ali_map=0;this.alphabet=a.data.alphabet||"dna";this.dom_element=a.dom_element||e("body");this.called_on=a.called_on||null;this.start=a.start||1;this.end=a.end||this.data.height_arr.length;this.default_zoom=this.zoom=parseFloat(a.zoom)||0.4;this.data.processing&&/^observed|weighted/.test(this.data.processing)?
(this.show_inserts=0,this.info_content_height=286):(this.show_inserts=1,this.info_content_height=256);this.data.max_height=a.scaled_max?a.data.max_height_obs||this.data.max_height||2:a.data.max_height_theory||this.data.max_height||2;this.dna_colors={A:"#cbf751",C:"#5ec0cc",G:"#ffdf59",T:"#b51f16",U:"#b51f16"};this.aa_colors={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"};this.colors=this.dna_colors;"aa"===this.alphabet&&(this.colors=this.aa_colors);this.canvas_width=5E3;var m=a=null,n=m=null;"aa"===this.alphabet&&(m=this.data.probs_arr)&&(n=new B,this.cmap=n.color_map(m));this.letters={};for(a in this.colors)this.colors.hasOwnProperty(a)&&(m={color:this.colors[a]},this.letters[a]=new f(a,m));this.scrollme=null;this.previous_target=0;this.rendered=[];this.previous_zoom=0;this.render=function(a){if(this.data){a=
a||{};var b=a.zoom||this.zoom,c=a.target||1,d=e(this.dom_element).parent().width(),s=1,u=null,g=null,k=0;if(c!==this.previous_target){this.previous_target=c;a.start&&(this.start=a.start);a.end&&(this.end=a.end);0.1>=b?b=0.1:1<=b&&(b=1);this.zoom=b;u=this.end||this.data.height_arr.length;g=this.start||1;u=u>this.data.height_arr.length?this.data.height_arr.length:u;u=u<g?g:u;g=g>u?u:g;g=1<g?g:1;this.y=this.height-20;this.max_width=this.column_width*(u-g+1);d>this.max_width&&(b=1,this.zoom_enabled=!1);
this.zoom=b;this.zoomed_column=this.column_width*b;this.total_width=this.zoomed_column*(u-g+1);if(1>b)for(;this.total_width<d&&!(this.zoom+=0.1,this.zoomed_column=this.column_width*this.zoom,this.total_width=this.zoomed_column*(u-g+1),this.zoom_enabled=!1,1<=b););c>this.total_width&&(c=this.total_width);e(this.dom_element).attr({width:this.total_width+"px"}).css({width:this.total_width+"px"});a=Math.ceil(this.total_width/this.canvas_width);this.columns_per_canvas=Math.ceil(this.canvas_width/this.zoomed_column);
this.previous_zoom!==this.zoom&&(e(this.dom_element).find("canvas").remove(),this.previous_zoom=this.zoom,this.rendered=[]);this.canvases=[];this.contexts=[];for(k=0;k<a;k++){var d=this.columns_per_canvas*k+g,q=d+this.columns_per_canvas-1;q>u&&(q=u);var f=(q-d+1)*this.zoomed_column;f>s&&(s=f);var r=s*k,y=r+f;if(c<y+y/2&&c>r-r/2&&1!==this.rendered[k]){var r=this.canvases,n=k,m=this.dom_element,z=this.height,B=f,D=k,F=s,C=e(m).find("#canv_"+D);C.length||(e(m).append('<canvas class="canvas_logo" id="canv_'+
D+'"  height="'+z+'" width="'+B+'" style="left:'+F*D+'px"></canvas>'),C=e(m).find("#canv_"+D));e(C).attr("width",B).attr("height",z);l()||(C[0]=G_vmlCanvasManager.initElement(C[0]));r[n]=C[0];this.contexts[k]=this.canvases[k].getContext("2d");this.contexts[k].setTransform(1,0,0,1,0,0);this.contexts[k].clearRect(0,0,f,this.height);this.contexts[k].fillStyle="#ffffff";this.contexts[k].fillRect(0,0,y,this.height);12<this.zoomed_column?(f=parseInt(10*b,10),f=10<f?10:f,this.debug&&this.render_with_rects(d,
q,k,1),this.render_with_text(d,q,k,f)):this.render_with_rects(d,q,k);this.rendered[k]=1}}!this.scrollme&&l()&&(this.scrollme=new EasyScroller(e(this.dom_element)[0],{scrollingX:1,scrollingY:0,eventTarget:this.called_on}));1!==c&&l()&&this.scrollme.reflow()}}};this.render_x_axis_label=function(){var a="Model Position";this.display_ali_map&&(a="Alignment Column");e(this.called_on).find(".logo_xaxis").remove();e(this.called_on).prepend('<div class="logo_xaxis" class="centered" style="margin-left:40px"><p class="xaxis_text" style="width:10em;margin:1em auto">'+
a+"</p></div>")};this.render_y_axis_label=function(){e(this.dom_element).parent().before('<canvas class="logo_yaxis" height="300" width="55"></canvas>');var a=e(this.called_on).find(".logo_yaxis");Math.abs(this.data.max_height);isNaN(this.data.min_height_obs)||parseInt(this.data.min_height_obs,10);var b=null,c="Information Content (bits)";l()||(a[0]=G_vmlCanvasManager.initElement(a[0]));b=a[0].getContext("2d");b.beginPath();b.moveTo(55,1);b.lineTo(40,1);b.moveTo(55,this.info_content_height);b.lineTo(40,
this.info_content_height);b.moveTo(55,this.info_content_height/2);b.lineTo(40,this.info_content_height/2);b.lineWidth=1;b.strokeStyle="#666666";b.stroke();b.fillStyle="#666666";b.textAlign="right";b.font="bold 10px Arial";b.textBaseline="top";b.fillText(parseFloat(this.data.max_height).toFixed(1),38,0);b.textBaseline="middle";b.fillText(parseFloat(this.data.max_height/2).toFixed(1),38,this.info_content_height/2);b.fillText("0",38,this.info_content_height);"score"===this.data.height_calc&&(c="Score (bits)");
b.save();b.translate(5,this.height/2-20);b.rotate(-Math.PI/2);b.textAlign="center";b.font="normal 12px Arial";b.fillText(c,1,0);b.restore();b.fillText("occupancy",55,this.info_content_height+7);this.show_inserts&&(b.fillText("ins. prob.",50,280),b.fillText("ins. len.",46,296))};this.render_x_axis_label();this.render_y_axis_label();this.render_with_text=function(a,e,h,f){var t=0,u=a,g=null,k=0,k=Math.abs(this.data.max_height),g=isNaN(this.data.min_height_obs)?0:parseInt(this.data.min_height_obs,10),
k=k+Math.abs(g),k=Math.round(100*Math.abs(this.data.max_height)/k);Math.round(this.info_content_height*k/100);e+3<=this.end&&(e+=3);for(k=a;k<=e;k++){if(this.data.mmline&&1===this.data.mmline[k-1])this.contexts[h].fillStyle="#cccccc",this.contexts[h].fillRect(t,10,this.zoomed_column,this.height-40);else if(a=this.data.height_arr[k-1],g=[],a){for(var q=0,A=a.length,r=0,y=null,r=0;r<A;r++){var m=a[r].split(":",2),y=t+this.zoomed_column/2,n=null;if(0.01<m[1]){var n=parseFloat(m[1])/this.data.max_height,
m=this.info_content_height-2-q,x=(this.info_content_height-2)*n;l()||(m+=x*(n/2));g[r]=[x,this.zoomed_column,y,m];q+=x}}for(r=A;0<=r;r--)g[r]&&this.letters[a[r][0]]&&(y="consensus"===this.colorscheme?this.cmap[k-1][a[r][0]]||"#7a7a7a":null,this.letters[a[r][0]].draw(this.contexts[h],g[r][0],g[r][1],g[r][2],g[r][3],y))}g=this.display_ali_map?this.data.ali_map[k-1]:u;0.7>this.zoom?0===k%5&&this.draw_column_divider({context_num:h,x:t,fontsize:10,column_num:g,ralign:!0}):this.draw_column_divider({context_num:h,
x:t,fontsize:f,column_num:g});a=this.height;g=this.data.delete_probs[k-1];q=a-4;A="#ffffff";r="#555555";this.show_inserts&&(q=a-35);0.75>g?(A="#2171b5",r="#ffffff"):0.85>g?A="#6baed6":0.95>g&&(A="#bdd7e7");d(this.contexts[h],t,q,g,f,this.zoomed_column,A,r);c(this.contexts[h],t,this.height-15,5);this.show_inserts&&(a=this.contexts[h],g=t,q=this.height,A=this.zoomed_column,r=this.data.insert_probs[k-1],y=q-20,n="#ffffff",m="#555555",0.1<r?(n="#d7301f",m="#ffffff"):0.05<r?n="#fc8d59":0.03<r&&(n="#fdcc8a"),
d(a,g,y,r,f,A,n,m),0.03<r&&c(a,g+A,q-30,-30-q,n),a=this.data.insert_lengths[k-1],g="#ffffff",q="#555555",9<a?(g="#d7301f",q="#ffffff"):7<a?g="#fc8d59":4<a&&(g="#fdcc8a"),d(this.contexts[h],t,this.height-5,a,f,this.zoomed_column,g,q),c(this.contexts[h],t,this.height-45,5),c(this.contexts[h],t,this.height-30,5));t+=this.zoomed_column;u++}this.show_inserts&&(b(this.contexts[h],this.height-30,this.total_width),b(this.contexts[h],this.height-45,this.total_width));b(this.contexts[h],this.height-15,this.total_width);
b(this.contexts[h],0,this.total_width)};this.draw_column_divider=function(a){var b=a.ralign?a.x+this.zoomed_column:a.x,d=a.ralign?a.x+2:a.x;c(this.contexts[a.context_num],b,this.height-30,-30-this.height,"#dddddd");c(this.contexts[a.context_num],b,0,5);var b=this.contexts[a.context_num],e=this.zoomed_column,t=a.column_num,f=a.ralign;b.font=a.fontsize+"px Arial";b.textAlign=f?"right":"center";b.fillStyle="#666666";b.fillText(t,d+e/2,10)};this.render_with_rects=function(a,d,e,f){var t=0,u=a,g=null,
k=0,k=Math.abs(this.data.max_height),q=Math.abs(this.data.min_height_obs),k=k+q,k=Math.round(100*Math.abs(this.data.max_height)/k);Math.round(this.info_content_height*k/100);q=10;for(k=a;k<=d;k++){if(this.data.mmline&&1===this.data.mmline[k-1])this.contexts[e].fillStyle="#cccccc",this.contexts[e].fillRect(t,10,this.zoomed_column,this.height-40);else{a=this.data.height_arr[k-1];for(var g=0,m=a.length,r=0,r=0;r<m;r++){var n=a[r].split(":",2);if(0.01<n[1]){var l=parseFloat(n[1])/this.data.max_height,
z=t,l=(this.info_content_height-2)*l,x=this.info_content_height-2-g-l;f?(this.contexts[e].strokeStyle=this.colors[n[0]],this.contexts[e].strokeRect(z,x,this.zoomed_column,l)):(this.contexts[e].fillStyle=this.colors[n[0]],this.contexts[e].fillRect(z,x,this.zoomed_column,l));g+=l}}}0.2>this.zoom?q=20:0.3>this.zoom&&(q=10);0===k%q&&(c(this.contexts[e],t+this.zoomed_column,this.height-30,parseFloat(this.height),"#dddddd"),c(this.contexts[e],t+this.zoomed_column,0,5),g=this.display_ali_map?this.data.ali_map[k-
1]:u,a=this.contexts[e],m=t-2,r=this.zoomed_column,a.font="10px Arial",a.textAlign="right",a.fillStyle="#666666",a.fillText(g,m+r/2,10));a=this.contexts[e];g=t;m=this.height-42;r=this.zoomed_column;n=this.data.insert_probs[k-1];z=this.data.insert_lengths[k-1];l=this.data.delete_probs[k-1];x="#ffffff";this.show_inserts?(0.1<n?x="#d7301f":0.05<n?x="#fc8d59":0.03<n&&(x="#fdcc8a"),a.fillStyle=x,a.fillRect(g,m+15,r,10),x="#ffffff",9<z?x="#d7301f":7<z?x="#fc8d59":4<z&&(x="#fdcc8a"),a.fillStyle=x,a.fillRect(g,
m+30,r,10)):m+=30;x="#ffffff";0.75>l?x="#2171b5":0.85>l?x="#6baed6":0.95>l&&(x="#bdd7e7");a.fillStyle=x;a.fillRect(g,m,r,10);this.show_inserts?b(this.contexts[e],this.height-45,this.total_width):b(this.contexts[e],this.height-15,this.total_width);b(this.contexts[e],0,this.total_width);t+=this.zoomed_column;u++}};this.toggle_colorscheme=function(a){var b=this.current_column();this.colorscheme=a?"default"===a?"default":"consensus":"default"===this.colorscheme?"consensus":"default";this.rendered=[];
this.scrollme.reflow();this.scrollToColumn(b+1);this.scrollToColumn(b)};this.toggle_scale=function(a){var b=this.current_column();this.data.max_height=a?"obs"===a?this.data.max_height_obs:this.data.max_height_theory:this.data.max_height===this.data.max_height_obs?this.data.max_height_theory:this.data.max_height_obs;this.rendered=[];e(this.called_on).find(".logo_yaxis").remove();this.render_y_axis_label();this.scrollme.reflow();this.scrollToColumn(b+1);this.scrollToColumn(b)};this.toggle_ali_map=function(a){var b=
this.current_column();this.display_ali_map=a?"model"===a?0:1:1===this.display_ali_map?0:1;this.render_x_axis_label();this.rendered=[];this.scrollme.reflow();this.scrollToColumn(b+1);this.scrollToColumn(b)};this.current_column=function(){var a=this.scrollme.scroller.getValues().left,b=this.column_width*this.zoom,a=a/b,b=e(this.called_on).find(".logo_container").width()/b/2;return Math.ceil(a+b)};this.change_zoom=function(a){var b=0.3,c=null;a.target?b=a.target:a.distance&&(b=(parseFloat(this.zoom)-
parseFloat(a.distance)).toFixed(1),"+"===a.direction&&(b=(parseFloat(this.zoom)+parseFloat(a.distance)).toFixed(1)));1<b?b=1:0.1>b&&(b=0.1);c=e(this.called_on).find(".logo_graphic").width()*b/this.zoom;c>e(this.called_on).find(".logo_container").width()&&(a.column?(this.zoom=b,this.render({zoom:this.zoom}),this.scrollme.reflow(),b=this.coordinatesFromColumn(a.column),this.scrollme.scroller.scrollTo(b-a.offset)):(a=this.current_column(),this.zoom=b,this.render({zoom:this.zoom}),this.scrollme.reflow(),
this.scrollToColumn(a)));return this.zoom};this.columnFromCoordinates=function(a){return Math.ceil(a/(this.column_width*this.zoom))};this.coordinatesFromColumn=function(a){return(a-1)*this.column_width*this.zoom+this.column_width*this.zoom/2};this.scrollToColumn=function(a,b){var c=e(this.called_on).find(".logo_container").width()/2,d=this.coordinatesFromColumn(a);this.scrollme.scroller.scrollTo(d-c,0,b)}}var d=null;e.fn.hmm_logo=function(a){var b=null,d=e('<div class="logo_graphic">');if(l()){a=
a||{};e(this).append(e('<div class="logo_container">').append(d).append('<div class="logo_divider">'));a.data=e(this).data("logo");if(null===a.data)return;a.dom_element=d;a.called_on=this;var f=e('<form class="logo_form"><fieldset><label for="position">Column number</label><input type="text" name="position" class="logo_position"></input><button class="button logo_change">Go</button></fieldset></form>'),m=e('<div class="logo_controls">'),n=e('<div class="logo_settings">');n.append('<span class="close">x</span>');
b=new c(a);b.render(a);b.zoom_enabled&&m.append('<button class="logo_zoomout button">-</button><button class="logo_zoomin button">+</button>');if(b.scale_height_enabled&&b.data.max_height_obs<b.data.max_height_theory){var p="",w="",h="",v="";b.data.max_height_obs===b.data.max_height?p="checked":w="checked";a.help&&(v='<a class="help" href="/help#scale_obs" title="Set the y-axis maximum to the maximum observed height."><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>',
h='<a class="help" href="/help#scale_theory" title="Set the y-axis maximum to the theoretical maximum height"><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>');n.append('<fieldset><legend>Scale</legend><label><input type="radio" name="scale" class="logo_scale" value="obs" '+p+"/>Maximum Observed "+v+'</label></br><label><input type="radio" name="scale" class="logo_scale" value="theory" '+w+"/>Maximum Theoretical "+h+"</label></fieldset>")}"score"!==b.data.height_calc&&
"aa"===b.data.alphabet&&b.data.probs_arr&&(w=p=null,v=h="","default"===b.colorscheme?p="checked":w="checked",a.help&&(h='<a class="help" href="/help#colors_default" title=""><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>',v='<a class="help" href="/help#colors_consensus" title=""><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>'),n.append('<fieldset><legend>Color Scheme</legend><label><input type="radio" name="color" class="logo_color" value="default" '+
p+"/>Default "+h+'</label></br><label><input type="radio" name="color" class="logo_color" value="consensus" '+w+"/>Consensus Colors "+v+"</label></fieldset>"));b.data.ali_map&&(w=p=null,v=h="",0===b.display_ali_map?p="checked":w="checked",a.help&&(h='<a class="help" href="/help#coords_model" title=""><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>',v='<a class="help" href="/help#coords_ali" title=""><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>'),
n.append('<fieldset><legend>Coordinates</legend><label><input type="radio" name="coords" class="logo_ali_map" value="model" '+p+"/>Model "+h+'</label></br><label><input type="radio" name="coords" class="logo_ali_map" value="alignment" '+w+"/>Alignment "+v+"</label></fieldset>"));0<n.children().length&&(m.append('<button class="logo_settings_switch button">Settings</button>'),m.append(n));f.append(m);e(this).append(f);e(this).find(".logo_settings_switch, .logo_settings .close").bind("click",function(a){a.preventDefault();
e(".logo_settings").toggle()});e(this).find(".logo_reset").bind("click",function(a){a.preventDefault();a=b;a.change_zoom({target:a.default_zoom})});e(this).find(".logo_change").bind("click",function(a){a.preventDefault()});e(this).find(".logo_zoomin").bind("click",function(a){a.preventDefault();b.change_zoom({distance:0.1,direction:"+"})});e(this).find(".logo_zoomout").bind("click",function(a){a.preventDefault();b.change_zoom({distance:0.1,direction:"-"})});e(this).find(".logo_scale").bind("change",
function(a){b.toggle_scale(this.value)});e(this).find(".logo_color").bind("change",function(a){b.toggle_colorscheme(this.value)});e(this).find(".logo_ali_map").bind("change",function(a){b.toggle_ali_map(this.value)});e(this).find(".logo_position").bind("change",function(){var a=b;this.value.match(/^\d+$/m)&&a.scrollToColumn(this.value,1)});d.bind("dblclick",function(a){var c=b,d=e(this).offset(),d=parseInt(a.pageX-d.left,10);a=a.pageX-e(this).parent().offset().left;d=c.columnFromCoordinates(d);1>
c.zoom?c.change_zoom({target:1,offset:a,column:d}):c.change_zoom({target:0.3,offset:a,column:d})});a.column_info&&d.bind("click",function(c){var d=b,s=e('<table class="logo_col_info"></table>'),f="<tr>",h="",m=e(this).offset();c=parseInt(c.pageX-m.left,10);e(this).parent().offset();d=d.columnFromCoordinates(c);c=[];var n=m=0,p=0,p="Probability";b.data.height_calc&&"score"===b.data.height_calc?(p="Score",c=b.data.height_arr[d-1].slice(0).reverse()):c=b.data.probs_arr[d-1].slice(0).reverse();m=Math.ceil(c.length/
5);for(n=0;n<m;n++)f=1<m&&n<m-1?f+('<th>Residue</th><th class="odd">'+p+"</th>"):f+("<th>Residue</th><th>"+p+"</th>");s.append(e(f+"</tr>"));for(n=0;5>n;n++){h+="<tr>";for(p=n;c[p];){var f=c[p].split(":",2),l="";"default"===b.colorscheme&&(l=b.alphabet+"_"+f[0]);h=1<m&&15>p?h+('<td class="'+l+'"><div></div>'+f[0]+'</td><td class="odd">'+f[1]+"</td>"):h+('<td class="'+l+'"><div></div>'+f[0]+"</td><td>"+f[1]+"</td>");p+=5}h+="</tr>"}s.append(e(h));e(a.column_info).empty().append(e("<p> Column:"+d+"</p><div><p>Occupancy: "+
b.data.delete_probs[d-1]+"</p><p>Insert Probability: "+b.data.insert_probs[d-1]+"</p><p>Insert Length: "+b.data.insert_lengths[d-1]+"</p></div>")).append(s).show()});e(document).bind(this.attr("id")+".scrolledTo",function(a,c,d,e){b.render({target:c})});e(document).keydown(function(a){a.ctrlKey||(61!==a.which&&107!==a.which||b.change_zoom({distance:0.1,direction:"+"}),109!==a.which&&0!==a.which||b.change_zoom({distance:0.1,direction:"-"}))})}else e("#logo").replaceWith(e("#no_canvas").html());return b}})(jQuery);/*

 Scroller
 http://github.com/zynga/scroller

 Copyright 2011, Zynga Inc.
 Licensed under the MIT License.
 https://raw.github.com/zynga/scroller/master/MIT-LICENSE.txt

 Based on the work of: Unify Project (unify-project.org)
 http://unify-project.org
 Copyright 2011, Deutsche Telekom AG
 License: MIT + Apache (V2)

 Inspired by: https://github.com/inexorabletash/raf-shim/blob/master/raf.js
*/
(function(e){if(!e.requestAnimationFrame){var l=Date.now||function(){return+new Date},f=Object.keys||function(a){var b={},c;for(c in a)b[c]=!0;return b},B=Object.empty||function(a){for(var b in a)return!1;return!0},c=function(){for(var a=["webkit","moz","o","ms"],b=0;4>b;b++)if(null!=e[a[b]+"RequestAnimationFrame"])return a[b]}();if(c)e.requestAnimationFrame=e[c+"RequestAnimationFrame"],e.cancelRequestAnimationFrame=e[c+"CancelRequestAnimationFrame"];else{var d={},a=1,b=null;e.requestAnimationFrame=
function(c,e){var m=a++;d[m]=c;null===b&&(b=setTimeout(function(){var a=l(),c=d,e=f(c);d={};b=null;for(var s=0,m=e.length;s<m;s++)c[e[s]](a)},1E3/60));return m};e.cancelRequestAnimationFrame=function(a){delete d[a];B(d)&&(clearTimeout(b),b=null)}}}})(this);
(function(e){var l=Date.now||function(){return+new Date},f={},B=1;e.core?core.effect||(core.effect={}):e.core={effect:{}};core.effect.Animate={stop:function(c){var d=null!=f[c];d&&(f[c]=null);return d},isRunning:function(c){return null!=f[c]},start:function(c,d,a,b,e,z){var m=l(),n=m,p=0,w=0,h=B++;z||(z=document.body);if(0===h%20){var v={},t;for(t in f)v[t]=!0;f=v}var u=function(g){g=!0!==g;var k=l();if(!f[h]||d&&!d(h))f[h]=null,a&&a(60-w/((k-m)/1E3),h,!1);else{if(g)for(var q=Math.round((k-n)/(1E3/
60))-1,t=0;t<Math.min(q,4);t++)u(!0),w++;b&&(p=(k-m)/b,1<p&&(p=1));q=e?e(p):p;!1!==c(q,k,g)&&1!==p||!g?g&&(n=k,requestAnimationFrame(u,z)):(f[h]=null,a&&a(60-w/((k-m)/1E3),h,1===p||null==b))}};f[h]=!0;requestAnimationFrame(u,z);return h}}})(this);
var EasyScroller=function(e,l){this.content=e;this.container=e.parentNode;this.options=l||{};var f=this;this.scroller=new Scroller(function(e,c,d){f.render(e,c,d)},l);this.bindEvents();this.content.style[EasyScroller.vendorPrefix+"TransformOrigin"]="left top";this.reflow()};
EasyScroller.prototype.render=function(){var e=document.documentElement.style,l;window.opera&&"[object Opera]"===Object.prototype.toString.call(opera)?l="presto":"MozAppearance"in e?l="gecko":"WebkitAppearance"in e?l="webkit":"string"===typeof navigator.cpuClass&&(l="trident");e=EasyScroller.vendorPrefix={trident:"ms",gecko:"Moz",webkit:"Webkit",presto:"O"}[l];l=document.createElement("div");var f=e+"Transform";return void 0!==l.style[e+"Perspective"]?function(e,c,d){this.content.style[f]="translate3d("+
-e+"px,"+-c+"px,0) scale("+d+")"}:void 0!==l.style[f]?function(e,c,d){this.content.style[f]="translate("+-e+"px,"+-c+"px) scale("+d+")"}:function(e,c,d){this.content.style.marginLeft=e?-e/d+"px":"";this.content.style.marginTop=c?-c/d+"px":"";this.content.style.zoom=d||""}}();
EasyScroller.prototype.reflow=function(){this.scroller.setDimensions(this.container.clientWidth,this.container.clientHeight,this.content.offsetWidth,this.content.offsetHeight);var e=this.container.getBoundingClientRect();this.scroller.setPosition(e.left+this.container.clientLeft,e.top+this.container.clientTop)};
EasyScroller.prototype.bindEvents=function(){var e=this;$(window).bind("resize",function(){e.reflow()});$("#modelTab").bind("click",function(){e.reflow()});if("ontouchstart"in window)this.container.addEventListener("touchstart",function(f){f.touches[0]&&f.touches[0].target&&f.touches[0].target.tagName.match(/input|textarea|select/i)||(e.scroller.doTouchStart(f.touches,(new Date).getTime()),f.preventDefault())},!1),document.addEventListener("touchmove",function(f){e.scroller.doTouchMove(f.touches,
(new Date).getTime(),f.scale)},!1),document.addEventListener("touchend",function(f){e.scroller.doTouchEnd((new Date).getTime())},!1),document.addEventListener("touchcancel",function(f){e.scroller.doTouchEnd((new Date).getTime())},!1);else{var l=!1;$(this.container).bind("mousedown",function(f){f.target.tagName.match(/input|textarea|select/i)||(e.scroller.doTouchStart([{pageX:f.pageX,pageY:f.pageY}],(new Date).getTime()),l=!0,f.preventDefault())});$(document).bind("mousemove",function(f){l&&(e.scroller.doTouchMove([{pageX:f.pageX,
pageY:f.pageY}],(new Date).getTime()),l=!0)});$(document).bind("mouseup",function(f){l&&(e.scroller.doTouchEnd((new Date).getTime()),l=!1)});$(this.container).bind("mousewheel",function(f){e.options.zooming&&(e.scroller.doMouseZoom(f.wheelDelta,(new Date).getTime(),f.pageX,f.pageY),f.preventDefault())})}};var Scroller;
(function(){Scroller=function(c,d){this.__callback=c;this.options={scrollingX:!0,scrollingY:!0,animating:!0,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:0.5,maxZoom:3,eventTarget:null};for(var a in d)this.options[a]=d[a]};var e=function(c){return Math.pow(c-1,3)+1},l=function(c){return 1>(c/=0.5)?0.5*Math.pow(c,3):0.5*(Math.pow(c-2,3)+2)},f={__isSingleTouch:!1,__isTracking:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,
__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshDeactivate:null,__refreshStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,
__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(c,d,a,b){c&&(this.__clientWidth=c);d&&(this.__clientHeight=d);a&&(this.__contentWidth=a);b&&(this.__contentHeight=b);this.__computeScrollMax();this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},setPosition:function(c,d){this.__clientLeft=c||0;this.__clientTop=d||0},setSnapSize:function(c,d){this.__snapWidth=c;this.__snapHeight=d},activatePullToRefresh:function(c,d,a,b){this.__refreshHeight=
c;this.__refreshActivate=d;this.__refreshDeactivate=a;this.__refreshStart=b},finishPullToRefresh:function(){this.__refreshActive=!1;this.__refreshDeactivate&&this.__refreshDeactivate();this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},getValues:function(){return{left:this.__scrollLeft,top:this.__scrollTop,zoom:this.__zoomLevel}},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},zoomTo:function(c,d,a,b){if(!this.options.zooming)throw Error("Zooming is not enabled!");
this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1);var e=this.__zoomLevel;null==a&&(a=this.__clientWidth/2);null==b&&(b=this.__clientHeight/2);c=Math.max(Math.min(c,this.options.maxZoom),this.options.minZoom);this.__computeScrollMax(c);a=(a+this.__scrollLeft)*c/e-a;b=(b+this.__scrollTop)*c/e-b;a>this.__maxScrollLeft?a=this.__maxScrollLeft:0>a&&(a=0);b>this.__maxScrollTop?b=this.__maxScrollTop:0>b&&(b=0);this.__publish(a,b,c,d)},zoomBy:function(c,d,a,
b){this.zoomTo(this.__zoomLevel*c,d,a,b)},scrollTo:function(c,d,a,b){$(document).trigger(this.options.eventTarget.attr("id")+".scrolledTo",[c,d,b]);this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1);if(null!=b&&b!==this.__zoomLevel){if(!this.options.zooming)throw Error("Zooming is not enabled!");c*=b;d*=b;this.__computeScrollMax(b)}else b=this.__zoomLevel;this.options.scrollingX?this.options.paging?c=Math.round(c/this.__clientWidth)*this.__clientWidth:
this.options.snapping&&(c=Math.round(c/this.__snapWidth)*this.__snapWidth):c=this.__scrollLeft;this.options.scrollingY?this.options.paging?d=Math.round(d/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(d=Math.round(d/this.__snapHeight)*this.__snapHeight):d=this.__scrollTop;c=Math.max(Math.min(this.__maxScrollLeft,c),0);d=Math.max(Math.min(this.__maxScrollTop,d),0);c===this.__scrollLeft&&d===this.__scrollTop&&(a=!1);this.__publish(c,d,b,a)},scrollBy:function(c,d,a){this.scrollTo((this.__isAnimating?
this.__scheduledLeft:this.__scrollLeft)+(c||0),(this.__isAnimating?this.__scheduledTop:this.__scrollTop)+(d||0),a)},doMouseZoom:function(c,d,a,b){return this.zoomTo(this.__zoomLevel*(0<c?0.97:1.03),!1,a-this.__clientLeft,b-this.__clientTop)},doTouchStart:function(c,d){if(null==c.length)throw Error("Invalid touch list: "+c);d instanceof Date&&(d=d.valueOf());if("number"!==typeof d)throw Error("Invalid timestamp value: "+d);this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=
!1);this.__isAnimating&&(core.effect.Animate.stop(this.__isAnimating),this.__isAnimating=!1);var a,b,e=1===c.length;e?(a=c[0].pageX,b=c[0].pageY):(a=Math.abs(c[0].pageX+c[1].pageX)/2,b=Math.abs(c[0].pageY+c[1].pageY)/2);this.__initialTouchLeft=a;this.__initialTouchTop=b;this.__zoomLevelStart=this.__zoomLevel;this.__lastTouchLeft=a;this.__lastTouchTop=b;this.__lastTouchMove=d;this.__lastScale=1;this.__enableScrollX=!e&&this.options.scrollingX;this.__enableScrollY=!e&&this.options.scrollingY;this.__isTracking=
!0;this.__isDragging=!e;this.__isSingleTouch=e;this.__positions=[]},doTouchMove:function(c,d,a){if(null==c.length)throw Error("Invalid touch list: "+c);d instanceof Date&&(d=d.valueOf());if("number"!==typeof d)throw Error("Invalid timestamp value: "+d);if(this.__isTracking){var b;2===c.length?(b=Math.abs(c[0].pageX+c[1].pageX)/2,c=Math.abs(c[0].pageY+c[1].pageY)/2):(b=c[0].pageX,c=c[0].pageY);var e=this.__positions;if(this.__isDragging){var f=b-this.__lastTouchLeft,m=c-this.__lastTouchTop,n=this.__scrollLeft,
p=this.__scrollTop,l=this.__zoomLevel;if(null!=a&&this.options.zooming){var h=l,l=l/this.__lastScale*a,l=Math.max(Math.min(l,this.options.maxZoom),this.options.minZoom);if(h!==l){var v=b-this.__clientLeft,t=c-this.__clientTop,n=(v+n)*l/h-v,p=(t+p)*l/h-t;this.__computeScrollMax(l)}}this.__enableScrollX&&(n-=f,h=this.__maxScrollLeft,n>h||0>n)&&(n=this.options.bouncing?n+f/2:n>h?h:0);this.__enableScrollY&&(p-=m,f=this.__maxScrollTop,p>f||0>p)&&(this.options.bouncing?(p+=m/2,this.__enableScrollX||null==
this.__refreshHeight||(!this.__refreshActive&&p<=-this.__refreshHeight?(this.__refreshActive=!0,this.__refreshActivate&&this.__refreshActivate()):this.__refreshActive&&p>-this.__refreshHeight&&(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()))):p=p>f?f:0);60<e.length&&e.splice(0,30);e.push(n,p,d);this.__publish(n,p,l)}else m=this.options.locking?3:0,n=Math.abs(b-this.__initialTouchLeft),p=Math.abs(c-this.__initialTouchTop),this.__enableScrollX=this.options.scrollingX&&
n>=m,this.__enableScrollY=this.options.scrollingY&&p>=m,e.push(this.__scrollLeft,this.__scrollTop,d),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(5<=n||5<=p);this.__lastTouchLeft=b;this.__lastTouchTop=c;this.__lastTouchMove=d;this.__lastScale=a}},doTouchEnd:function(c){c instanceof Date&&(c=c.valueOf());if("number"!==typeof c)throw Error("Invalid timestamp value: "+c);if(this.__isTracking){this.__isTracking=!1;if(this.__isDragging&&(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&
100>=c-this.__lastTouchMove)){for(var d=this.__positions,a=d.length-1,b=a,e=a;0<e&&d[e]>this.__lastTouchMove-100;e-=3)b=e;b!==a&&(a=d[a]-d[b],e=this.__scrollTop-d[b-1],this.__decelerationVelocityX=(this.__scrollLeft-d[b-2])/a*(1E3/60),this.__decelerationVelocityY=e/a*(1E3/60),d=this.options.paging||this.options.snapping?4:1,Math.abs(this.__decelerationVelocityX)>d||Math.abs(this.__decelerationVelocityY)>d)&&(this.__refreshActive||this.__startDeceleration(c))}this.__isDecelerating||(this.__refreshActive&&
this.__refreshStart?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):(this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel),this.__refreshActive&&(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate())));this.__positions.length=0}},__publish:function(c,d,a,b){var f=this,z=f.__isAnimating;z&&(core.effect.Animate.stop(z),f.__isAnimating=!1);if(b&&f.options.animating){f.__scheduledLeft=c;f.__scheduledTop=
d;f.__scheduledZoom=a;var m=f.__scrollLeft,n=f.__scrollTop,p=f.__zoomLevel,w=c-m,h=d-n,v=a-p;f.__isAnimating=core.effect.Animate.start(function(a,b,c){c&&(f.__scrollLeft=m+w*a,f.__scrollTop=n+h*a,f.__zoomLevel=p+v*a,f.__callback&&f.__callback(f.__scrollLeft,f.__scrollTop,f.__zoomLevel))},function(a){return f.__isAnimating===a},function(a,b,c){b===f.__isAnimating&&(f.__isAnimating=!1);f.options.zooming&&f.__computeScrollMax()},250,z?e:l)}else f.__scheduledLeft=f.__scrollLeft=c,f.__scheduledTop=f.__scrollTop=
d,f.__scheduledZoom=f.__zoomLevel=a,f.__callback&&f.__callback(c,d,a),f.options.zooming&&f.__computeScrollMax()},__computeScrollMax:function(c){null==c&&(c=this.__zoomLevel);this.__maxScrollLeft=Math.max(this.__contentWidth*c-this.__clientWidth,0);this.__maxScrollTop=Math.max(this.__contentHeight*c-this.__clientHeight,0)},__startDeceleration:function(c){var d=this;if(d.options.paging){c=Math.max(Math.min(d.__scrollLeft,d.__maxScrollLeft),0);var a=Math.max(Math.min(d.__scrollTop,d.__maxScrollTop),
0),b=d.__clientWidth,e=d.__clientHeight;d.__minDecelerationScrollLeft=Math.floor(c/b)*b;d.__minDecelerationScrollTop=Math.floor(a/e)*e;d.__maxDecelerationScrollLeft=Math.ceil(c/b)*b;d.__maxDecelerationScrollTop=Math.ceil(a/e)*e}else d.__minDecelerationScrollLeft=0,d.__minDecelerationScrollTop=0,d.__maxDecelerationScrollLeft=d.__maxScrollLeft,d.__maxDecelerationScrollTop=d.__maxScrollTop;var f=d.options.snapping?4:0.1;d.__isDecelerating=core.effect.Animate.start(function(a,b,c){d.__stepThroughDeceleration(c)},
function(){return Math.abs(d.__decelerationVelocityX)>=f||Math.abs(d.__decelerationVelocityY)>=f},function(a,b,c){d.__isDecelerating=!1;d.scrollTo(d.__scrollLeft,d.__scrollTop,d.options.snapping)})},__stepThroughDeceleration:function(c){var d=this.__scrollLeft+this.__decelerationVelocityX,a=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){var b=Math.max(Math.min(this.__maxScrollLeft,d),0);b!==d&&(d=b,this.__decelerationVelocityX=0);b=Math.max(Math.min(this.__maxScrollTop,a),
0);b!==a&&(a=b,this.__decelerationVelocityY=0)}c?this.__publish(d,a,this.__zoomLevel):(this.__scrollLeft=d,this.__scrollTop=a);this.options.paging||(this.__decelerationVelocityX*=0.95,this.__decelerationVelocityY*=0.95);this.options.bouncing&&(b=c=0,d<this.__minDecelerationScrollLeft?c=this.__minDecelerationScrollLeft-d:d>this.__maxDecelerationScrollLeft&&(c=this.__maxDecelerationScrollLeft-d),a<this.__minDecelerationScrollTop?b=this.__minDecelerationScrollTop-a:a>this.__maxDecelerationScrollTop&&
(b=this.__maxDecelerationScrollTop-a),0!==c&&(this.__decelerationVelocityX=0>=c*this.__decelerationVelocityX?this.__decelerationVelocityX+0.03*c:0.08*c),0!==b&&(this.__decelerationVelocityY=0>=b*this.__decelerationVelocityY?this.__decelerationVelocityY+0.03*b:0.08*b))}},B;for(B in f)Scroller.prototype[B]=f[B]})();
<commit_msg>Consensus colors now correct when drawing rectangles<commit_after>/*

 HMM logo
 http://github.com/url/here
 Copyright 2013, <NAME>.
 Licensed under the MIT License.
 http://url/to/license
*/
(function(e){function n(){if(!d){var a=document.createElement("canvas");d=!(!a.getContext||!a.getContext("2d"))}return d}function f(a,b){b=b||{};this.value=a;this.width=parseInt(b.width,10)||100;"W"===this.value&&(this.width+=30*this.width/100);this.height=parseInt(b.height,10)||100;this.color=b.color||"#000000";this.fontSize=b.fontSize||138;this.scaled=function(){};this.draw=function(a,b,d,c,p,w){var k=a.font;a.transform(d/this.width,0,0,b/this.height,c,p);a.fillStyle=w||this.color;a.textAlign="center";
a.font="bold "+this.fontSize+"px Arial";a.fillText(this.value,0,0);a.setTransform(1,0,0,1,0,0);a.fillStyle="#000000";a.font=k}}function A(){this.grey="#7a7a7a";this.check_PG=function(a,b,s){s[a].P="#ffff11";s[a].G="#ff7f11";return 1};this.check_R=function(a,b,s){s[a].R=this.grey;for(var d=["Q","K","R"],c=0,c=0;c<d.length;c++)if(b["0.85"][a]===d[c])return s[a].R="#FF9999",1;if("+"===b["0.60"][a]||"R"===b["0.60"][a]||"K"===b["0.60"][a])s[a].R="#FF9999";return 1};this.check_Q=function(a,b,s){s[a].Q=
this.grey;var d=["Q","T","K","R"],c=0;if("b"===b["0.50"][a]||"E"===b["0.50"][a]||"Q"===b["0.50"][a])return s[a].Q="#99FF99",1;for(c=0;c<d.length;c++)if(b["0.85"][a]===d[c])return s[a].Q="#99FF99",1;if("+"===b["0.60"][a]||"K"===b["0.60"][a]||"R"===b["0.50"][a])s[a].Q="#99FF99";return 1};this.check_N=function(a,b,s){s[a].N=this.grey;if("N"===b["0.50"][a])return s[a].N="#99FF99",1;"D"===b["0.85"][a]&&(s[a].N="#99FF99");return 1};this.check_K=function(a,b,s){s[a].K=this.grey;var d=["K","R","Q"],c=0;if("+"===
b["0.60"][a]||"R"===b["0.60"][a]||"K"===b["0.60"][a])return s[a].K="#FF9999",1;for(c=0;c<d.length;c++)if(b["0.85"][a]===d[c]){s[a].K="#FF9999";break}return 1};this.check_E=function(a,b,c){c[a].E=this.grey;var d=["D","E"],e=0;if("+"===b["0.60"][a]||"R"===b["0.60"][a]||"K"===b["0.60"][a])return c[a].E="#FF9999",1;for(e=0;e<d.length;e++)if(b["0.85"][a]===d[e])return c[a].E="#FF9999",1;if("b"===b["0.50"][a]||"E"===b["0.50"][a]||"Q"===b["0.50"][a])c[a].E="#FF9999";return 1};this.check_D=function(a,b,c){c[a].D=
this.grey;var d=["D","E","N"],e=0;if("+"===b["0.60"][a]||"R"===b["0.60"][a]||"K"===b["0.60"][a])return c[a].D="#FF9999",1;for(e=0;e<d.length;e++)if(b["0.85"][a]===d[e])return c[a].D="#FF9999",1;if("-"===b["0.50"][a]||"E"===b["0.60"][a]||"D"===b["0.60"][a])c[a].D="#FF9999";return 1};this.check_ACFILMVW=function(a,b,c){for(var d="ACFLIMVW".split(""),e="ACFHILMVWYPQh".split(""),f=0,p=0,f=0;f<d.length;f++)for(c[a][d[f]]=this.grey,p=0;p<e.length;p++)b["0.60"][a]===e[p]&&(c[a][d[f]]="#9999FF");return 1};
this.check_ST=function(a,b,c){c[a].S=this.grey;c[a].T=this.grey;var d="ACFHILMVWYPQ".split(""),e=0;if("a"===b["0.50"][a]||"S"===b["0.50"][a]||"T"===b["0.50"][a])return c[a].S="#99FF99",c[a].T="#99FF99",1;for(e=0;e<d.length;e++)if(b["0.85"][a]===d[e])return c[a].S="#99FF99",c[a].T="#99FF99",1};this.check_HY=function(a,b,c){c[a].H=this.grey;c[a].Y=this.grey;var d="ACFHILMVWYPQh".split(""),e=0;if("h"===b["0.60"][a])return c[a].H="#99FFFF",c[a].Y="#99FFFF",1;for(e=0;e<d.length;e++)if(b[0.85][a]===d[e]){c[a].H=
"#99FFFF";c[a].Y="#99FFFF";break}return 1};this.color_map=function(a){for(var b=["0.50","0.60","0.80","0.85"],c={W:1,L:1,V:1,I:1,M:1,A:1,F:1,C:1,Y:1,H:1,P:1},d={Q:1,N:1},e={K:1,R:1,H:1},f={S:1,T:1},p={E:1,D:1},w={},k=[],v=0,t=v=0,u=0,g=[],h=null,q={},B=u=null,v=0;v<a.length;v++)for(h=a[v],t=0;t<b.length;t++){B=b[t];q={p:0,o:0,"-":0,"+":0,h:0};for(u=0;u<h.length;u++)g=h[u].split(":"),q[g[0]]=parseFloat(g[1],10),d[g[0]]?q.p+=parseFloat(g[1],10):f[g[0]]?q.o+=parseFloat(g[1],10):p[g[0]]?q["-"]+=parseFloat(g[1],
10):(e[g[0]]&&(q["+"]+=parseFloat(g[1],10)),c[g[0]]&&(q.h+=parseFloat(g[1],10)));var u=B,g=".",r=0,y=null,n=null,E=null,x={".":20,h:11,"+":3,"-":2,o:2,p:2};for(y in q)q.hasOwnProperty(y)&&q[y]>=u&&(n=x[y]||1,E=x[g]||1,n<E?(g=y,r=q[y]):n===E&&q[y]>r&&(g=y,r=q[y]));u=g;w[B]||(w[B]=[]);w[B].push(u)}for(v=0;v<a.length;v++)k[v]={},this.check_D(v,w,k),this.check_R(v,w,k),this.check_Q(v,w,k),this.check_N(v,w,k),this.check_K(v,w,k),this.check_E(v,w,k),this.check_HY(v,w,k),this.check_ACFILMVW(v,w,k),this.check_ST(v,
w,k),this.check_PG(v,w,k);return k}}function c(a){function b(a,b,c){a.beginPath();a.moveTo(0,b);a.lineTo(c,b);a.lineWidth=1;a.strokeStyle="#999999";a.stroke()}function c(a,b,d,e,s){s=s||"#999999";a.beginPath();a.moveTo(b,d);a.lineTo(b,d+e);a.lineWidth=1;a.strokeStyle=s;a.stroke()}function d(a,b,c,e,s,u,g,h){a.font=s+"px Arial";a.fillStyle=g;a.fillRect(b,c-10,u,14);a.textAlign="center";a.fillStyle=h;a.fillText(e,b+u/2,c)}a=a||{};this.column_width=a.column_width||34;this.height=a.height||300;this.data=
a.data||null;this.debug=a.debug||null;this.scale_height_enabled=a.height_toggle||null;this.zoom_enabled=a.zoom_buttons&&"disabled"===a.zoom_buttons?null:!0;this.colorscheme=a.colorscheme||"default";this.display_ali_map=0;this.alphabet=a.data.alphabet||"dna";this.dom_element=a.dom_element||e("body");this.called_on=a.called_on||null;this.start=a.start||1;this.end=a.end||this.data.height_arr.length;this.default_zoom=this.zoom=parseFloat(a.zoom)||0.4;this.data.processing&&/^observed|weighted/.test(this.data.processing)?
(this.show_inserts=0,this.info_content_height=286):(this.show_inserts=1,this.info_content_height=256);this.data.max_height=a.scaled_max?a.data.max_height_obs||this.data.max_height||2:a.data.max_height_theory||this.data.max_height||2;this.dna_colors={A:"#cbf751",C:"#5ec0cc",G:"#ffdf59",T:"#b51f16",U:"#b51f16"};this.aa_colors={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"};this.colors=this.dna_colors;"aa"===this.alphabet&&(this.colors=this.aa_colors);this.canvas_width=5E3;var l=a=null,m=l=null;"aa"===this.alphabet&&(l=this.data.probs_arr)&&(m=new A,this.cmap=m.color_map(l));this.letters={};for(a in this.colors)this.colors.hasOwnProperty(a)&&(l={color:this.colors[a]},this.letters[a]=new f(a,l));this.scrollme=null;this.previous_target=0;this.rendered=[];this.previous_zoom=0;this.render=function(a){if(this.data){a=
a||{};var b=a.zoom||this.zoom,c=a.target||1,d=e(this.dom_element).parent().width(),s=1,u=null,g=null,h=0;if(c!==this.previous_target){this.previous_target=c;a.start&&(this.start=a.start);a.end&&(this.end=a.end);0.1>=b?b=0.1:1<=b&&(b=1);this.zoom=b;u=this.end||this.data.height_arr.length;g=this.start||1;u=u>this.data.height_arr.length?this.data.height_arr.length:u;u=u<g?g:u;g=g>u?u:g;g=1<g?g:1;this.y=this.height-20;this.max_width=this.column_width*(u-g+1);d>this.max_width&&(b=1,this.zoom_enabled=!1);
this.zoom=b;this.zoomed_column=this.column_width*b;this.total_width=this.zoomed_column*(u-g+1);if(1>b)for(;this.total_width<d&&!(this.zoom+=0.1,this.zoomed_column=this.column_width*this.zoom,this.total_width=this.zoomed_column*(u-g+1),this.zoom_enabled=!1,1<=b););c>this.total_width&&(c=this.total_width);e(this.dom_element).attr({width:this.total_width+"px"}).css({width:this.total_width+"px"});a=Math.ceil(this.total_width/this.canvas_width);this.columns_per_canvas=Math.ceil(this.canvas_width/this.zoomed_column);
this.previous_zoom!==this.zoom&&(e(this.dom_element).find("canvas").remove(),this.previous_zoom=this.zoom,this.rendered=[]);this.canvases=[];this.contexts=[];for(h=0;h<a;h++){var d=this.columns_per_canvas*h+g,q=d+this.columns_per_canvas-1;q>u&&(q=u);var f=(q-d+1)*this.zoomed_column;f>s&&(s=f);var r=s*h,y=r+f;if(c<y+y/2&&c>r-r/2&&1!==this.rendered[h]){var r=this.canvases,m=h,l=this.dom_element,z=this.height,A=f,D=h,F=s,C=e(l).find("#canv_"+D);C.length||(e(l).append('<canvas class="canvas_logo" id="canv_'+
D+'"  height="'+z+'" width="'+A+'" style="left:'+F*D+'px"></canvas>'),C=e(l).find("#canv_"+D));e(C).attr("width",A).attr("height",z);n()||(C[0]=G_vmlCanvasManager.initElement(C[0]));r[m]=C[0];this.contexts[h]=this.canvases[h].getContext("2d");this.contexts[h].setTransform(1,0,0,1,0,0);this.contexts[h].clearRect(0,0,f,this.height);this.contexts[h].fillStyle="#ffffff";this.contexts[h].fillRect(0,0,y,this.height);12<this.zoomed_column?(f=parseInt(10*b,10),f=10<f?10:f,this.debug&&this.render_with_rects(d,
q,h,1),this.render_with_text(d,q,h,f)):this.render_with_rects(d,q,h);this.rendered[h]=1}}!this.scrollme&&n()&&(this.scrollme=new EasyScroller(e(this.dom_element)[0],{scrollingX:1,scrollingY:0,eventTarget:this.called_on}));1!==c&&n()&&this.scrollme.reflow()}}};this.render_x_axis_label=function(){var a="Model Position";this.display_ali_map&&(a="Alignment Column");e(this.called_on).find(".logo_xaxis").remove();e(this.called_on).prepend('<div class="logo_xaxis" class="centered" style="margin-left:40px"><p class="xaxis_text" style="width:10em;margin:1em auto">'+
a+"</p></div>")};this.render_y_axis_label=function(){e(this.dom_element).parent().before('<canvas class="logo_yaxis" height="300" width="55"></canvas>');var a=e(this.called_on).find(".logo_yaxis");Math.abs(this.data.max_height);isNaN(this.data.min_height_obs)||parseInt(this.data.min_height_obs,10);var b=null,c="Information Content (bits)";n()||(a[0]=G_vmlCanvasManager.initElement(a[0]));b=a[0].getContext("2d");b.beginPath();b.moveTo(55,1);b.lineTo(40,1);b.moveTo(55,this.info_content_height);b.lineTo(40,
this.info_content_height);b.moveTo(55,this.info_content_height/2);b.lineTo(40,this.info_content_height/2);b.lineWidth=1;b.strokeStyle="#666666";b.stroke();b.fillStyle="#666666";b.textAlign="right";b.font="bold 10px Arial";b.textBaseline="top";b.fillText(parseFloat(this.data.max_height).toFixed(1),38,0);b.textBaseline="middle";b.fillText(parseFloat(this.data.max_height/2).toFixed(1),38,this.info_content_height/2);b.fillText("0",38,this.info_content_height);"score"===this.data.height_calc&&(c="Score (bits)");
b.save();b.translate(5,this.height/2-20);b.rotate(-Math.PI/2);b.textAlign="center";b.font="normal 12px Arial";b.fillText(c,1,0);b.restore();b.fillText("occupancy",55,this.info_content_height+7);this.show_inserts&&(b.fillText("ins. prob.",50,280),b.fillText("ins. len.",46,296))};this.render_x_axis_label();this.render_y_axis_label();this.render_with_text=function(a,e,k,f){var t=0,u=a,g=null,h=0,h=Math.abs(this.data.max_height),g=isNaN(this.data.min_height_obs)?0:parseInt(this.data.min_height_obs,10),
h=h+Math.abs(g),h=Math.round(100*Math.abs(this.data.max_height)/h);Math.round(this.info_content_height*h/100);e+3<=this.end&&(e+=3);for(h=a;h<=e;h++){if(this.data.mmline&&1===this.data.mmline[h-1])this.contexts[k].fillStyle="#cccccc",this.contexts[k].fillRect(t,10,this.zoomed_column,this.height-40);else if(a=this.data.height_arr[h-1],g=[],a){for(var q=0,B=a.length,r=0,y=null,r=0;r<B;r++){var l=a[r].split(":",2),y=t+this.zoomed_column/2,m=null;if(0.01<l[1]){var m=parseFloat(l[1])/this.data.max_height,
l=this.info_content_height-2-q,x=(this.info_content_height-2)*m;n()||(l+=x*(m/2));g[r]=[x,this.zoomed_column,y,l];q+=x}}for(r=B;0<=r;r--)g[r]&&this.letters[a[r][0]]&&(y="consensus"===this.colorscheme?this.cmap[h-1][a[r][0]]||"#7a7a7a":null,this.letters[a[r][0]].draw(this.contexts[k],g[r][0],g[r][1],g[r][2],g[r][3],y))}g=this.display_ali_map?this.data.ali_map[h-1]:u;0.7>this.zoom?0===h%5&&this.draw_column_divider({context_num:k,x:t,fontsize:10,column_num:g,ralign:!0}):this.draw_column_divider({context_num:k,
x:t,fontsize:f,column_num:g});a=this.height;g=this.data.delete_probs[h-1];q=a-4;B="#ffffff";r="#555555";this.show_inserts&&(q=a-35);0.75>g?(B="#2171b5",r="#ffffff"):0.85>g?B="#6baed6":0.95>g&&(B="#bdd7e7");d(this.contexts[k],t,q,g,f,this.zoomed_column,B,r);c(this.contexts[k],t,this.height-15,5);this.show_inserts&&(a=this.contexts[k],g=t,q=this.height,B=this.zoomed_column,r=this.data.insert_probs[h-1],y=q-20,m="#ffffff",l="#555555",0.1<r?(m="#d7301f",l="#ffffff"):0.05<r?m="#fc8d59":0.03<r&&(m="#fdcc8a"),
d(a,g,y,r,f,B,m,l),0.03<r&&c(a,g+B,q-30,-30-q,m),a=this.data.insert_lengths[h-1],g="#ffffff",q="#555555",9<a?(g="#d7301f",q="#ffffff"):7<a?g="#fc8d59":4<a&&(g="#fdcc8a"),d(this.contexts[k],t,this.height-5,a,f,this.zoomed_column,g,q),c(this.contexts[k],t,this.height-45,5),c(this.contexts[k],t,this.height-30,5));t+=this.zoomed_column;u++}this.show_inserts&&(b(this.contexts[k],this.height-30,this.total_width),b(this.contexts[k],this.height-45,this.total_width));b(this.contexts[k],this.height-15,this.total_width);
b(this.contexts[k],0,this.total_width)};this.draw_column_divider=function(a){var b=a.ralign?a.x+this.zoomed_column:a.x,d=a.ralign?a.x+2:a.x;c(this.contexts[a.context_num],b,this.height-30,-30-this.height,"#dddddd");c(this.contexts[a.context_num],b,0,5);var b=this.contexts[a.context_num],e=this.zoomed_column,t=a.column_num,f=a.ralign;b.font=a.fontsize+"px Arial";b.textAlign=f?"right":"center";b.fillStyle="#666666";b.fillText(t,d+e/2,10)};this.render_with_rects=function(a,d,e,f){var t=0,u=a,g=null,
h=0,h=Math.abs(this.data.max_height),q=Math.abs(this.data.min_height_obs),h=h+q,h=Math.round(100*Math.abs(this.data.max_height)/h);Math.round(this.info_content_height*h/100);q=10;for(h=a;h<=d;h++){if(this.data.mmline&&1===this.data.mmline[h-1])this.contexts[e].fillStyle="#cccccc",this.contexts[e].fillRect(t,10,this.zoomed_column,this.height-40);else{a=this.data.height_arr[h-1];for(var g=0,l=a.length,r=0,r=0;r<l;r++){var m=a[r].split(":",2);if(0.01<m[1]){var n=parseFloat(m[1])/this.data.max_height,
z=t,n=(this.info_content_height-2)*n,x=this.info_content_height-2-g-n,A=null,A="consensus"===this.colorscheme?this.cmap[h-1][m[0]]||"#7a7a7a":this.colors[m[0]];f?(this.contexts[e].strokeStyle=A,this.contexts[e].strokeRect(z,x,this.zoomed_column,n)):(this.contexts[e].fillStyle=A,this.contexts[e].fillRect(z,x,this.zoomed_column,n));g+=n}}}0.2>this.zoom?q=20:0.3>this.zoom&&(q=10);0===h%q&&(c(this.contexts[e],t+this.zoomed_column,this.height-30,parseFloat(this.height),"#dddddd"),c(this.contexts[e],t+
this.zoomed_column,0,5),g=this.display_ali_map?this.data.ali_map[h-1]:u,a=this.contexts[e],l=t-2,r=this.zoomed_column,a.font="10px Arial",a.textAlign="right",a.fillStyle="#666666",a.fillText(g,l+r/2,10));a=this.contexts[e];g=t;l=this.height-42;r=this.zoomed_column;m=this.data.insert_probs[h-1];z=this.data.insert_lengths[h-1];n=this.data.delete_probs[h-1];x="#ffffff";this.show_inserts?(0.1<m?x="#d7301f":0.05<m?x="#fc8d59":0.03<m&&(x="#fdcc8a"),a.fillStyle=x,a.fillRect(g,l+15,r,10),x="#ffffff",9<z?
x="#d7301f":7<z?x="#fc8d59":4<z&&(x="#fdcc8a"),a.fillStyle=x,a.fillRect(g,l+30,r,10)):l+=30;x="#ffffff";0.75>n?x="#2171b5":0.85>n?x="#6baed6":0.95>n&&(x="#bdd7e7");a.fillStyle=x;a.fillRect(g,l,r,10);this.show_inserts?b(this.contexts[e],this.height-45,this.total_width):b(this.contexts[e],this.height-15,this.total_width);b(this.contexts[e],0,this.total_width);t+=this.zoomed_column;u++}};this.toggle_colorscheme=function(a){var b=this.current_column();this.colorscheme=a?"default"===a?"default":"consensus":
"default"===this.colorscheme?"consensus":"default";this.rendered=[];this.scrollme.reflow();this.scrollToColumn(b+1);this.scrollToColumn(b)};this.toggle_scale=function(a){var b=this.current_column();this.data.max_height=a?"obs"===a?this.data.max_height_obs:this.data.max_height_theory:this.data.max_height===this.data.max_height_obs?this.data.max_height_theory:this.data.max_height_obs;this.rendered=[];e(this.called_on).find(".logo_yaxis").remove();this.render_y_axis_label();this.scrollme.reflow();this.scrollToColumn(b+
1);this.scrollToColumn(b)};this.toggle_ali_map=function(a){var b=this.current_column();this.display_ali_map=a?"model"===a?0:1:1===this.display_ali_map?0:1;this.render_x_axis_label();this.rendered=[];this.scrollme.reflow();this.scrollToColumn(b+1);this.scrollToColumn(b)};this.current_column=function(){var a=this.scrollme.scroller.getValues().left,b=this.column_width*this.zoom,a=a/b,b=e(this.called_on).find(".logo_container").width()/b/2;return Math.ceil(a+b)};this.change_zoom=function(a){var b=0.3,
c=null;a.target?b=a.target:a.distance&&(b=(parseFloat(this.zoom)-parseFloat(a.distance)).toFixed(1),"+"===a.direction&&(b=(parseFloat(this.zoom)+parseFloat(a.distance)).toFixed(1)));1<b?b=1:0.1>b&&(b=0.1);c=e(this.called_on).find(".logo_graphic").width()*b/this.zoom;c>e(this.called_on).find(".logo_container").width()&&(a.column?(this.zoom=b,this.render({zoom:this.zoom}),this.scrollme.reflow(),b=this.coordinatesFromColumn(a.column),this.scrollme.scroller.scrollTo(b-a.offset)):(a=this.current_column(),
this.zoom=b,this.render({zoom:this.zoom}),this.scrollme.reflow(),this.scrollToColumn(a)));return this.zoom};this.columnFromCoordinates=function(a){return Math.ceil(a/(this.column_width*this.zoom))};this.coordinatesFromColumn=function(a){return(a-1)*this.column_width*this.zoom+this.column_width*this.zoom/2};this.scrollToColumn=function(a,b){var c=e(this.called_on).find(".logo_container").width()/2,d=this.coordinatesFromColumn(a);this.scrollme.scroller.scrollTo(d-c,0,b)}}var d=null;e.fn.hmm_logo=function(a){var b=
null,d=e('<div class="logo_graphic">');if(n()){a=a||{};e(this).append(e('<div class="logo_container">').append(d).append('<div class="logo_divider">'));a.data=e(this).data("logo");if(null===a.data)return;a.dom_element=d;a.called_on=this;var f=e('<form class="logo_form"><fieldset><label for="position">Column number</label><input type="text" name="position" class="logo_position"></input><button class="button logo_change">Go</button></fieldset></form>'),l=e('<div class="logo_controls">'),m=e('<div class="logo_settings">');
m.append('<span class="close">x</span>');b=new c(a);b.render(a);b.zoom_enabled&&l.append('<button class="logo_zoomout button">-</button><button class="logo_zoomin button">+</button>');if(b.scale_height_enabled&&b.data.max_height_obs<b.data.max_height_theory){var p="",w="",k="",v="";b.data.max_height_obs===b.data.max_height?p="checked":w="checked";a.help&&(v='<a class="help" href="/help#scale_obs" title="Set the y-axis maximum to the maximum observed height."><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>',
k='<a class="help" href="/help#scale_theory" title="Set the y-axis maximum to the theoretical maximum height"><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>');m.append('<fieldset><legend>Scale</legend><label><input type="radio" name="scale" class="logo_scale" value="obs" '+p+"/>Maximum Observed "+v+'</label></br><label><input type="radio" name="scale" class="logo_scale" value="theory" '+w+"/>Maximum Theoretical "+k+"</label></fieldset>")}"score"!==b.data.height_calc&&
"aa"===b.data.alphabet&&b.data.probs_arr&&(w=p=null,v=k="","default"===b.colorscheme?p="checked":w="checked",a.help&&(k='<a class="help" href="/help#colors_default" title=""><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>',v='<a class="help" href="/help#colors_consensus" title=""><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>'),m.append('<fieldset><legend>Color Scheme</legend><label><input type="radio" name="color" class="logo_color" value="default" '+
p+"/>Default "+k+'</label></br><label><input type="radio" name="color" class="logo_color" value="consensus" '+w+"/>Consensus Colors "+v+"</label></fieldset>"));b.data.ali_map&&(w=p=null,v=k="",0===b.display_ali_map?p="checked":w="checked",a.help&&(k='<a class="help" href="/help#coords_model" title=""><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>',v='<a class="help" href="/help#coords_ali" title=""><span aria-hidden="true" data-icon="?"></span><span class="reader-text">help</span></a>'),
m.append('<fieldset><legend>Coordinates</legend><label><input type="radio" name="coords" class="logo_ali_map" value="model" '+p+"/>Model "+k+'</label></br><label><input type="radio" name="coords" class="logo_ali_map" value="alignment" '+w+"/>Alignment "+v+"</label></fieldset>"));0<m.children().length&&(l.append('<button class="logo_settings_switch button">Settings</button>'),l.append(m));f.append(l);e(this).append(f);e(this).find(".logo_settings_switch, .logo_settings .close").bind("click",function(a){a.preventDefault();
e(".logo_settings").toggle()});e(this).find(".logo_reset").bind("click",function(a){a.preventDefault();a=b;a.change_zoom({target:a.default_zoom})});e(this).find(".logo_change").bind("click",function(a){a.preventDefault()});e(this).find(".logo_zoomin").bind("click",function(a){a.preventDefault();b.change_zoom({distance:0.1,direction:"+"})});e(this).find(".logo_zoomout").bind("click",function(a){a.preventDefault();b.change_zoom({distance:0.1,direction:"-"})});e(this).find(".logo_scale").bind("change",
function(a){b.toggle_scale(this.value)});e(this).find(".logo_color").bind("change",function(a){b.toggle_colorscheme(this.value)});e(this).find(".logo_ali_map").bind("change",function(a){b.toggle_ali_map(this.value)});e(this).find(".logo_position").bind("change",function(){var a=b;this.value.match(/^\d+$/m)&&a.scrollToColumn(this.value,1)});d.bind("dblclick",function(a){var c=b,d=e(this).offset(),d=parseInt(a.pageX-d.left,10);a=a.pageX-e(this).parent().offset().left;d=c.columnFromCoordinates(d);1>
c.zoom?c.change_zoom({target:1,offset:a,column:d}):c.change_zoom({target:0.3,offset:a,column:d})});a.column_info&&d.bind("click",function(c){var d=b,s=e('<table class="logo_col_info"></table>'),h="<tr>",f="",k=e(this).offset();c=parseInt(c.pageX-k.left,10);e(this).parent().offset();d=d.columnFromCoordinates(c);c=[];var l=k=0,m=0,m="Probability";b.data.height_calc&&"score"===b.data.height_calc?(m="Score",c=b.data.height_arr[d-1].slice(0).reverse()):c=b.data.probs_arr[d-1].slice(0).reverse();k=Math.ceil(c.length/
5);for(l=0;l<k;l++)h=1<k&&l<k-1?h+('<th>Residue</th><th class="odd">'+m+"</th>"):h+("<th>Residue</th><th>"+m+"</th>");s.append(e(h+"</tr>"));for(l=0;5>l;l++){f+="<tr>";for(m=l;c[m];){var h=c[m].split(":",2),p="";"default"===b.colorscheme&&(p=b.alphabet+"_"+h[0]);f=1<k&&15>m?f+('<td class="'+p+'"><div></div>'+h[0]+'</td><td class="odd">'+h[1]+"</td>"):f+('<td class="'+p+'"><div></div>'+h[0]+"</td><td>"+h[1]+"</td>");m+=5}f+="</tr>"}s.append(e(f));e(a.column_info).empty().append(e("<p> Column:"+d+"</p><div><p>Occupancy: "+
b.data.delete_probs[d-1]+"</p><p>Insert Probability: "+b.data.insert_probs[d-1]+"</p><p>Insert Length: "+b.data.insert_lengths[d-1]+"</p></div>")).append(s).show()});e(document).bind(this.attr("id")+".scrolledTo",function(a,c,d,e){b.render({target:c})});e(document).keydown(function(a){a.ctrlKey||(61!==a.which&&107!==a.which||b.change_zoom({distance:0.1,direction:"+"}),109!==a.which&&0!==a.which||b.change_zoom({distance:0.1,direction:"-"}))})}else e("#logo").replaceWith(e("#no_canvas").html());return b}})(jQuery);/*

 Scroller
 http://github.com/zynga/scroller

 Copyright 2011, Zynga Inc.
 Licensed under the MIT License.
 https://raw.github.com/zynga/scroller/master/MIT-LICENSE.txt

 Based on the work of: Unify Project (unify-project.org)
 http://unify-project.org
 Copyright 2011, Deutsche Telekom AG
 License: MIT + Apache (V2)

 Inspired by: https://github.com/inexorabletash/raf-shim/blob/master/raf.js
*/
(function(e){if(!e.requestAnimationFrame){var n=Date.now||function(){return+new Date},f=Object.keys||function(a){var b={},c;for(c in a)b[c]=!0;return b},A=Object.empty||function(a){for(var b in a)return!1;return!0},c=function(){for(var a=["webkit","moz","o","ms"],b=0;4>b;b++)if(null!=e[a[b]+"RequestAnimationFrame"])return a[b]}();if(c)e.requestAnimationFrame=e[c+"RequestAnimationFrame"],e.cancelRequestAnimationFrame=e[c+"CancelRequestAnimationFrame"];else{var d={},a=1,b=null;e.requestAnimationFrame=
function(c,e){var l=a++;d[l]=c;null===b&&(b=setTimeout(function(){var a=n(),c=d,e=f(c);d={};b=null;for(var s=0,l=e.length;s<l;s++)c[e[s]](a)},1E3/60));return l};e.cancelRequestAnimationFrame=function(a){delete d[a];A(d)&&(clearTimeout(b),b=null)}}}})(this);
(function(e){var n=Date.now||function(){return+new Date},f={},A=1;e.core?core.effect||(core.effect={}):e.core={effect:{}};core.effect.Animate={stop:function(c){var d=null!=f[c];d&&(f[c]=null);return d},isRunning:function(c){return null!=f[c]},start:function(c,d,a,b,e,z){var l=n(),m=l,p=0,w=0,k=A++;z||(z=document.body);if(0===k%20){var v={},t;for(t in f)v[t]=!0;f=v}var u=function(g){g=!0!==g;var h=n();if(!f[k]||d&&!d(k))f[k]=null,a&&a(60-w/((h-l)/1E3),k,!1);else{if(g)for(var q=Math.round((h-m)/(1E3/
60))-1,t=0;t<Math.min(q,4);t++)u(!0),w++;b&&(p=(h-l)/b,1<p&&(p=1));q=e?e(p):p;!1!==c(q,h,g)&&1!==p||!g?g&&(m=h,requestAnimationFrame(u,z)):(f[k]=null,a&&a(60-w/((h-l)/1E3),k,1===p||null==b))}};f[k]=!0;requestAnimationFrame(u,z);return k}}})(this);
var EasyScroller=function(e,n){this.content=e;this.container=e.parentNode;this.options=n||{};var f=this;this.scroller=new Scroller(function(e,c,d){f.render(e,c,d)},n);this.bindEvents();this.content.style[EasyScroller.vendorPrefix+"TransformOrigin"]="left top";this.reflow()};
EasyScroller.prototype.render=function(){var e=document.documentElement.style,n;window.opera&&"[object Opera]"===Object.prototype.toString.call(opera)?n="presto":"MozAppearance"in e?n="gecko":"WebkitAppearance"in e?n="webkit":"string"===typeof navigator.cpuClass&&(n="trident");e=EasyScroller.vendorPrefix={trident:"ms",gecko:"Moz",webkit:"Webkit",presto:"O"}[n];n=document.createElement("div");var f=e+"Transform";return void 0!==n.style[e+"Perspective"]?function(e,c,d){this.content.style[f]="translate3d("+
-e+"px,"+-c+"px,0) scale("+d+")"}:void 0!==n.style[f]?function(e,c,d){this.content.style[f]="translate("+-e+"px,"+-c+"px) scale("+d+")"}:function(e,c,d){this.content.style.marginLeft=e?-e/d+"px":"";this.content.style.marginTop=c?-c/d+"px":"";this.content.style.zoom=d||""}}();
EasyScroller.prototype.reflow=function(){this.scroller.setDimensions(this.container.clientWidth,this.container.clientHeight,this.content.offsetWidth,this.content.offsetHeight);var e=this.container.getBoundingClientRect();this.scroller.setPosition(e.left+this.container.clientLeft,e.top+this.container.clientTop)};
EasyScroller.prototype.bindEvents=function(){var e=this;$(window).bind("resize",function(){e.reflow()});$("#modelTab").bind("click",function(){e.reflow()});if("ontouchstart"in window)this.container.addEventListener("touchstart",function(f){f.touches[0]&&f.touches[0].target&&f.touches[0].target.tagName.match(/input|textarea|select/i)||(e.scroller.doTouchStart(f.touches,(new Date).getTime()),f.preventDefault())},!1),document.addEventListener("touchmove",function(f){e.scroller.doTouchMove(f.touches,
(new Date).getTime(),f.scale)},!1),document.addEventListener("touchend",function(f){e.scroller.doTouchEnd((new Date).getTime())},!1),document.addEventListener("touchcancel",function(f){e.scroller.doTouchEnd((new Date).getTime())},!1);else{var n=!1;$(this.container).bind("mousedown",function(f){f.target.tagName.match(/input|textarea|select/i)||(e.scroller.doTouchStart([{pageX:f.pageX,pageY:f.pageY}],(new Date).getTime()),n=!0,f.preventDefault())});$(document).bind("mousemove",function(f){n&&(e.scroller.doTouchMove([{pageX:f.pageX,
pageY:f.pageY}],(new Date).getTime()),n=!0)});$(document).bind("mouseup",function(f){n&&(e.scroller.doTouchEnd((new Date).getTime()),n=!1)});$(this.container).bind("mousewheel",function(f){e.options.zooming&&(e.scroller.doMouseZoom(f.wheelDelta,(new Date).getTime(),f.pageX,f.pageY),f.preventDefault())})}};var Scroller;
(function(){Scroller=function(c,d){this.__callback=c;this.options={scrollingX:!0,scrollingY:!0,animating:!0,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:0.5,maxZoom:3,eventTarget:null};for(var a in d)this.options[a]=d[a]};var e=function(c){return Math.pow(c-1,3)+1},n=function(c){return 1>(c/=0.5)?0.5*Math.pow(c,3):0.5*(Math.pow(c-2,3)+2)},f={__isSingleTouch:!1,__isTracking:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,
__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshDeactivate:null,__refreshStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,
__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(c,d,a,b){c&&(this.__clientWidth=c);d&&(this.__clientHeight=d);a&&(this.__contentWidth=a);b&&(this.__contentHeight=b);this.__computeScrollMax();this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},setPosition:function(c,d){this.__clientLeft=c||0;this.__clientTop=d||0},setSnapSize:function(c,d){this.__snapWidth=c;this.__snapHeight=d},activatePullToRefresh:function(c,d,a,b){this.__refreshHeight=
c;this.__refreshActivate=d;this.__refreshDeactivate=a;this.__refreshStart=b},finishPullToRefresh:function(){this.__refreshActive=!1;this.__refreshDeactivate&&this.__refreshDeactivate();this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},getValues:function(){return{left:this.__scrollLeft,top:this.__scrollTop,zoom:this.__zoomLevel}},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},zoomTo:function(c,d,a,b){if(!this.options.zooming)throw Error("Zooming is not enabled!");
this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1);var e=this.__zoomLevel;null==a&&(a=this.__clientWidth/2);null==b&&(b=this.__clientHeight/2);c=Math.max(Math.min(c,this.options.maxZoom),this.options.minZoom);this.__computeScrollMax(c);a=(a+this.__scrollLeft)*c/e-a;b=(b+this.__scrollTop)*c/e-b;a>this.__maxScrollLeft?a=this.__maxScrollLeft:0>a&&(a=0);b>this.__maxScrollTop?b=this.__maxScrollTop:0>b&&(b=0);this.__publish(a,b,c,d)},zoomBy:function(c,d,a,
b){this.zoomTo(this.__zoomLevel*c,d,a,b)},scrollTo:function(c,d,a,b){$(document).trigger(this.options.eventTarget.attr("id")+".scrolledTo",[c,d,b]);this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1);if(null!=b&&b!==this.__zoomLevel){if(!this.options.zooming)throw Error("Zooming is not enabled!");c*=b;d*=b;this.__computeScrollMax(b)}else b=this.__zoomLevel;this.options.scrollingX?this.options.paging?c=Math.round(c/this.__clientWidth)*this.__clientWidth:
this.options.snapping&&(c=Math.round(c/this.__snapWidth)*this.__snapWidth):c=this.__scrollLeft;this.options.scrollingY?this.options.paging?d=Math.round(d/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(d=Math.round(d/this.__snapHeight)*this.__snapHeight):d=this.__scrollTop;c=Math.max(Math.min(this.__maxScrollLeft,c),0);d=Math.max(Math.min(this.__maxScrollTop,d),0);c===this.__scrollLeft&&d===this.__scrollTop&&(a=!1);this.__publish(c,d,b,a)},scrollBy:function(c,d,a){this.scrollTo((this.__isAnimating?
this.__scheduledLeft:this.__scrollLeft)+(c||0),(this.__isAnimating?this.__scheduledTop:this.__scrollTop)+(d||0),a)},doMouseZoom:function(c,d,a,b){return this.zoomTo(this.__zoomLevel*(0<c?0.97:1.03),!1,a-this.__clientLeft,b-this.__clientTop)},doTouchStart:function(c,d){if(null==c.length)throw Error("Invalid touch list: "+c);d instanceof Date&&(d=d.valueOf());if("number"!==typeof d)throw Error("Invalid timestamp value: "+d);this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=
!1);this.__isAnimating&&(core.effect.Animate.stop(this.__isAnimating),this.__isAnimating=!1);var a,b,e=1===c.length;e?(a=c[0].pageX,b=c[0].pageY):(a=Math.abs(c[0].pageX+c[1].pageX)/2,b=Math.abs(c[0].pageY+c[1].pageY)/2);this.__initialTouchLeft=a;this.__initialTouchTop=b;this.__zoomLevelStart=this.__zoomLevel;this.__lastTouchLeft=a;this.__lastTouchTop=b;this.__lastTouchMove=d;this.__lastScale=1;this.__enableScrollX=!e&&this.options.scrollingX;this.__enableScrollY=!e&&this.options.scrollingY;this.__isTracking=
!0;this.__isDragging=!e;this.__isSingleTouch=e;this.__positions=[]},doTouchMove:function(c,d,a){if(null==c.length)throw Error("Invalid touch list: "+c);d instanceof Date&&(d=d.valueOf());if("number"!==typeof d)throw Error("Invalid timestamp value: "+d);if(this.__isTracking){var b;2===c.length?(b=Math.abs(c[0].pageX+c[1].pageX)/2,c=Math.abs(c[0].pageY+c[1].pageY)/2):(b=c[0].pageX,c=c[0].pageY);var e=this.__positions;if(this.__isDragging){var f=b-this.__lastTouchLeft,l=c-this.__lastTouchTop,m=this.__scrollLeft,
p=this.__scrollTop,n=this.__zoomLevel;if(null!=a&&this.options.zooming){var k=n,n=n/this.__lastScale*a,n=Math.max(Math.min(n,this.options.maxZoom),this.options.minZoom);if(k!==n){var v=b-this.__clientLeft,t=c-this.__clientTop,m=(v+m)*n/k-v,p=(t+p)*n/k-t;this.__computeScrollMax(n)}}this.__enableScrollX&&(m-=f,k=this.__maxScrollLeft,m>k||0>m)&&(m=this.options.bouncing?m+f/2:m>k?k:0);this.__enableScrollY&&(p-=l,f=this.__maxScrollTop,p>f||0>p)&&(this.options.bouncing?(p+=l/2,this.__enableScrollX||null==
this.__refreshHeight||(!this.__refreshActive&&p<=-this.__refreshHeight?(this.__refreshActive=!0,this.__refreshActivate&&this.__refreshActivate()):this.__refreshActive&&p>-this.__refreshHeight&&(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()))):p=p>f?f:0);60<e.length&&e.splice(0,30);e.push(m,p,d);this.__publish(m,p,n)}else l=this.options.locking?3:0,m=Math.abs(b-this.__initialTouchLeft),p=Math.abs(c-this.__initialTouchTop),this.__enableScrollX=this.options.scrollingX&&
m>=l,this.__enableScrollY=this.options.scrollingY&&p>=l,e.push(this.__scrollLeft,this.__scrollTop,d),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(5<=m||5<=p);this.__lastTouchLeft=b;this.__lastTouchTop=c;this.__lastTouchMove=d;this.__lastScale=a}},doTouchEnd:function(c){c instanceof Date&&(c=c.valueOf());if("number"!==typeof c)throw Error("Invalid timestamp value: "+c);if(this.__isTracking){this.__isTracking=!1;if(this.__isDragging&&(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&
100>=c-this.__lastTouchMove)){for(var d=this.__positions,a=d.length-1,b=a,e=a;0<e&&d[e]>this.__lastTouchMove-100;e-=3)b=e;b!==a&&(a=d[a]-d[b],e=this.__scrollTop-d[b-1],this.__decelerationVelocityX=(this.__scrollLeft-d[b-2])/a*(1E3/60),this.__decelerationVelocityY=e/a*(1E3/60),d=this.options.paging||this.options.snapping?4:1,Math.abs(this.__decelerationVelocityX)>d||Math.abs(this.__decelerationVelocityY)>d)&&(this.__refreshActive||this.__startDeceleration(c))}this.__isDecelerating||(this.__refreshActive&&
this.__refreshStart?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):(this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel),this.__refreshActive&&(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate())));this.__positions.length=0}},__publish:function(c,d,a,b){var f=this,z=f.__isAnimating;z&&(core.effect.Animate.stop(z),f.__isAnimating=!1);if(b&&f.options.animating){f.__scheduledLeft=c;f.__scheduledTop=
d;f.__scheduledZoom=a;var l=f.__scrollLeft,m=f.__scrollTop,p=f.__zoomLevel,w=c-l,k=d-m,v=a-p;f.__isAnimating=core.effect.Animate.start(function(a,b,c){c&&(f.__scrollLeft=l+w*a,f.__scrollTop=m+k*a,f.__zoomLevel=p+v*a,f.__callback&&f.__callback(f.__scrollLeft,f.__scrollTop,f.__zoomLevel))},function(a){return f.__isAnimating===a},function(a,b,c){b===f.__isAnimating&&(f.__isAnimating=!1);f.options.zooming&&f.__computeScrollMax()},250,z?e:n)}else f.__scheduledLeft=f.__scrollLeft=c,f.__scheduledTop=f.__scrollTop=
d,f.__scheduledZoom=f.__zoomLevel=a,f.__callback&&f.__callback(c,d,a),f.options.zooming&&f.__computeScrollMax()},__computeScrollMax:function(c){null==c&&(c=this.__zoomLevel);this.__maxScrollLeft=Math.max(this.__contentWidth*c-this.__clientWidth,0);this.__maxScrollTop=Math.max(this.__contentHeight*c-this.__clientHeight,0)},__startDeceleration:function(c){var d=this;if(d.options.paging){c=Math.max(Math.min(d.__scrollLeft,d.__maxScrollLeft),0);var a=Math.max(Math.min(d.__scrollTop,d.__maxScrollTop),
0),b=d.__clientWidth,e=d.__clientHeight;d.__minDecelerationScrollLeft=Math.floor(c/b)*b;d.__minDecelerationScrollTop=Math.floor(a/e)*e;d.__maxDecelerationScrollLeft=Math.ceil(c/b)*b;d.__maxDecelerationScrollTop=Math.ceil(a/e)*e}else d.__minDecelerationScrollLeft=0,d.__minDecelerationScrollTop=0,d.__maxDecelerationScrollLeft=d.__maxScrollLeft,d.__maxDecelerationScrollTop=d.__maxScrollTop;var f=d.options.snapping?4:0.1;d.__isDecelerating=core.effect.Animate.start(function(a,b,c){d.__stepThroughDeceleration(c)},
function(){return Math.abs(d.__decelerationVelocityX)>=f||Math.abs(d.__decelerationVelocityY)>=f},function(a,b,c){d.__isDecelerating=!1;d.scrollTo(d.__scrollLeft,d.__scrollTop,d.options.snapping)})},__stepThroughDeceleration:function(c){var d=this.__scrollLeft+this.__decelerationVelocityX,a=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){var b=Math.max(Math.min(this.__maxScrollLeft,d),0);b!==d&&(d=b,this.__decelerationVelocityX=0);b=Math.max(Math.min(this.__maxScrollTop,a),
0);b!==a&&(a=b,this.__decelerationVelocityY=0)}c?this.__publish(d,a,this.__zoomLevel):(this.__scrollLeft=d,this.__scrollTop=a);this.options.paging||(this.__decelerationVelocityX*=0.95,this.__decelerationVelocityY*=0.95);this.options.bouncing&&(b=c=0,d<this.__minDecelerationScrollLeft?c=this.__minDecelerationScrollLeft-d:d>this.__maxDecelerationScrollLeft&&(c=this.__maxDecelerationScrollLeft-d),a<this.__minDecelerationScrollTop?b=this.__minDecelerationScrollTop-a:a>this.__maxDecelerationScrollTop&&
(b=this.__maxDecelerationScrollTop-a),0!==c&&(this.__decelerationVelocityX=0>=c*this.__decelerationVelocityX?this.__decelerationVelocityX+0.03*c:0.08*c),0!==b&&(this.__decelerationVelocityY=0>=b*this.__decelerationVelocityY?this.__decelerationVelocityY+0.03*b:0.08*b))}},A;for(A in f)Scroller.prototype[A]=f[A]})();

{'fraction_non_alphanumeric': 0.26932352824892264, 'fraction_numerical': 0.03360613608508283, 'mean_word_length': 14.891099476439791, 'pattern_counts': {'":': 63, '<': 401, '<?xml version=': 0, '>': 377, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2952685', 'n_tokens_mistral': 33348, 'n_tokens_neox': 32312, 'n_words': 986}