genevalidatorapp 1.4.13 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/Rakefile +5 -1
  4. data/bin/genevalidatorapp +227 -73
  5. data/config.ru +1 -1
  6. data/genevalidatorapp.gemspec +7 -6
  7. data/lib/genevalidatorapp.rb +247 -0
  8. data/lib/{GeneValidatorApp → genevalidatorapp}/config.rb +7 -6
  9. data/lib/{GeneValidatorApp → genevalidatorapp}/database.rb +8 -13
  10. data/lib/genevalidatorapp/exceptions.rb +162 -0
  11. data/lib/{GeneValidatorApp → genevalidatorapp}/genevalidator.rb +52 -58
  12. data/lib/{GeneValidatorApp → genevalidatorapp}/logger.rb +0 -0
  13. data/lib/genevalidatorapp/routes.rb +81 -0
  14. data/lib/genevalidatorapp/server.rb +63 -0
  15. data/lib/{GeneValidatorApp → genevalidatorapp}/version.rb +1 -1
  16. data/public/{web_files → src}/css/bootstrap1.min.css +0 -0
  17. data/public/{web_files → src}/css/custom.css +8 -13
  18. data/public/{web_files → src}/css/custom.min.css +0 -0
  19. data/public/{web_files → src}/css/font-awesome.min.css +0 -0
  20. data/public/{web_files → src}/js/bionode-seq.min.js +0 -0
  21. data/public/{web_files → src}/js/bootstrap.min.js +0 -0
  22. data/public/{web_files → src}/js/d3.v3.min.js +0 -0
  23. data/public/{web_files → src}/js/genevalidator.js +44 -49
  24. data/public/{web_files → src}/js/jquery.cookie.min.js +0 -0
  25. data/public/{web_files → src}/js/jquery.min.js +0 -0
  26. data/public/{web_files → src}/js/jquery.tablesorter.min.js +0 -0
  27. data/public/{web_files → src}/js/jquery.validate.min.js +0 -0
  28. data/public/src/js/plots.js +814 -0
  29. data/public/web_files/css/GV_compiled_css.min.css +15 -0
  30. data/public/web_files/js/GV_compiled_js.min.js +34 -0
  31. data/spec/app_spec.rb +1 -1
  32. data/spec/database_spec.rb +2 -2
  33. data/views/index.slim +1 -1
  34. data/views/layout.slim +15 -24
  35. data/views/results.slim +54 -0
  36. metadata +39 -35
  37. data/lib/GeneValidatorApp.rb +0 -321
  38. data/public/web_files/css/bootstrap.min.css +0 -7
  39. data/public/web_files/js/genevalidator.min.js +0 -1
  40. data/public/web_files/js/plots.js +0 -744
  41. data/public/web_files/js/plots.min.js +0 -1
