From b5f22735b2f73456a885b2961be8556df62589f2 Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 7 Mar 2013 11:05:18 +0100 Subject: works for single prediction --- views/prediction.haml | 84 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 67 insertions(+), 17 deletions(-) (limited to 'views/prediction.haml') 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 -- cgit v1.2.3