summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2017-10-20 12:50:37 +0000
committergebele <gebele@in-silico.ch>2017-10-20 12:50:37 +0000
commita1e050bb6b4b4ddd37881daa74d7f12dccce0b0f (patch)
treea22832322dee98bcb2ee282a31df011b8aa8f054 /views
parent315db036a63defb5465178279cbc3cbffde375eb (diff)
adjusted order of elements
Diffstat (limited to 'views')
-rw-r--r--views/batch.haml34
-rw-r--r--views/predict.haml2
-rw-r--r--views/prediction.haml42
3 files changed, 38 insertions, 40 deletions
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<response['measurements'].length; i++){
+ var value = document.createTextNode(response['measurements'][i]);
+ var br = document.createElement("br");
+ p.appendChild(value);
+ p.appendChild(br);
+ };
};
- // Structural alerts
- var h2 = document.createElement("h5");
- var t = document.createTextNode("Structural alerts:");
- h2.appendChild(t);
- p.appendChild(h2);
- // prediction
+ // Consensus prediction
var h3 = document.createElement("h5");
- var t = document.createTextNode("Prediction:");
+ var t = document.createTextNode("Consensus prediction:");
if (response['sa_prediction']['prediction'] == false){
var value = document.createTextNode("non-mutagenic");
};
@@ -74,9 +79,9 @@
h3.appendChild(t);
p.appendChild(h3);
p.appendChild(value);
- // confidence
+ // Consensus confidence
var h4 = document.createElement("h5");
- var t = document.createTextNode("Confidence:");
+ var t = document.createTextNode("Consensus confidence:");
var value = document.createTextNode(response['confidence']);
h4.appendChild(t);
p.appendChild(h4);
@@ -110,13 +115,6 @@
var value = document.createTextNode(response['model_name']);
h.appendChild(value);
p.appendChild(h);
- } else if (val == "type") {
- var t = document.createTextNode("Type: ");
- var value = document.createTextNode(response['model_type']);
- h.appendChild(t);
- p.appendChild(h);
- p.appendChild(value);
- h.style.display = "inline";
} else if (val == "db_hit" && response['db_hit'] != false && response['sa_prediction'] == false) {
var value = document.createTextNode(response['db_hit']);
p.appendChild(value);
diff --git a/views/predict.haml b/views/predict.haml
index eb9047b..6b1c462 100644
--- a/views/predict.haml
+++ b/views/predict.haml
@@ -130,7 +130,7 @@
%a.btn.glyphicon.glyphicon-info-sign{:href=>"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. <i>All</i> information </br>
from this compound was removed from the training data before the </br>
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. <i>All</i> information </br>
from this compound was removed from the training data before the </br>
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})</br>#{@compound.mmol_to_mg(value.delog10).signif(3)} #{unit =~ /mmol\/L/ ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("</br>") : prediction[:measurements].join(", ")
- else
= (type == "Regression") ? "#{prediction[:measurements].delog10.signif(3)} (#{unit})</br>#{@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("</br>")
+
- else
%p
- if !prediction[:info].blank?
- %b Info:
- %br
- %p=prediction[:info].sub(/\'.*\'/,"").sub(/,/, ",<br>")
+ :plain
+ This compound was part of the training dataset. <i>All</i> information </br>
+ from this compound was removed from the training data before the </br>
+ prediction, to obtain unbiased results.
- if !prediction[:warnings].blank?
%b Warnings:
- - prediction[:warnings].uniq.each do |warning|
- %p=warning.sub(/,/, ",<br>")
+ %br
+ =prediction[:warnings].join("</br>")
/ 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
-
-