@@ -1 +0,0 @@
1
- function showDiv(t,a){"use strict";if(window.chrome&&"file:"===window.location.protocol)return void(0===$("#browser-alert").length&&($("#browseralertText").html("<stong>Sorry, this feature is not supported in your browser."),$("#browseralert").modal()));var e="#"+a+"explanation";$(e).length&&$(e).remove();var r=document.getElementById(a);if("pressed"===t.status)r.style.display="none",$(r).parent().parent().hide();else{d3.select("#".concat(a)).selectAll("svg").remove(),r.style.display="block",$(r).parent().parent().show();for(var n=document.querySelectorAll("td"),l=0;l<n.length;l++)"pressed"===n[l].status&&(n[l].status="released")}t.status="pressed"==t.status?"released":"pressed"}function AddExplanation(t,a){"use strict";var e="#"+a+"row",r="<p><b>Approach:</b> "+t.getAttribute("data-approach")+"</p>",n="<p><b>Explanation:</b> "+t.getAttribute("data-explanation")+"</p>",l="<p><b>Conclusion:</b> "+t.getAttribute("data-conclusion")+"</p>",o=$('<div id="'+a+'explanation" class="alert alert-info explanation_alert" role="alert">'+r+n+l+"</div>");"pressed"===t.status&&$(e).prepend(o)}function addPlot(t,a,e,r,n,l,o,s,i){"use strict";var c;switch(c=""===n?[]:n.split(";"),e){case"scatter":plot_scatter(a,t,r,n,l,o,s,i);break;case"bars":plot_bars(a,t,r,c,l,o,s);break;case"simplebars":plot_simple_bars(a,t,r,c,l,o);break;case"lines":""!==i&&(i=i.split(",")),plot_lines(a,t,r,c,l,o,s,i);break;case"align":""!==i&&(i=i.split(",")),plot_align(a,t,r,c,l,o,s,i)}}function color_beautification(t){"use strict";switch(t){case"red":return d3.rgb(189,54,47);case"blue":return d3.rgb(58,135,173);case"green":return d3.rgb(70,136,71);case"yellow":return d3.rgb(255,255,51);case"orange":return d3.rgb(248,148,6);case"violet":return d3.rgb(153,0,153);case"gray":return d3.rgb(160,160,160);default:return t}}function plot_bars(t,a,e,r,n,l,o){var s={top:70,right:50,bottom:75,left:50},i=600-s.left-s.right,c=500-s.top-s.bottom,d=d3.select("#".concat(a)).append("svg").attr("width",i+s.left+s.right).attr("height",c+s.top+s.bottom).append("g").attr("transform","translate("+s.left+","+s.top+")");d.append("text").attr("x",i/2).attr("y",-45).attr("text-anchor","middle").style("font-size","16px").text(e);var p=new Array("orange","blue","green","yellow","brown"),u=p.length,x=100;d3.json(t,function(t,a){flattened_data=[].concat.apply([],a);var e=d3.max(flattened_data,function(t){return t.value})+3,r=d3.scale.linear().domain([0,e+e/10]).range([c,0]),s=d3.min(flattened_data,function(t){return t.key});if(void 0!=o)var s=Math.min(s,o);var f=d3.max(flattened_data,function(t){return t.key});if(void 0!=o)var f=Math.max(f,o);var g=d3.scale.linear().domain([s-x,f+x]).range([13,i]),h=d3.svg.axis().scale(g).orient("bottom").ticks(8),y=d3.svg.axis().scale(r).orient("left").tickFormat(d3.format("d")).ticks(8);d.append("g").attr("class","x axis").attr("transform","translate(0,"+c+")").call(h).append("text").attr("class","label").attr("x",(i-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),d.append("g").attr("class","y axis").call(y).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(c+l.length)/2-50).attr("y",-40).style("text-anchor","start").text(l),a.map(function(t,a){color=p[a%(u-1)],d.selectAll(".bar").data(t).enter().append("rect").attr("x",function(t){return g(t.key)}).attr("width",6).attr("y",function(t){return r(t.value)}).attr("height",function(t){return c-r(t.value)}).attr("fill",function(t){return color_beautification(1==t.main?"red":"blue")})}),void 0!=o&&(d.append("rect").attr("x",g(o)).attr("width",4).attr("y",r(e+e/10)).style("opacity",.6).attr("height",c-r(e+e/8)).attr("fill",color_beautification("black")),d.append("text").attr("transform","rotate(-90)").attr("x",-e/10-35).attr("y",g(o)-5).text("query"))});for(var f=0,g=0,h=0;h<r.length;h++){var y=r[h].split(",");g=g+8*y[0].length+15}for(var h=0;h<r.length;h++){var y=r[h].split(",");d.append("rect").attr("x",(i-g)/2+f).attr("y",-30).attr("width",10).attr("height",10).style("fill",color_beautification(y[1].replace(/\s+/g,""))),d.append("text").attr("x",(i-g)/2+f+15).attr("y",-20).text(y[0]),f=f+8*y[0].length+15}}function plot_simple_bars(t,a,e,r,n,l){"use strict";var o={top:70,right:50,bottom:75,left:50},s=600-o.left-o.right,i=500-o.top-o.bottom,c=d3.select("#".concat(a)).append("svg").attr("width",s+o.left+o.right).attr("height",i+o.top+o.bottom).append("g").attr("transform","translate("+o.left+","+o.top+")");c.append("text").attr("x",s/2).attr("y",-45).attr("text-anchor","middle").style("font-size","16px").text(e);var d=new Array("orange","blue","green","yellow","brown"),p=d.length,u=0;d3.json(t,function(t,a){flattened_data=[].concat.apply([],a);var e=d3.max(flattened_data,function(t){return t.value})+3,r=d3.scale.linear().domain([0,e]).range([i,0]),o=d3.min(flattened_data,function(t){return t.key}),x=d3.max(flattened_data,function(t){return t.key}),f=d3.scale.linear().domain([o-u,x+u]).range([13,s]),g=d3.svg.axis().scale(f).orient("bottom").ticks(8),h=d3.svg.axis().scale(r).orient("left").tickFormat(d3.format("d")).ticks(8);c.append("g").attr("class","x axis").attr("transform","translate(0,"+i+")").call(g).append("text").attr("class","label").attr("x",(s-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),c.append("g").attr("class","y axis").call(h).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(i+l.length)/2-50).attr("y",-40).style("text-anchor","start").text(l),a.map(function(t,a){color=d[a%(p-1)],c.selectAll(".bar").data(t).enter().append("rect").attr("x",function(t){return f(t.key)}).attr("width",6).attr("y",function(t){return r(t.value)}).attr("height",function(t){return i-r(t.value)}).attr("fill",function(t){return color_beautification(1==t.main?"red":"blue")})})})}function plot_scatter(t,a,e,r,n,l,o,s){"use strict";var i={top:50,right:30,bottom:75,left:50},c=500-i.left-i.right,d=500-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]),x=(d3.scale.category10(),d3.svg.axis().scale(p).orient("bottom").ticks(8)),f=d3.svg.axis().scale(u).orient("left").tickFormat(d3.format("d")).ticks(8),g=d3.select("#".concat(a)).append("svg").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");g.append("text").attr("x",c/2).attr("y",-25).attr("text-anchor","middle").style("font-size","16px").text(e),g.append("text").attr("x",c/2).attr("y",d+55).attr("text-anchor","middle").style("font-size","12px").text(r),d3.json(t,function(t,a){var e=d3.max(a,function(t){return t.x}),r=d3.min(a,function(t){return t.x}),i=d3.max(a,function(t){return t.y}),h=d3.min(a,function(t){return t.y});if(p.domain(d3.extent(a,function(t){return t.x})).nice(),u.domain(d3.extent(a,function(t){return t.y})).nice(),g.append("g").attr("class","x axis").attr("transform","translate(0,"+d+")").call(x).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),g.append("g").attr("class","y axis").call(f).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+l.length)/2-50).attr("y",-40).style("text-anchor","start").text(l),g.selectAll(".dot").data(a).enter().append("circle").attr("r",2).attr("cx",function(t){return p(t.x)}).attr("cy",function(t){return u(t.y)}).style("fill",function(){return color_beautification("red")}).style("opacity",.6),void 0!=s&&""!=s&&void 0!=o&&""!=o){o=parseFloat(o.replace(",","."));var y=e,m=o+s*e;m>i&&(y=(i-o)/s,m=i),h>m&&(y=(h-o)/s,m=h);var b=r,v=o+s*r;v>i&&(b=(i-o)/s,v=h),h>v&&(b=(h-o)/s,v=h),g.append("line").attr("x1",p(b)).attr("y1",u(v)).attr("x2",p(y)).attr("y2",u(m)).attr("stroke-width",2).attr("stroke","black")}})}function plot_lines(t,a,e,r,n,l,o,s){"use strict";{var i={top:70,right:50,bottom:75,left:50},c=600-i.left-i.right,d=500-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]);d3.scale.category10()}if("Open Reading Frames in all 6 Frames"===e)var x=d3.svg.axis().scale(p).orient("bottom").ticks(0);else var x=d3.svg.axis().scale(p).orient("bottom").ticks(5);var f=d3.svg.axis().scale(u).orient("left").ticks(5),g=d3.select("#".concat(a)).append("svg").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");g.append("text").attr("x",c/2).attr("y",-35).attr("text-anchor","middle").style("font-size","16px").text(e),d3.json(t,function(t,a){var e=-1;p.domain([0,d3.max(a,function(t){return t.stop})]),u.domain(d3.extent(a,function(t){return t.y})).nice(),g.append("g").attr("class","x axis").attr("transform","translate(0,"+(d+d/o)+")").call(x).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),""!=s?g.append("g").attr("class","y axis").call(f.ticks(s.length).tickFormat(function(){return e+=1,s[e]})).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+l.length)/2-50).attr("y",-40).style("text-anchor","start").text(l):g.append("g").attr("class","y axis").call(f).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+l.length)/2).attr("y",-40).style("text-anchor","start").text(l),g.selectAll(".dot").data(a).enter().append("line").attr("x1",function(t){return p(t.start)}).attr("y1",function(t){return u(t.y)}).attr("x2",function(t){return p(t.stop)}).attr("x2",function(t){return p(t.stop)}).attr("y2",function(t){return u(t.y)}).attr("stroke-width",function(t){return void 0==t.dotted?"red"==t.color?d/o/2.5:d/o:d/o/5}).style("stroke-dasharray",function(t){return void 0==t.dotted?"0, 0":"2, 6"}).attr("stroke",function(t){return color_beautification(t.color)})});for(var h=(g.append("g").attr("class","legend").attr("height",100).attr("width",100).attr("transform","translate(-20,50)"),40),y=0,m=0;m<r.length;m++){var b=r[m].split(",");y=y+8*b[0].length+15}for(var m=0;m<r.length;m++){var b=r[m].split(",");g.append("rect").attr("x",(c-y)/2+h).attr("y",-30).attr("width",10).attr("height",10).style("fill",color_beautification(b[1].replace(/\s+/g,""))),g.append("text").attr("x",(c-y)/2+h+15).attr("y",-20).text(b[0]),h=h+8*b[0].length+15}}function plot_align(t,a,e,r,n,l,o,s){"use strict";var i={top:75,right:50,bottom:75,left:150},c=600-i.left-i.right,d=300-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]),x=(d3.scale.category10(),d3.svg.axis().scale(p).orient("bottom").ticks(5)),f=d3.svg.axis().scale(u).orient("left").ticks(5),g=d3.select("#".concat(a)).append("svg").style("vertical-align","top").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");g.append("text").attr("x",c/2).attr("y",-35).attr("text-anchor","middle").style("font-size","16px").text(e),d3.json(t,function(t,a){var e=-1;p.domain([0,d3.max(a,function(t){return t.stop})]),u.domain(d3.extent(a,function(t){return t.y})).nice(),g.append("g").attr("class","x axis").attr("transform","translate(0,"+(d+d/o)+")").call(x).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),""!=s?g.append("g").attr("class","y axis").call(f.ticks(s.length).tickFormat(function(){return e+=1,s[e]})).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+l.length)/2-50).attr("y",-40).style("text-anchor","start").text(l):g.append("g").attr("class","y axis").call(f).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+l.length)/2-50).attr("y",-40).style("text-anchor","start").text(l),g.selectAll(".dot").data(a).enter().append("line").attr("x1",function(t){return p(t.start)}).attr("y1",function(t){return u(t.y)}).attr("x2",function(t){return p(t.stop)}).attr("y2",function(t){return u(t.y)}).attr("stroke-width",function(t){return-1==t.height?d/o:d/o*t.height}).attr("stroke",function(t){return color_beautification(t.color)})});for(var h=0,y=0,m=0;m<r.length;m++){var b=r[m].split(",");y=y+8*b[0].length+15}for(var m=0;m<r.length;m++){var b=r[m].split(",");g.append("rect").attr("x",(c-y)/2+h).attr("y",-30).attr("width",10).attr("height",10).style("fill",color_beautification(b[1].replace(/\s+/g,""))),g.append("text").attr("x",(c-y)/2+h+15).attr("y",-20).text(b[0]),h=h+8*b[0].length+15}}