summaryrefslogtreecommitdiff
path: root/views/neighbors.haml
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2013-06-17 12:44:18 +0200
committergebele <gebele@in-silico.ch>2013-06-17 12:44:18 +0200
commit3bb0ba2c96572ff6b77a8a879fa1f3cd45ae000c (patch)
treef2c00ae58ad2792994af3687cee9aa686b3e10cc /views/neighbors.haml
parent5bc627dc499fb592312951f26538199444bd562a (diff)
added info icons; neighbors, color by class for text not background
Diffstat (limited to 'views/neighbors.haml')
-rw-r--r--views/neighbors.haml108
1 files changed, 108 insertions, 0 deletions
diff --git a/views/neighbors.haml b/views/neighbors.haml
new file mode 100644
index 0000000..ddea418
--- /dev/null
+++ b/views/neighbors.haml
@@ -0,0 +1,108 @@
+/ @@prediction_models and @@predictions defined in POST request '/predict'
+/ unpacks multi prediction array ;
+/ prepare it for neighbors ;
+/ align single prediction to endpoint ;
+/ display preordered in table view ;
+
+:javascript
+ $(function() {
+ $( ".results" ).resizable({
+ containment: ".content"
+ });
+ });
+
+.results{:style=>"display:none"}
+ - count_m = 0
+ / tabs div ;
+ #tabs
+ %ul
+ / each endpoint becomes a tab head ;
+ - @@prediction_models.each do |m|
+ - count_m += 1
+ %li
+ %a{:href => "#results_#{count_m}", :id => "link#{m.title}"}
+ = m.title
+ - count_rs = 0
+ / unpack to single arrays
+ - @@predictions.each do |pa|
+ - count_rs += 1
+ #results{:id=>"#{count_rs}"}
+ - pa.each do |p|
+ / prepare dataset for neighbors table ;
+ / delete first array which contains input compound prediction ;
+ / keep the following arrays they are the neighbor predictions ;
+ - p.data_entries.shift
+ - p.compounds.shift
+ / call the tablesorter plugin ;
+ / presort by similarity ;
+ :javascript
+ $(document).ready(function(){
+ $("table##{count_rs}").tablesorter({
+ //debug: true,
+ //widgets: ['zebra'],
+ headers: {0: {sorter: false}, 3: {sorter: false}},
+ sortList: [[2,1]]
+ });
+ });
+ / TODO catch table error if tbody is empty
+ %h2= "Neighbors: "
+ %table{:id=>"#{count_rs}", :class=>"tablesorter", :cellspacing=>"1"}
+ %thead
+ %tr
+ %th
+ Compound
+ %th
+ %b Measured Activity
+ %a{:href=>"#", :title=>"", :id=>"measured_activity"}
+ %img{:src=>"/images/info_white.png"}
+ .tooltip{:style=>"font-weight: normal; font-size: 1em; text-align: left;"}
+ %dt
+ Measured Activity
+ %dd
+ Experimental result(s) from the training dataset.
+ %th
+ %b Similarity
+ %a{:href=>"#", :title=>"", :id=>"similarity"}
+ %img{:src=>"/images/info_white.png"}
+ .tooltip{:style=>"font-weight: normal; font-size: 1em; text-align: left;"}
+ %dt
+ Similarity
+ %dd
+ %code lazar
+ calculates
+ %em
+ activity specific
+ similarities based on the presence of statistically significant fragments.
+ This procedure will
+ %ul
+ %li consider only those parts of a chemical structure that are relevant
+ for a particular endpoint
+ %li ignore inert parts of the structure
+ %li lead to different similarities, depending on the toxic endpoint
+ Similarities of 1 may be encountered even for structurally dissimilar
+ compounds, because inert parts are ignored.
+ %th
+ Details
+ -#%tbody
+ - count = 0
+ - p.compounds.each do |neighbor_compound|
+ %tr
+ %td.compound
+ %img{:src=>"#{neighbor_compound.uri}/image", :alt=>"", :width=>"100px"}
+ %td{:class => "c"+p.data_entries[count][2]}
+ = p.data_entries[count][2]
+ %td{:class => "c"+p.data_entries[count][2]}
+ = p.data_entries[count][3] != nil ? p.data_entries[count][3].round(3) : "No prediction result"
+ %td{:class => "c"+p.data_entries[count][2]}
+ %a{:href => to("/prediction/#{CGI.escape(neighbor_compound.uri)}/details"), :id=>"link#{count_rs}#{count}", :target=>"details"}
+ %img{:src=>"/images/arrow_right_float.png", :alt=>"arrow"}
+ :javascript
+ $(function() {
+ $("a#link#{count_rs}#{count}").on('click', function(e) {
+ $('#iframe').bPopup();
+ });
+ });
+
+ - count += 1
+
+%iframe{:id=>"iframe", :name=>"details", :height=>"90%", :width=>"90%", :style=>"display:none;border:0px"}