diff options
author | gebele <gebele@in-silico.ch> | 2013-03-07 11:05:18 +0100 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2013-03-07 11:05:18 +0100 |
commit | b5f22735b2f73456a885b2961be8556df62589f2 (patch) | |
tree | 5a41d38338edf7fcf36adba959a6952693313c1a /views | |
parent | 0c2554a5a2c3aebf3e99d70fee2075a9b99f9abe (diff) |
works for single prediction
Diffstat (limited to 'views')
-rw-r--r-- | views/layout.haml | 13 | ||||
-rw-r--r-- | views/predict.haml | 7 | ||||
-rw-r--r-- | views/prediction.haml | 84 |
3 files changed, 71 insertions, 33 deletions
diff --git a/views/layout.haml b/views/layout.haml index 14e9689..d5a14c2 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -5,20 +5,7 @@ %meta{'http-equiv' => "X-UA-Compatible", :content => "chrome=1"} %title Lazar Toxicity Predictions %link{ :href=>"/stylesheets/screen.css", :media=>"screen, projection", :rel=>"stylesheet", :type=>"text/css"} - -#%link{ :type=>"text/javascript", :src=>"/sketcher/jquery-ui-1.9.2.custom.css"} - -#%link{ :href=>"/stylesheets/css/print.css", :media=>"print", :rel=>"stylesheet", :type=>"text/css"} - -#%link{ :href=>"/stylesheets/css/ie.css", :media=>"screen, projection", :rel=>"stylesheet", :type=>"text/css"} - -#%link{:rel=>"stylesheet", :href=>"http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css"} %script{:src=>"http://code.jquery.com/jquery-1.8.3.js"} - -#%script{ :type=>"text/javascript", :src=>"/javascripts/ChemDoodleWeb-libs.js"} - -#%script{ :type=>"text/javascript", :src=>"/javascripts/ChemDoodleWeb.js"} - -#%script{ :type=>"text/javascript", :src=>"/sketcher/jquery-ui-1.9.2.custom.min.js"} - -#%script{ :type=>"text/javascript", :src=>"/sketcher/ChemDoodleWeb-sketcher.js"} - -#%script{:src=>"http://kemia.github.com/js/kemia.js"} - -#%script{:src=>"http://code.jquery.com/ui/1.9.2/jquery-ui.js"} - -#%script{:type => "text/javascript", :src => "#{to('/javascripts/toxcreate.js')}"} - - %body .logo diff --git a/views/predict.haml b/views/predict.haml index 2de8b75..31bd4ed 100644 --- a/views/predict.haml +++ b/views/predict.haml @@ -53,9 +53,10 @@ %p Description about these models. %br - @models.each do |model| - %input{:type => 'checkbox', :name => "selection[#{model.title}]", :value => "#{model.metadata}", :uri => "#{model.uri}", :disabled => false} - %model= model.title - %p= model.metadata["#{RDF::DC.modified}"] + - model.get + %input{:type => 'checkbox', :name => "selection[#{model.title}]", :value => true, :disabled => false} + %p= model.title + %p= model.metadata[RDF::DC.modified] %br .close 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 |