From a1e050bb6b4b4ddd37881daa74d7f12dccce0b0f Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 20 Oct 2017 12:50:37 +0000 Subject: adjusted order of elements --- views/batch.haml | 34 ++++++++++++++++------------------ views/predict.haml | 2 +- views/prediction.haml | 42 +++++++++++++++++++++--------------------- 3 files changed, 38 insertions(+), 40 deletions(-) (limited to 'views') diff --git a/views/batch.haml b/views/batch.haml index aaa09bf..fccd88c 100644 --- a/views/batch.haml +++ b/views/batch.haml @@ -26,10 +26,10 @@ // create request if (model == "Cramer"){ var dataset = '#{@dataset.id}'; - var uri = "#{to("/batch/")}" + model + '/?dataset=' + escape(dataset) + '&tmppath=' + tmppath + '&last=' + last; + var uri = "#{to("/batch/")}" + model + '/?dataset=' + escape(dataset) + '&tmppath=' + tmppath; } else { var dataset = '#{@dataset.id}'; - var uri = "#{to("/batch/")}" + model + '/?compound=' + escape(compound) + '&dataset=' + dataset + '&idx=' + idx + '&tmppath=' + tmppath + '&last=' + last; + var uri = "#{to("/batch/")}" + model + '/?compound=' + escape(compound) + '&dataset=' + dataset + '&idx=' + idx + '&tmppath=' + tmppath; }; var aClient = new HttpClient(); aClient.get(uri, function(res) { @@ -56,15 +56,20 @@ if (response['db_hit'] != false){ var value = document.createTextNode(response['db_hit']); p.appendChild(value); + var h2 = document.createElement("h5"); + var t = document.createTextNode("Measurements:"); + h2.appendChild(t); + p.appendChild(h2); + for (var i=0; i"javascript:void(0)", :title=>"File format", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"auto", html:"true", content:"One column with compounds and keyword SMILES or InChI in the first row."}} %br %span.btn.btn-default.btn-file - %input{:type=>"file", :name=> "fileselect", :id=>"fileselect", :accept=>"text/csv"} + %input{:type=>"file", :name=> "fileselect", :id=>"fileselect", :autocomplete=>"off", :accept=>"text/csv"} %fieldset#middle.well %h2 2. Select one or more endpoints diff --git a/views/prediction.haml b/views/prediction.haml index b5a7e82..872ee1e 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -38,39 +38,34 @@ - if sa_prediction - hash = sa_prediction[:prediction] - confidence = sa_prediction[:confidence] - %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: + %b Measured activity: + %br + = prediction[:measurements].join("; ") + %b Consensus prediction: %br =(hash[:prediction] == true ? "mutagenic" : "non-mutagenic") %p - %b Confidence: + %b Consensus confidence: %br =confidence.to_f.signif(3) %p %b Structural alerts for mutagenicity: %br - =hash[:matches].flatten.first - %p + =hash[:matches].blank? ? "none" : hash[:matches].join("; ") / check for prediction + %p - if prediction[:neighbors] and !prediction[:value].nil? %b.title= ("Lazar #{@models[i].endpoint.gsub('_', ' ').downcase} (#{@models[i].species}):" if sa_prediction) %p - / show model type (classification|regression) - %b Type: - = type - %p / check for database hit - if prediction[:info] =~ /\b(identical)\b/i - @dbhit[i] = true @@ -81,14 +76,14 @@ 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 + %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 @@ -116,16 +111,23 @@ %br = "#{prediction[:probabilities].keys[1]}: #{prediction[:probabilities].values[1].signif(3)}" + %p + - if !prediction[:warnings].blank? + %b Warnings: + %br + =prediction[:warnings].join("
") + - else %p - if !prediction[:info].blank? - %b Info: - %br - %p=prediction[:info].sub(/\'.*\'/,"").sub(/,/, ",
") + :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. - if !prediction[:warnings].blank? %b Warnings: - - prediction[:warnings].uniq.each do |warning| - %p=warning.sub(/,/, ",
") + %br + =prediction[:warnings].join("
") / show Cramer rules if checked - if @toxtree == true @@ -143,5 +145,3 @@ / always show the neighbors table, message is given there. Except only Cramer is selected. - unless @predictions.blank? = haml :neighbors, :layout => false - - -- cgit v1.2.3