summaryrefslogtreecommitdiff
path: root/views
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
parent5bc627dc499fb592312951f26538199444bd562a (diff)
added info icons; neighbors, color by class for text not background
Diffstat (limited to 'views')
-rw-r--r--views/layout.haml13
-rw-r--r--views/neighbors.haml (renamed from views/neighbours.haml)40
-rw-r--r--views/predict.haml4
-rw-r--r--views/prediction.haml67
4 files changed, 82 insertions, 42 deletions
diff --git a/views/layout.haml b/views/layout.haml
index 410d150..b9fd06d 100644
--- a/views/layout.haml
+++ b/views/layout.haml
@@ -49,19 +49,24 @@
});
});
$('a#confidence').tooltip({
- predelay: 800,
+ predelay: 300,
+ position: 'bottom center',
+ offset: [-100, 0],
+ });
+ $('a#result').tooltip({
+ predelay: 300,
position: 'bottom center',
offset: [-100, 0],
});
$('a#similarity').tooltip({
- predelay: 800,
+ predelay: 300,
position: 'bottom center',
offset: [-600, 0],
});
$('a#measured_activity').tooltip({
- predelay: 800,
+ predelay: 300,
position: 'bottom center',
- offset: [-450, 0],
+ offset: [-500, 0],
});
});
#back-top
diff --git a/views/neighbours.haml b/views/neighbors.haml
index 84d9f72..ddea418 100644
--- a/views/neighbours.haml
+++ b/views/neighbors.haml
@@ -1,6 +1,6 @@
/ @@prediction_models and @@predictions defined in POST request '/predict'
/ unpacks multi prediction array ;
-/ prepare it for neighbours ;
+/ prepare it for neighbors ;
/ align single prediction to endpoint ;
/ display preordered in table view ;
@@ -28,9 +28,9 @@
- count_rs += 1
#results{:id=>"#{count_rs}"}
- pa.each do |p|
- / prepare dataset for neighbours table ;
+ / prepare dataset for neighbors table ;
/ delete first array which contains input compound prediction ;
- / keep the following arrays they are the neighbour predictions ;
+ / keep the following arrays they are the neighbor predictions ;
- p.data_entries.shift
- p.compounds.shift
/ call the tablesorter plugin ;
@@ -45,21 +45,25 @@
});
});
/ TODO catch table error if tbody is empty
- %h2= "Neighbours: "
+ %h2= "Neighbors: "
%table{:id=>"#{count_rs}", :class=>"tablesorter", :cellspacing=>"1"}
%thead
%tr
%th
Compound
%th
- %a{:href=>"#", :title=>"", :id=>"measured_activity"} Measured Activity
+ %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
- %a{:href=>"#", :title=>"", :id=>"similarity"} Similarity
+ %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
@@ -71,24 +75,26 @@
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 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.
+ 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 |neighbour_compound|
+ - p.compounds.each do |neighbor_compound|
%tr
- %td
- %img{:src=>"#{neighbour_compound.uri}/image", :alt=>"", :width=>"100px"}
- %td{:class => p.data_entries[count][2]}
+ %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 => p.data_entries[count][2]}
- = p.data_entries[count][3].round(3)
- %td{:class => p.data_entries[count][2]}
- %a{:href => to("/prediction/#{CGI.escape(neighbour_compound.uri)}/details"), :id=>"link#{count_rs}#{count}", :target=>"details"}
+ %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() {
@@ -99,4 +105,4 @@
- count += 1
-%iframe{:id=>"iframe", :name=>"details", :height=>"80%", :width=>"80%", :style=>"display:none;border:0px"}
+%iframe{:id=>"iframe", :name=>"details", :height=>"90%", :width=>"90%", :style=>"display:none;border:0px"}
diff --git a/views/predict.haml b/views/predict.haml
index 369f3b8..98b9edb 100644
--- a/views/predict.haml
+++ b/views/predict.haml
@@ -78,9 +78,9 @@
#model
%input{:type => "checkbox", :name => "selection[#{model.title}]", :id => "selection[#{model.title}]", :value => true, :disabled => false}
%label{:for => "selection[#{model.title}]"}
- %b= model.title
+ = "DSSTox Carcinogenic Potency DBS "+model.title.split(" ").first
%a{:href=>"#", :alt=>"#{model.title} validation"}
- %i Validation Link
+ %i ( Validation Link )
%br
.close
diff --git a/views/prediction.haml b/views/prediction.haml
index 20be935..89e66f0 100644
--- a/views/prediction.haml
+++ b/views/prediction.haml
@@ -27,33 +27,62 @@
});
});
- count=0
- / var for rule to load neighbours page.
- - @@neighbours_available = 1
+ / var for rule to load neighbors page.
+ - @@neighbors_available = 1
- @@predictions.each do |pa|
/ prediction of one model
- pa.each do |p|
- / p.data_entries > 1 = neighbours available
- - $logger.debug "count data_entries: #{p.data_entries.length}"
- - p.data_entries.length > 1 ? @@neighbours_available = p.data_entries.length : @@neighbours_available
- %td{:class => p.data_entries[0][0]}
+ / p.data_entries > 1 = neighbors available
+ - p.data_entries.length > 1 ? @@neighbors_available = p.data_entries.length : @@neighbors_available
+ / prevent conversion of nil
+ - c = p.data_entries[0][0] != nil ? p.data_entries[0][0] : ''
+ / define color by class; number first is not allowed for css
+ %td{:class => "c"+c}
%b{:class => "title"}
= @@prediction_models[count].title
%br
%br
- = "Result:\n"
+ = "Result:"
%b= p.data_entries[0][0] != nil ? p.data_entries[0][0] : "No prediction result"
- %br
- %a{:href=>"#", :title=>"", :id=>"confidence"} Confidence
+ %a{:href=>"#result", :title=>"", :id=>"result"}
+ %img{:src=>"/images/info_white.png"}
.tooltip{:style=>"font-weight: normal; font-size: 1em; width: 50%; text-align: left;"}
%dt
- Confidence
+ Result
%dd
- Indicates the applicability domain of a model.
- Predictions with a high confidence can be expected to be more reliable than predictions with low confidence.
- Confidence values may take any value between 0 and 1.
- For most models confidence > 0.025 is a sensible (hard) cutoff to distiguish between reliable and unreliable predictions.
- = p.data_entries[0][1].round(3)
+ %code lazar
+ calculates searches the training dataset for similar compounds (neighbors)
+ and calculates the prediction from their measured activities. lazar
+ calculates predictions using
+ %ul
+ %li a majority vote (weighted by compound similarity) for
+ %em classification
+ (
+ %a{:href=>"http://www.in-silico.de/articles/modi020905.pdf"} original publication
+ )
+ %li a local QSAR model based on neighbors for
+ %em regression
+ (
+ %a{:href=>"http://www.in-silico.de/articles/mh_tf.pdf"} original publication
+ )
+ Please keep in mind that predictions are based on the measured activities of neighbors.
%br
+ .confidence
+ %b Confidence:
+ = p.data_entries[0][1] != nil ? p.data_entries[0][1].round(3) : "No prediction result"
+ %a{:href=>"#confidence", :title=>"", :id=>"confidence"}
+ %img{:src=>"/images/info_white.png"}
+ .tooltip{:style=>"font-weight: normal; font-size: 1em; width: 50%; text-align: left;"}
+ %dt
+ Confidence
+ %dd
+ Indicates the applicability domain of a model.
+ Predictions with a high confidence can be expected to be more reliable than predictions
+ with low confidence.
+ Confidence values may take any value between 0 and 1.
+ For most models confidence > 0.025 is a sensible (hard) cutoff to distiguish between
+ reliable and unreliable predictions.
+ %br
%a{:href=> "#tabs", :id=>"link#{count}"}
%img{:src=>"/images/arrow_down_float.png", :alt=>"arrow"}
:javascript
@@ -64,9 +93,9 @@
});
- count+=1
- - if @@neighbours_available > 1
- = haml :neighbours, :layout => false
+ - if @@neighbors_available > 1
+ = haml :neighbors, :layout => false
- else
%h2
- no neighbours available
-%iframe{:id=>"iframe_overview", :name=>"details_overview", :height=>"80%", :width=>"80%", :style=>"display:none;border:0px"}
+ no neighbors available
+%iframe{:id=>"iframe_overview", :name=>"details_overview", :height=>"90%", :width=>"90%", :style=>"display:none;border:0px"}