summaryrefslogtreecommitdiff
path: root/views/prediction.haml
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2013-03-07 11:05:18 +0100
committergebele <gebele@in-silico.ch>2013-03-07 11:05:18 +0100
commitb5f22735b2f73456a885b2961be8556df62589f2 (patch)
tree5a41d38338edf7fcf36adba959a6952693313c1a /views/prediction.haml
parent0c2554a5a2c3aebf3e99d70fee2075a9b99f9abe (diff)
works for single prediction
Diffstat (limited to 'views/prediction.haml')
-rw-r--r--views/prediction.haml84
1 files changed, 67 insertions, 17 deletions
diff --git a/views/prediction.haml b/views/prediction.haml
index 1286d52..48a55ce 100644
--- a/views/prediction.haml
+++ b/views/prediction.haml
@@ -2,25 +2,75 @@
.back
%h1
%img{:src=>"/images/arrow_left_float.png", :alt=>"arrow"}
- %a{:href => to('/predict')} New Prediction
+ %a{:href => to('/predict')} New Prediction
+
- .was
- %h2= "Compound image: "
- %img{:src=>"#{@compound.uri}/image", :alt=>@compound.uri, :width=>"100px"}
- %br
- %h2= "Compound SMILES string: "
- %p= @identifier
.results
%h2= "Selected Entpoints: "
- - @models.each do |m|
- %p= m.inspect
- %br
- %h2= "Prediction Uri: "
- - @predictions.each do |p|
- %p= p.uri
- %br
- %h2= "Prediction Results: "
- - @prediction_results.each do |r|
- %p= r
+ - @prediction_models.each do |m|
+ %a{:href => "#results_#{m.title}", :id => "link#{m.title}"}
+ = m.title
+ :javascript
+ $("a#link#{m.title}").click(function () {
+ $("#results_#{m.title}").toggle();
+ });
+
+ #results{:id=>"#{m.title}", :style=>"display: none"}
+ %h2= "Prediction Uri: "
+ - @predictions.each do |p|
+ %p= p.uri
+
+
+ %h2= "Predicted Compound: "
+ - @prediction_compound.each do |compound|
+ %img{:src=>"#{compound.uri}/image", :alt=>compound.uri, :width=>"100px"}
+ %p= compound.smiles
+
+ %h2= "Prediction: "
+ - @prediction_values.each do |p|
+ %p= p[1]
+ %h2= "Confidence: "
+ %p= p[2]
+
+ %script{:src=>"/javascripts/jquery-latest.js"}
+ %script{:src=>"/javascripts/jquery.tablesorter.min.js"}
+ -#%script{:src=>"/javascripts/jquery.metadata.js"}
+
+ :javascript
+ $(document).ready(function(){
+ // call the tablesorter plugin
+ $("table").tablesorter({
+ widgets: ['zebra'],
+ // disable first column
+ headers: {
+ 0: {sorter: false}
+ },
+ });
+ });
+
+ %h3= "Neighbours: "
+ %table{:class=>"tablesorter", :cellspacing=>"1"}
+ %thead
+ %tr
+ %th
+ = "compound"
+ %th
+ = "smiles"
+ %th
+ = "measured activity"
+ %th
+ = "similarity"
+ -#%tbody
+ - count = 0
+ - @prediction_neighbours_compounds.each do |neighbour_compound|
+ %tr
+ %td
+ %img{:src=>"#{neighbour_compound.uri}/image", :alt=>neighbour_compound.uri, :width=>"100px"}
+ %td= neighbour_compound.smiles
+ -#%h2= "Measured Activity: "
+ %td= @prediction_neighbours_values[0][count][0].inspect
+ -#%h2= "Smilarity: "
+ %td= @prediction_neighbours_values[0][count][3].inspect
+ - count += 1