js.sorta-result-anonymous.min.js Maven / Gradle / Ivy
(function(e,c){var b="N/A";var a=null;var d=100;c.SortaAnonymous=function f(g){a=g};c.SortaAnonymous.prototype.renderPage=function(){a.children("div.row:gt(0)").remove();var F=e("").addClass("row").css("margin-bottom","15px").appendTo(a);e("").addClass("col-md-offset-3 col-md-4").append("Current threshold : "+d+"%").css("padding-left","0px").appendTo(F);var w=e("").attr("type","button").addClass("btn btn-default").text("Update");var h=e("").addClass("input-group-btn").append(w);var n=e('');var i=e("").addClass("input-group pull-right").append(h).append(n);e("").addClass("col-md-2").css("padding-right","0px").append(i).appendTo(F);var m=e("").addClass("row").appendTo(a);var j=e("").addClass("col-md-offset-3 col-md-6 well").appendTo(m);var r=e("").addClass("row").appendTo(j);var l=e("").attr("type","button").addClass("btn btn-primary pull-right").text("Show");var E=e("");e("").addClass("col-md-12").append("Total number of match results is ").append(E).append(l).appendTo(r);var g=e("").addClass("row").prepend("
").appendTo(j);var p=e("").attr("type","button").addClass("btn btn-info pull-right").text("Show");var o=e("");e("").addClass("col-md-12").append("Total number of unmatch results is ").append(o).append(p).appendTo(g);var B=e("").addClass("row").prepend("
").appendTo(j);var C=e("").attr("type","button").addClass("btn btn-primary").text("Download");var t=e("").attr("type","button").addClass("btn btn-default").html("New task ").append(' ');e("").addClass("col-md-2").append(C).appendTo(B);e("").addClass("col-md-2").append(t).appendTo(B);e(t).click(function(){a.attr({action:c.getContextUrl(),method:"GET"}).submit()});e(C).click(function(){a.attr({action:c.getContextUrl()+"/download/",method:"GET"}).submit()});e(h).click(function(){var G=Number(e(n).val());if(G&&G!==d){d=G;c.SortaAnonymous.prototype.renderPage()}});e(n).keydown(function(G){if(G.keyCode===13){e(h).click()}});s(function(G){var H=[];var I=[];e.each(G,function(K,J){if(J.ontologyTerm.length>0){var L=J.ontologyTerm[0].Combined_Score;if(L&&L.toFixed(2)>=d){H.push(J)}else{I.push(J)}}else{I.push(J)}});E.html(""+H.length+"");o.html(""+I.length+"");l.click(function(){A(H,true)});p.click(function(){A(I,false)}).click()});function s(G){e.ajax({type:"GET",url:c.getContextUrl()+"/retrieve",contentType:"application/json",success:function(H){if(G!==null&&typeof G==="function"){G(H)}}})}function A(M,J){if(e("#sorta-result-table")){e("#sorta-result-table").remove()}var L=e("").attr("id","sorta-result-table").addClass("row").appendTo(a);if(M.length>0){var G=e("Adjusted score ?").css({cursor:"pointer"}).popover({title:"Explanation",content:'Adjusted scores are derived from the original scores (lexical similarity) combined with the weight of the words (inverse document frequency)
',placement:"top",trigger:"hover",html:true});var I=e("").css("font-size","20px").append(""+(J?"Matched results":"Unmatched results")+"");var K=e("
").addClass("table");var H=e(" ").appendTo(K);e(" ").append("Input term").appendTo(H);e(" ").append("Ontologgy terms").appendTo(H);e(" ").append("Score").appendTo(H);e(" ").append(G).appendTo(H);e(" ").append("Match").appendTo(H);e.each(M,function(O,N){var P=e(" ").appendTo(K);var Q=N.ontologyTerm?N.ontologyTerm[0]:null;e(" ").append(z(N.inputTerm)).appendTo(P);e(" ").append(y(Q)).appendTo(P);e(" ").append(x(Q)).appendTo(P);e(" ").append(q(Q)).appendTo(P);e(" ").append(Q?'':b).appendTo(P);P.find("button:eq(0)").click(function(){var R=e("").attr("type","button").addClass("btn btn-danger pull-right").css({"margin-top":"-10px","margin-bottom":"10px"}).text("Clear").insertBefore(K);K.find("tr:not(:first-child)").hide();K.find("tr >th:last-child").hide();K.append(k(N));R.click(function(){K.find("tr:visible:not(:first-child)").remove();K.find("tr").show();K.find("th").show();e(this).remove()})})});e("").addClass("col-md-offset-1 col-md-10").append(I).append(K).appendTo(L)}else{e("").addClass("col-md-offset-3 col-md-6").text("No matches are found!").appendTo(L)}return L}function k(H,I){var G=[];if(H.ontologyTerm){e.each(H.ontologyTerm,function(J,K){if(J>=10){return}var L=e(" ");e(" ").append(J==0?z(H.inputTerm):"").appendTo(L);e(" ").append(y(K)).appendTo(L);e(" ").append(x(K)).appendTo(L);e(" ").append(q(K)).appendTo(L);G.push(L)})}return G}function z(H){var G=e("");e.map(H,function(J,I){G.append(I+" : "+J).append("
")});return G}function y(J){var H=e("");if(J){var I=D(J);var K=u(J);var G=v(J);H.append(I).append(K).append(G)}else{H.append(b)}return H}function D(G){return e("").append("Name : ").append(''+G.ontologyTermName+"")}function v(H){var G=[];if(H.ontologyTermDynamicAnnotation.length>0){var I={};e.each(H.ontologyTermDynamicAnnotation,function(K,J){if(!I[J.name]){I[J.name]=[]}I[J.name].push(J.value)});e.map(I,function(K,J){G.push(e("").append(J+" : "+K.join(", ")))})}return G}function u(H){var I=e("Synonym : ");if(H){var G=[];e.each(H.ontologyTermSynonym,function(K,J){G.push(J.ontologyTermSynonym)});if(G.length==1){I.append(G.join())}else{I.addClass("show-popover").append(""+G.length+" synonyms, see more details").popover({content:G.join("
"),placement:"auto",trigger:"hover",html:true})}}else{I.append(b)}return I}function x(G){return G?e("").append(G.Score.toFixed(2)+"%"):b}function q(G){return G?e("").append(G.Combined_Score.toFixed(2)+"%"):b}}}($,window.top.molgenis=window.top.molgenis||{}));
© 2015 - 2025 Weber Informatics LLC | Privacy Policy