summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2015-09-01 12:43:56 +0000
committergebele <gebele@in-silico.ch>2015-09-01 12:43:56 +0000
commitdab74297422b9fed72f85073fc76a8cd31a1e3cd (patch)
treefb5bd061dbe401296a458ae162dc4eda4af4edbc /views
parent7dcae58f3af869b4c58e6091cee099acff113ad2 (diff)
adjustments for nestec release1
Diffstat (limited to 'views')
-rw-r--r--views/layout.haml2
-rw-r--r--views/neighbors.haml15
-rw-r--r--views/prediction.haml21
3 files changed, 13 insertions, 25 deletions
diff --git a/views/layout.haml b/views/layout.haml
index d0c77b7..974a8ed 100644
--- a/views/layout.haml
+++ b/views/layout.haml
@@ -39,7 +39,7 @@
= yield
%footer.footer
- %div.container
+ %div.container-fluid
%p.text-muted
&copy;
%a{:href => 'http://www.in-silico.ch', :rel => "external"} <i style="font-family: serife">in silico</i> toxicology gmbh 2004 - #{Time.now.year.to_s}
diff --git a/views/neighbors.haml b/views/neighbors.haml
index 9f60e7c..cfa7858 100644
--- a/views/neighbors.haml
+++ b/views/neighbors.haml
@@ -3,21 +3,21 @@
/ align single prediction to endpoint ;
/ display preordered in table view ;
-%div.results{:style=>"display:none"}
+%div.results
%h3 Neighbors:
/ tabs div
#tabs
%ul.nav.nav-tabs.nav-justified{:id=>"neighborTabs", :role=>"tablist"}
/ each model a tab head ;
- @models.each_with_index do |model,i|
- %li
+ %li{:class => ("active" if i == 0)}
%a{:href => "#results_#{i+1}", :id => "linkTab#{i+1}", data: {toggle:"tab"}}
= "#{model.endpoint} (#{model.species})"
%div.tab-content
/ unpack to single arrays
- @predictions.each_with_index do |prediction,j|
/ pass model type for significant fragments view
- #results.tab-pane.fade{:id=>"#{j+1}"}
+ #results.tab-pane{:id=>"#{j+1}", :class => ("active" if j == 0)}
/ prepare dataset for neighbors table ;
/ delete first array which contains prediction ;
/ following arrays are the neighbor predictions ;
@@ -52,16 +52,17 @@
%tr
%td
%td{:style=>"font-size:x-small;padding:0px;"}
- %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Measured Activity", data: {toggle:"popover", placement:"auto", html:"true", content:"Experimental result(s) from the training dataset."}, :style=>"z-index:auto+10;"}
+ / %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Measured Activity", data: {toggle:"popover", placement:"auto", html:"true", content:"Experimental result(s) from the training dataset."}, :style=>"z-index:auto+10;"}
%td{:style=>"font-size:x-small;padding:0px;"}
- %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Similarity", data: {toggle:"popover", placement:"auto", html:"true", content:"LAZAR calculates 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><li>ignore inert parts of the structure</li><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.</li></ul>"}, :style=>"z-index:auto+10;"}
+ / %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Similarity", data: {toggle:"popover", placement:"auto", html:"true", content:"LAZAR calculates 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><li>ignore inert parts of the structure</li><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.</li></ul>"}, :style=>"z-index:auto+10;"}
/ %td
%tbody
- prediction[:neighbors].each_with_index do |neighbor,count|
%tr
%td{:style =>"vertical-align:middle;padding-left:1em;"}
- %a.btn.btn-link{:href => "#details#{j+1}", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(neighbor[0].to_s)}/details"), :id=>"link#{j+1}#{count}"}}
- = Compound.find(neighbor[0]).svg
+ /%a.btn.btn-link{:href => "#details#{j+1}", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(neighbor[0].to_s)}/details"), :id=>"link#{j+1}#{count}"}}
+ %p= Compound.find(neighbor[0]).svg
+ %p= Compound.find(neighbor[0]).smiles
%td{:style =>"vertical-align:middle;padding-left:1em;"}
= neighbor[2].collect{|n| '%.2e' % n}.join ", "
%td{:style =>"vertical-align:middle;padding-left:1em;"}
diff --git a/views/prediction.haml b/views/prediction.haml
index 91f7024..3cdfbd6 100644
--- a/views/prediction.haml
+++ b/views/prediction.haml
@@ -18,9 +18,8 @@
%tbody
%tr
%td{:id=>"compound", :style=>"vertical-align:top;"}
- %a.btn.btn-link{:href => "#detailsTop", :id=>"linkCompound", data: { toggle: "modal", remote: to("/prediction/#{@compound.id.to_s}/details")}}
- / %img.img-responsive{:src=>"#{@compound.id}/image", :alt=>"no image", :title=>"#{@compound.smiles}", :width=>"150", :height=>"150"}
- = @compound.svg
+ %p= @compound.svg
+ %p= @compound.smiles
- @predictions.each_with_index do |prediction,i|
%td{:style=>"vertical-align:top;"}
%b{:class => "title"}
@@ -42,12 +41,12 @@
/ TODO scientific notation
= prediction[:value].numeric? ? "#{'%.2e' % prediction[:value]} #{@models[i].unit}" : prediction[:value]
/ TODO update description
- %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", data: {toggle:"popover", placement:"left", html:"true", content:"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<br /><b>classification</b> (<a href='http://www.frontiersin.org/Journal/10.3389/fphar.2013.00038/abstract', target='_blank'>original publication</a>) </li><li>a local QSAR model based on neighbors for<br /><b>regression</b> (<a href='http://www.frontiersin.org/Journal/10.3389/fphar.2013.00038/abstract', target='_blank'</h>original publication</a>) </li></ul>Please keep in mind that predictions are based on the measured activities of neighbors."}}
+ / %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", data: {toggle:"popover", placement:"left", html:"true", content:"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<br /><b>classification</b> (<a href='http://www.frontiersin.org/Journal/10.3389/fphar.2013.00038/abstract', target='_blank'>original publication</a>) </li><li>a local QSAR model based on neighbors for<br /><b>regression</b> (<a href='http://www.frontiersin.org/Journal/10.3389/fphar.2013.00038/abstract', target='_blank'</h>original publication</a>) </li></ul>Please keep in mind that predictions are based on the measured activities of neighbors."}}
%br
/ TODO probability
%b Confidence:
= prediction[:confidence].round(3)
- %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Confidence", data: {toggle:"popover", placement:"left", html:"true", content:"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 distinguish between reliable and unreliable predictions."}}
+ / %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Confidence", data: {toggle:"popover", placement:"left", html:"true", content:"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 distinguish between reliable and unreliable predictions."}}
%p
/TODO add tooltip for significant ftagments and descriptors
/ - if @model_type[i] =~ /classification/i && (p.data_entries[0][1] != nil && p.data_entries[0][1] != 0.0)
@@ -57,15 +56,6 @@
/ Descriptors
/ %a.btn.btn-default.btn-sm{:id=>"linkDescriptors", :href => "#detailsTop", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(@model_uri)}/#{@model_type[i]}/#{CGI.escape(@compound.uri)}/fingerprints")}} Descriptors
/ %p
- %a.btn.btn-default.btn-sm{:href=> "#tabs", :id=>"link#{i+1}"}
- Neighbors
- :javascript
- $("a#link#{i}").click(function () {
- $(".results").show();
- //document.getElementById('tabs').focus();
- $('#neighborTabs a[href="#results_#{i+1}"]').tab('show');
- //$("#tabs").tabs({ active: "#{i}" });
- });
%p
- else
%p
@@ -73,7 +63,4 @@
/ always show the neighbors table, message is given there
= haml :neighbors, :layout => false, :model_type => @model_type
- %div.modal.fade{:id=>"detailsTop", :role=>"dialog"}
- %div.modal-dialog.modal-lg
- %div.modal-content