summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2015-10-28 13:58:45 +0000
committergebele <gebele@in-silico.ch>2015-10-28 13:58:45 +0000
commitd2d8db1e59e830b1a24e9b8d270a3b393d746b6c (patch)
treedfe79a6ae7e14e3cc4c6e0c0544b478d904c37c2
parent41f948d58ba99a635ae7e04573bd368d9ab34d99 (diff)
consisten use of brackets for units; collect measured activity for equal neighbors
-rw-r--r--views/batch.haml3
-rw-r--r--views/neighbors.haml4
2 files changed, 3 insertions, 4 deletions
diff --git a/views/batch.haml b/views/batch.haml
index 8389651..ec987c4 100644
--- a/views/batch.haml
+++ b/views/batch.haml
@@ -44,7 +44,7 @@
%br
%b Prediction:
/ TODO scientific notation
- = prediction[:value].numeric? ? "#{'%.2e' % prediction[:value]} #{model.unit}" : prediction[:value]
+ = prediction[:value].numeric? ? "#{'%.2e' % prediction[:value]} (#{model.unit})" : prediction[:value]
%br
/ TODO probability
%b Confidence:
@@ -53,4 +53,3 @@
- else
%p
= "Not enough similar compounds </br>in training dataset."
- %p
diff --git a/views/neighbors.haml b/views/neighbors.haml
index 21b4b35..a741b45 100644
--- a/views/neighbors.haml
+++ b/views/neighbors.haml
@@ -58,7 +58,7 @@
/ %td
%tbody
- type = @model_types[j]
- - prediction[:neighbors].each_with_index do |neighbor,count|
+ - prediction[:neighbors].uniq.each_with_index do |neighbor,count|
%tr
/ Compound
%td{:style =>"vertical-align:middle;padding-left:1em;width:50%;"}
@@ -67,7 +67,7 @@
%p= Compound.find(neighbor[0]).smiles
/ Measured Activity
%td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"}
- = (type == "Regression") ? neighbor[2].collect{|n| '%.2e' % n + " (#{@models[j].unit})"}.join(", ") : neighbor[2].join(", ")
+ = (type == "Regression") ? neighbor[2].collect{|n| '%.2e' % n + " (#{@models[j].unit})"}.join("</br>") : neighbor[2].join(", ")
/ Similarity
%td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"}
/ TODO differentiate between no neighbors found and compound found in dataset, display neighbors for compounds in dataset?