summaryrefslogtreecommitdiff
path: root/views/neighbors.haml
diff options
context:
space:
mode:
Diffstat (limited to 'views/neighbors.haml')
-rw-r--r--views/neighbors.haml6
1 files changed, 4 insertions, 2 deletions
diff --git a/views/neighbors.haml b/views/neighbors.haml
index a741b45..4a1f3ea 100644
--- a/views/neighbors.haml
+++ b/views/neighbors.haml
@@ -65,9 +65,11 @@
/%a.btn.btn-link{:href => "#details#{j+1}", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(neighbor[0].to_s)}/details"), :id=>"link#{j+1}#{count}"}}
%p= Compound.find(neighbor[0]).svg
%p= Compound.find(neighbor[0]).smiles
+ - c = Compound.find(neighbor[0])
+ - mw = c.molecular_weight
/ Measured Activity
- %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"}
- = (type == "Regression") ? neighbor[2].collect{|n| '%.2e' % n + " (#{@models[j].unit})"}.join("</br>") : neighbor[2].join(", ")
+ %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;white-space:nowrap;"}
+ = (type == "Regression") ? neighbor[2].collect{|n| weight = c.mmol_to_mg(n, mw); '%.2e' % n + " (#{@models[j].unit})"+"|#{'%.2e' % weight} (mg/kg_bw/day)"}.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?