From 315db036a63defb5465178279cbc3cbffde375eb Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 10 Oct 2017 15:49:36 +0000 Subject: new batch mode with single calls --- views/prediction.haml | 56 +++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 31 deletions(-) (limited to 'views/prediction.haml') diff --git a/views/prediction.haml b/views/prediction.haml index 62bed8b..b5a7e82 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -4,12 +4,6 @@ $('.modal').on('hidden.bs.modal', function () { $(this).removeData('bs.modal'); }); - /*TableExport.prototype.bootstrap = ["btn", "btn-default", "btn-toolbar"]; - var BootstrapTable = document.getElementById('overview'); - new TableExport(BootstrapTable, { - ignoreCSS: ".ignore", - bootstrap: true, - });*/ }); %div.well @@ -24,7 +18,7 @@ %tr %td{:id=>"compound"} %b.title Compound - %p= embedded_svg @compound.svg, class: '.ignore', title: "#{@compound.smiles}" + %p= embedded_svg(@compound.svg, title: @compound.smiles) %p= @compound.smiles - @model_types = {} - @dbhit = {} @@ -47,6 +41,16 @@ %p %b Structural alerts: %p + / check for database hit + - if prediction[:info] =~ /\b(identical)\b/i + - @dbhit[i] = true + / show message about dbhit and measurements + %p + :plain + This compound was part of the training dataset. All information
+ from this compound was removed from the training data before the
+ prediction, to obtain unbiased results. + %p %b Prediction: %br =(hash[:prediction] == true ? "mutagenic" : "non-mutagenic") @@ -71,19 +75,20 @@ - if prediction[:info] =~ /\b(identical)\b/i - @dbhit[i] = true / show message about dbhit and measurements - %p - :plain - This compound was part of the training dataset. All information
- from this compound was removed from the training data before the
- prediction, to obtain unbiased results. + - unless sa_prediction %p - %b Measured activity: - %br - - if prediction[:measurements].is_a?(Array) - = (type == "Regression") ? prediction[:measurements].collect{|value| "#{value.delog10.signif(3)} (#{unit})
#{@compound.mmol_to_mg(value.delog10).signif(3)} #{unit =~ /mmol\/L/ ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : prediction[:measurements].join(", ") - - else - = (type == "Regression") ? "#{prediction[:measurements].delog10.signif(3)} (#{unit})
#{@compound.mmol_to_mg(prediction[:measurements].delog10).signif(3)} #{(unit =~ /\b(mmol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:measurements] - + :plain + This compound was part of the training dataset. All information
+ from this compound was removed from the training data before the
+ prediction, to obtain unbiased results. + %p + %b Measured activity: + %br + - if prediction[:measurements].is_a?(Array) + = (type == "Regression") ? prediction[:measurements].collect{|value| "#{value.delog10.signif(3)} (#{unit})
#{@compound.mmol_to_mg(value.delog10).signif(3)} #{unit =~ /mmol\/L/ ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : prediction[:measurements].join(", ") + - else + = (type == "Regression") ? "#{prediction[:measurements].delog10.signif(3)} (#{unit})
#{@compound.mmol_to_mg(prediction[:measurements].delog10).signif(3)} #{(unit =~ /\b(mmol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:measurements] + - else - @dbhit[i] = false @@ -111,17 +116,6 @@ %br = "#{prediction[:probabilities].keys[1]}: #{prediction[:probabilities].values[1].signif(3)}" - / show warnings and info - -#%p - - if !prediction[:info].blank? - %b Info: - %br - %p=prediction[:info].sub(/\'.*\'/,"").sub(/,/, ",
") - - if !prediction[:warnings].blank? - %b Warnings: - - prediction[:warnings].uniq.each do |warning| - %br - %p=warning.sub(/,/, ",
") - else %p - if !prediction[:info].blank? @@ -148,6 +142,6 @@ / always show the neighbors table, message is given there. Except only Cramer is selected. - unless @predictions.blank? - = haml :neighbors, :layout => false, :model_type => @model_types, :dbhit => @dbhit + = haml :neighbors, :layout => false -- cgit v1.2.3