From 3935e9bee66fbfff4f35365eb9cff8c79f5fadd8 Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 29 Oct 2015 10:09:13 +0000 Subject: patch merge --- views/batch.haml | 3 +-- views/neighbors.haml | 4 ++-- views/predict.haml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'views') diff --git a/views/batch.haml b/views/batch.haml index 8389651..ec987c4 100644 --- a/views/batch.haml +++ b/views/batch.haml @@ -44,7 +44,7 @@ %br %b Prediction: / TODO scientific notation - = prediction[:value].numeric? ? "#{'%.2e' % prediction[:value]} #{model.unit}" : prediction[:value] + = prediction[:value].numeric? ? "#{'%.2e' % prediction[:value]} (#{model.unit})" : prediction[:value] %br / TODO probability %b Confidence: @@ -53,4 +53,3 @@ - else %p = "Not enough similar compounds
in training dataset." - %p diff --git a/views/neighbors.haml b/views/neighbors.haml index 21b4b35..a741b45 100644 --- a/views/neighbors.haml +++ b/views/neighbors.haml @@ -58,7 +58,7 @@ / %td %tbody - type = @model_types[j] - - prediction[:neighbors].each_with_index do |neighbor,count| + - prediction[:neighbors].uniq.each_with_index do |neighbor,count| %tr / Compound %td{:style =>"vertical-align:middle;padding-left:1em;width:50%;"} @@ -67,7 +67,7 @@ %p= Compound.find(neighbor[0]).smiles / Measured Activity %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"} - = (type == "Regression") ? neighbor[2].collect{|n| '%.2e' % n + " (#{@models[j].unit})"}.join(", ") : neighbor[2].join(", ") + = (type == "Regression") ? neighbor[2].collect{|n| '%.2e' % n + " (#{@models[j].unit})"}.join("
") : neighbor[2].join(", ") / Similarity %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"} / TODO differentiate between no neighbors found and compound found in dataset, display neighbors for compounds in dataset? diff --git a/views/predict.haml b/views/predict.haml index 9863cd9..8ab9ee0 100644 --- a/views/predict.haml +++ b/views/predict.haml @@ -24,7 +24,7 @@ }); function getInput(){ - identifier = document.getElementById("identifier").value; + identifier = document.getElementById("identifier").value.trim(); fileselect = document.getElementById("fileselect").value; if (fileselect != ""){ return 1; -- cgit v1.2.3 From 1d6588b35b4ffff16717e24b42a0d396d5347f95 Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 26 Jan 2016 12:53:40 +0000 Subject: batch merge --- views/batch.haml | 15 +++++++++------ views/neighbors.haml | 21 ++++++++++++++++++--- views/predict.haml | 1 - views/prediction.haml | 14 +++++++++----- 4 files changed, 36 insertions(+), 15 deletions(-) (limited to 'views') diff --git a/views/batch.haml b/views/batch.haml index ec987c4..9bfa67e 100644 --- a/views/batch.haml +++ b/views/batch.haml @@ -18,6 +18,7 @@ / key = compound, values = array of arrays with model, prediction - @batch.each do |key, values| - compound = key + - mw = compound.molecular_weight %tr %td{:style=>"vertical-align:top;"} %p= compound.svg @@ -32,10 +33,13 @@ %p - if prediction[:confidence] == "measured" %p - / TODO fix scientific notation from database - %b Measured activity: - = prediction[:value].numeric? ? "#{prediction[:value].round(3)} (#{model.unit})" : prediction[:value] - %p Compound is part of the training dataset + %b Measured activity: + - if prediction[:value].is_a?(Array) + = prediction[:value][0].numeric? ? prediction[:value].collect{|v| weight = compound.mmol_to_mg(v, mw); '%.2e' % v + " (#{model.unit})"+" | #{'%.2e' % weight} (mg/kg_bw/day)"}.join("
") : prediction[:value].join(", ") + - else + = prediction[:value].numeric? ? "#{'%.2e' % prediction[:value]} (#{model.unit}) | #{'%.2e' % compound.mmol_to_mg(prediction[:value], mw)} (mg/kg_bw/day)" : prediction[:value] + %p + %b Compound is part of the training dataset - elsif prediction[:neighbors].size > 0 %p / model type (classification|regression) @@ -43,8 +47,7 @@ = model.model.class.to_s.match("Classification") ? "Classification" : "Regression" %br %b Prediction: - / TODO scientific notation - = prediction[:value].numeric? ? "#{'%.2e' % prediction[:value]} (#{model.unit})" : prediction[:value] + = prediction[:value].numeric? ? "#{'%.2e' % prediction[:value]} (#{model.unit}) | #{'%.2e' % compound.mmol_to_mg(prediction[:value], mw)} (mg/kg_bw/day)" : prediction[:value] %br / TODO probability %b Confidence: diff --git a/views/neighbors.haml b/views/neighbors.haml index a741b45..6001605 100644 --- a/views/neighbors.haml +++ b/views/neighbors.haml @@ -29,7 +29,20 @@ debug: false, theme: "bootstrap", headerTemplate: '{content} {icon}', - widgets: ['zebra', 'columns', 'uitheme'], + widgets: ['zebra', 'columns', 'uitheme', 'stickyHeaders'], + widgetOptions: { + stickyHeaders_attachTo : '.tab-content', + stickyHeaders : '', + stickyHeaders_offset : 0, + stickyHeaders_cloneId : '-sticky', + stickyHeaders_addResizeEvent : true, + stickyHeaders_includeCaption : true, + stickyHeaders_zIndex : 2, + stickyHeaders_attachTo : null, + stickyHeaders_xScroll : null, + stickyHeaders_yScroll : null, + stickyHeaders_filteredToTop: true + }, headers: {0: {sorter: false}, 3: {sorter: false}}, sortList: [[2,1]], widthFixed: false @@ -65,9 +78,11 @@ /%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 + - c = Compound.find(neighbor[0]) + //- mw = c.molecular_weight / Measured Activity - %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"} - = (type == "Regression") ? neighbor[2].collect{|n| '%.2e' % n + " (#{@models[j].unit})"}.join("
") : neighbor[2].join(", ") + %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;white-space:nowrap;"} + = (type == "Regression") ? neighbor[2].collect{|n| weight = c.mmol_to_mg(n); '%.2e' % n + " (#{@models[j].unit})"+"|#{'%.2e' % weight} (mg/kg_bw/day)"}.join("
") : neighbor[2].join(", ") / Similarity %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"} / TODO differentiate between no neighbors found and compound found in dataset, display neighbors for compounds in dataset? diff --git a/views/predict.haml b/views/predict.haml index 8ab9ee0..010ed12 100644 --- a/views/predict.haml +++ b/views/predict.haml @@ -125,7 +125,6 @@ %br %input{:type => 'text', :name => 'identifier', :id => 'identifier', :size => '60'} %p - // disable for public version %label{:for=>"fileselect"} or upload a CSV file for batch predictions (disabled in public version) %br diff --git a/views/prediction.haml b/views/prediction.haml index ef0c5db..33e9ec5 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -18,6 +18,7 @@ %td{:id=>"compound", :style=>"vertical-align:top;"} %p= @compound.svg %p= @compound.smiles + -#- mw = @compound.molecular_weight - @model_types = {} - @dbhit = {} - @predictions.each_with_index do |prediction,i| @@ -30,10 +31,14 @@ - if prediction[:confidence] == "measured" - @dbhit[i] = true %p - / TODO fix scientific notation from database %b Measured activity: - = (type == "Regression") ? "#{"%.2e" % prediction[:value]} (#{@models[i].unit})" : prediction[:value] - %p Compound is part of the training dataset + - p prediction[:value] + - if prediction[:value].is_a?(Array) + = (type == "Regression") ? prediction[:value].collect{|v| weight = Compound.from_smiles(@compound.smiles).mmol_to_mg(v); '%.2e' % v + " (#{@models[i].unit})"+"|#{'%.2e' % weight} (mg/kg_bw/day)"}.join("
") : prediction[:value].join(", ") + - else + = (type == "Regression") ? "#{"%.2e" % prediction[:value]} (#{@models[i].unit}) | #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} (mg/kg_bw/day)" : prediction[:value] + %p + %b Compound is part of the training dataset - elsif prediction[:neighbors].size > 0 %p / model type (classification|regression) @@ -41,8 +46,7 @@ = type %br %b Prediction: - / TODO scientific notation - = (type == "Regression") ? "#{'%.2e' % prediction[:value]} (#{@models[i].unit})" : prediction[:value] + = (type == "Regression") ? "#{'%.2e' % prediction[:value]} (#{@models[i].unit}) | #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} (mg/kg_bw/day)" : 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 Please keep in mind that predictions are based on the measured activities of neighbors."}} %br -- cgit v1.2.3 From 9eb9fd8ab470d6c44c70e0af0808204bdda2b161 Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 17 Mar 2016 11:28:18 +0000 Subject: snapshot, works only with png plots --- views/model_details.haml | 24 ++++++++++++------------ views/style.scss | 9 +++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) (limited to 'views') diff --git a/views/model_details.haml b/views/model_details.haml index e5886e7..04cc0f0 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -97,10 +97,9 @@ Source: -#= "Confusion Matrix:\t" -#= cv.confusion_matrix %br - -#%p - = "Confidence plot:" - -#%p{:id=>"confp#{cv.id}", :style=>"transform:scale(0.5);margin-left:-30%;margin-top:-30%;padding:0;"} - = cv.confidence_plot + = "Confidence plot:" + %p.plot + %img{:src=>"confp#{cv.id}.png"} - if model.regression? %br = "Root mean squared error:\t" @@ -117,12 +116,13 @@ Source: %br = "R square:\t" = cv.r_squared.round(3) if cv.r_squared - -#%p - = "Correlation plot" - -#%p{:id=>"corrp#{cv.id}", :style=>"transform:scale(0.5);margin-left:-30%;margin-top:-30%;margin-bottom:0;padding:0;"} - =cv.correlation_plot - -#%p - = "Confidence plot:" - -#%p{:id=>"confp#{cv.id}", :style=>"transform:scale(0.5);margin-left:-30%;margin-top:-30%;margin-bottom:0;padding:0;"} - = cv.confidence_plot + %br + = "Confidence plot:" + %p.plot + %img{:src=>"/confp#{cv.id}.png"} + %br + = "Correlation plot" + %p.plot + %img{:src=>"/corrp#{cv.id}.png"} + %br diff --git a/views/style.scss b/views/style.scss index 9a3c9df..a0502b5 100644 --- a/views/style.scss +++ b/views/style.scss @@ -16,3 +16,12 @@ h4.head-back, h5.head-back{ height: 5em; } } +img { + max-width: 100%; + max-height: 100%; +} + +.plot { + height: 300px; + width: 300px; +} -- cgit v1.2.3 From 510822b13d48344ffe4e047a4415ebdb218dadc0 Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 24 Mar 2016 19:41:37 +0000 Subject: updated for latest lazar changes; introduced 95% prediction interval --- views/model_details.haml | 29 ++++++++++------------------- views/neighbors.haml | 31 +++++++++++++++++++++---------- views/prediction.haml | 11 ++++++++--- 3 files changed, 39 insertions(+), 32 deletions(-) (limited to 'views') diff --git a/views/model_details.haml b/views/model_details.haml index 04cc0f0..34e86ac 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -36,9 +36,6 @@ Source: = "Accuracy:\t" = cv.accuracy.round(3) if cv.accuracy %br - = "Weighted Accuracy:\t" - = cv.weighted_accuracy.round(3) if cv.weighted_accuracy - %br = "True positive rate:\t" = cv.true_rate["active"].round(3) if cv.true_rate["active"] %br @@ -97,32 +94,26 @@ Source: -#= "Confusion Matrix:\t" -#= cv.confusion_matrix %br - = "Confidence plot:" - %p.plot - %img{:src=>"confp#{cv.id}.png"} + /= "Confidence plot:" + /%p.plot + / %img{:src=>"confp#{cv.id}.svg"} - if model.regression? %br = "Root mean squared error:\t" = cv.rmse.round(3) if cv.rmse %br - = "Weighted root mean squared error:\t" - = cv.weighted_rmse.round(3) if cv.weighted_rmse - %br = "Mean absolute error:\t" = cv.mae.round(3) if cv.mae - %br - = "Weighted mean absolute error:\t" - = cv.weighted_mae.round(3) if cv.weighted_mae %br = "R square:\t" = cv.r_squared.round(3) if cv.r_squared %br - = "Confidence plot:" - %p.plot - %img{:src=>"/confp#{cv.id}.png"} - %br - = "Correlation plot" - %p.plot - %img{:src=>"/corrp#{cv.id}.png"} + /= "Confidence plot:" + /%p.plot + / %img{:src=>"/confp#{cv.id}.svg"} + /%br + /= "Correlation plot" + /%p.plot + / %img{:src=>"/corrp#{cv.id}.svg"} %br diff --git a/views/neighbors.haml b/views/neighbors.haml index 6001605..6011a6d 100644 --- a/views/neighbors.haml +++ b/views/neighbors.haml @@ -9,7 +9,17 @@ #tabs %ul.nav.nav-tabs.nav-justified{:id=>"neighborTabs", :role=>"tablist"} / each model a tab head ; + / hash for predictionFeature + - predictionFeature = {} - @models.each_with_index do |model,i| + / get predictionFeature type + - m = Model::Lazar.find model.model_id.to_s + - predFeature = Feature.find m.prediction_feature_id.to_s + / define feature type (numeric : nominal) + - predFeatureType = (predFeature.numeric? ? "numeric" : "nominal") + / use prediction feature id for neighbor compound features + - predFeatureId = m.prediction_feature_id.to_s + - predictionFeature[i] = {"id" => predFeatureId, "type" => predFeatureType} %li{:class => ("active" if i == 0)} %a{:href => "#results_#{i+1}", :id => "linkTab#{i+1}", data: {toggle:"tab"}} = "#{model.endpoint} (#{model.species})" @@ -29,7 +39,7 @@ debug: false, theme: "bootstrap", headerTemplate: '{content} {icon}', - widgets: ['zebra', 'columns', 'uitheme', 'stickyHeaders'], + widgets: ['columns', 'uitheme', 'stickyHeaders'], widgetOptions: { stickyHeaders_attachTo : '.tab-content', stickyHeaders : '', @@ -74,19 +84,20 @@ - prediction[:neighbors].uniq.each_with_index do |neighbor,count| %tr / Compound + - c = Compound.find(neighbor["_id"]) %td{:style =>"vertical-align:middle;padding-left:1em;width:50%;"} - /%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 - - c = Compound.find(neighbor[0]) - //- mw = c.molecular_weight - / Measured Activity + /%a.btn.btn-link{:href => "#details#{j+1}", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(neighbor["_id"])}/details"), :id=>"link#{j+1}#{count}"}} + %p= c.svg + %p= c.smiles + - mw = c.molecular_weight + / Measured Activity = compound.features %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;white-space:nowrap;"} - = (type == "Regression") ? neighbor[2].collect{|n| weight = c.mmol_to_mg(n); '%.2e' % n + " (#{@models[j].unit})"+"|#{'%.2e' % weight} (mg/kg_bw/day)"}.join("
") : neighbor[2].join(", ") - / Similarity + - features = c.features.collect{|k,v| v if k == predictionFeature[j]["id"] }.compact.flatten + = (predictionFeature[j]["type"] == "numeric") ? features.collect{|v| weight = c.mmol_to_mg(v); '%.2e' % v + " (#{@models[j].unit})"+" | #{'%.2e' % weight} (mg/kg_bw/day)"}.join("
") : features.join("
") + / Similarity = tanimoto %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"} / TODO differentiate between no neighbors found and compound found in dataset, display neighbors for compounds in dataset? - = neighbor[1] != nil ? neighbor[1].round(2) : "Not enough similar compounds
in training dataset." + = neighbor[:tanimoto] != nil ? neighbor[:tanimoto].to_f.round(3) : "Not enough similar compounds
in training dataset." - else %span.btn.btn-default.disabled diff --git a/views/prediction.haml b/views/prediction.haml index 33e9ec5..aeaafdc 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -18,7 +18,7 @@ %td{:id=>"compound", :style=>"vertical-align:top;"} %p= @compound.svg %p= @compound.smiles - -#- mw = @compound.molecular_weight + - mw = @compound.molecular_weight - @model_types = {} - @dbhit = {} - @predictions.each_with_index do |prediction,i| @@ -51,8 +51,13 @@ / %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 Please keep in mind that predictions are based on the measured activities of neighbors."}} %br / TODO probability - %b Confidence: - = prediction[:confidence].round(2) + - if type == "Regression" + %b 95% Prediction interval: + - interval = prediction[:prediction_interval].collect{|i| i.round(2)} + = interval + - else + %b Confidence: + = prediction[:confidence].round(2) unless prediction[:confidence].nil? / %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 -- cgit v1.2.3 From d70373fb5a35740f1246d9a37ce1567e899c8a1a Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 31 Mar 2016 10:53:45 +0200 Subject: catch empty pred interval --- views/prediction.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'views') diff --git a/views/prediction.haml b/views/prediction.haml index aeaafdc..f99df75 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -53,7 +53,7 @@ / TODO probability - if type == "Regression" %b 95% Prediction interval: - - interval = prediction[:prediction_interval].collect{|i| i.round(2)} + - interval = prediction[:prediction_interval].nil? ? "[ - - ]" : prediction[:prediction_interval].collect{|i| i.round(2)} = interval - else %b Confidence: -- cgit v1.2.3 From df8ed98fcc052da2641c26897a8dd0592f274e53 Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 15 Apr 2016 09:59:43 +0000 Subject: reactivated info buttons; changed unit for fish; introduced FAQ --- views/faq.haml | 2 ++ views/faq_layout.haml | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ views/layout.haml | 5 +++- views/neighbors.haml | 7 +++--- views/prediction.haml | 23 ++++++++++-------- views/style.scss | 12 +++++++++ 6 files changed, 102 insertions(+), 14 deletions(-) create mode 100644 views/faq.haml create mode 100644 views/faq_layout.haml (limited to 'views') diff --git a/views/faq.haml b/views/faq.haml new file mode 100644 index 0000000..818b96a --- /dev/null +++ b/views/faq.haml @@ -0,0 +1,2 @@ +%div.well.faq + = @faq diff --git a/views/faq_layout.haml b/views/faq_layout.haml new file mode 100644 index 0000000..a9b6664 --- /dev/null +++ b/views/faq_layout.haml @@ -0,0 +1,67 @@ +!!! +%html{:xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en"} + %head + %meta{'charset'=>"utf-8"} + %meta{'http-equiv'=>"X-UA-Compatible", :content=>"IE=edge"} + %meta{'name'=>"viewport", :content=>"width=device-width, initial-scale=1"} + %title Lazar GUI FAQ + %link{:rel=>'icon', :type=>'image/x-icon', :href=>'/images/favicon.ico'} + %link{:rel=>'stylesheet', :href=>"#{'/css/bootstrap.min.css'}"} + %link{:rel=>'stylesheet', :href=>"#{'/css/theme.default.min.css'}"} + %link{:rel=>'stylesheet', :href=>"#{'/css/theme.bootstrap.min.css'}"} + %link{ :href=>"/style.css", :rel=>"stylesheet"} + %link{ :href=>"/stylesheets/jquery-ui.css", :rel=>"stylesheet"} + %script{:src=>"/javascripts/jquery-1.11.2.min.js"} + %script{:src=>"/javascripts/bootstrap.min.js"} + %script{ :src=>"/javascripts/lazar-gui.js"} + %body + %noscript + %div{ :style=>"width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"} + Your web browser must have JavaScript enabled in order for this application to display correctly. + %header.page-header + %div.row + %div.col-md-2 + %a{:href=> to("/predict")} + %img.media-object{:src=>"/images/ist_logo.png", :alt=>"logo", :style=>"margin:0 3em 0 2em;"} + %div.col-md-10 + %h1.media-heading{:style=>"margin: 0 0 0 1em;display:inline;"} Lazar GUI + A Graphical User Interface for the Lazar framework + + %div.container-fluid + :javascript + $(document).ready(function(){ + $("#back-top").hide(); + $(".blind").error(function(){ + $(this).attr('src', '/images/blind.png'); + }); + }); + + = yield + + %footer.footer + %div.container-fluid + %p.text-muted + © + %a{:href => 'http://www.in-silico.ch', :rel => "external"} in silico toxicology gmbh 2004 - #{Time.now.year.to_s} + + #back-top{:style => "z-index:100;position:fixed;bottom:1%;right:1%;"} + %a{:href => "", :style=>"text:decoration:none;color:#ccc;"} + %span.glyphicon.glyphicon-circle-arrow-up{:style => "font-size:3em;color:black;"} + :javascript + $("#back-top").hide(); + $(function () { + $(window).scroll(function () { + if ($(this).scrollTop() > 600) { + $('#back-top').fadeIn(); + } else { + $('#back-top').fadeOut(); + } + }); + // scroll body to 0px on click + $('#back-top a').click(function () { + $('body,html').animate({ + scrollTop: 0 + }, 500); + return false; + }); + }); diff --git a/views/layout.haml b/views/layout.haml index 60f2bb3..46d326d 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -16,7 +16,7 @@ %script{:src=>"/javascripts/jquery.tablesorter.min.js"} %script{:src=>"/javascripts/jquery.tablesorter.widgets.js"} %script{ :src=>"/javascripts/lazar-gui.js"} - %body{:style=>"background-color:#E7E7E7"} + %body %noscript %div{ :style=>"width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"} Your web browser must have JavaScript enabled in order for this application to display correctly. @@ -27,6 +27,9 @@ %img.media-object{:src=>"/images/ist_logo.png", :alt=>"logo", :style=>"margin:0 3em 0 2em;"} %div.col-md-8 %h1.media-heading{:style=>"margin: 0 0 0 1em;"} Lazar Toxicity Predictions + %div.col-md-2 + %a.btn.btn-info{:href=> to("/faq"), :rel => "external"} + FAQ %div.container-fluid :javascript diff --git a/views/neighbors.haml b/views/neighbors.haml index 6011a6d..c94331a 100644 --- a/views/neighbors.haml +++ b/views/neighbors.haml @@ -75,12 +75,13 @@ %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", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", 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
  • consider only those parts of a chemical structure that are relevant for a particular endpoint
  • ignore inert parts of the structure
  • 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.
"}, :style=>"z-index:auto+10;"} + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Similarity", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", html:"true", content:"LAZAR calculates activity specific similarities based on the presence of statistically significant fragments. This procedure will
  • consider only those parts of a chemical structure that are relevant for a particular endpoint
  • ignore inert parts of the structure
  • 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.
"}, :style=>"z-index:auto+10;"} / %td %tbody - type = @model_types[j] + - unit = @models[j].unit - prediction[:neighbors].uniq.each_with_index do |neighbor,count| %tr / Compound @@ -93,7 +94,7 @@ / Measured Activity = compound.features %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;white-space:nowrap;"} - features = c.features.collect{|k,v| v if k == predictionFeature[j]["id"] }.compact.flatten - = (predictionFeature[j]["type"] == "numeric") ? features.collect{|v| weight = c.mmol_to_mg(v); '%.2e' % v + " (#{@models[j].unit})"+" | #{'%.2e' % weight} (mg/kg_bw/day)"}.join("
") : features.join("
") + = (predictionFeature[j]["type"] == "numeric") ? features.collect{|v| weight = c.mmol_to_mg(v); '%.2e' % v + " (#{@models[j].unit})"+" | #{'%.2e' % weight} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : features.join("
") / Similarity = tanimoto %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"} / TODO differentiate between no neighbors found and compound found in dataset, display neighbors for compounds in dataset? diff --git a/views/prediction.haml b/views/prediction.haml index f99df75..89c33d6 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -24,6 +24,7 @@ - @predictions.each_with_index do |prediction,i| - type = @models[i].model.class.to_s.match("Classification") ? "Classification" : "Regression" - @model_types[i] = type + - unit = @models[i].unit %td{:style=>"vertical-align:top;white-space:nowrap;"} %b{:class => "title"} = "#{@models[i].endpoint.gsub('_', ' ')} (#{@models[i].species})" @@ -34,9 +35,9 @@ %b Measured activity: - p prediction[:value] - if prediction[:value].is_a?(Array) - = (type == "Regression") ? prediction[:value].collect{|v| weight = Compound.from_smiles(@compound.smiles).mmol_to_mg(v); '%.2e' % v + " (#{@models[i].unit})"+"|#{'%.2e' % weight} (mg/kg_bw/day)"}.join("
") : prediction[:value].join(", ") + = (type == "Regression") ? prediction[:value].collect{|v| weight = Compound.from_smiles(@compound.smiles).mmol_to_mg(v); '%.2e' % v + " (#{unit})"+"|#{'%.2e' % weight} #{unit == "mmol/L" ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : prediction[:value].join(", ") - else - = (type == "Regression") ? "#{"%.2e" % prediction[:value]} (#{@models[i].unit}) | #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} (mg/kg_bw/day)" : prediction[:value] + = (type == "Regression") ? "#{"%.2e" % prediction[:value]} (#{unit}) | #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] %p %b Compound is part of the training dataset - elsif prediction[:neighbors].size > 0 @@ -46,27 +47,29 @@ = type %br %b Prediction: - = (type == "Regression") ? "#{'%.2e' % prediction[:value]} (#{@models[i].unit}) | #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} (mg/kg_bw/day)" : 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 Please keep in mind that predictions are based on the measured activities of neighbors."}} + = (type == "Regression") ? "#{'%.2e' % prediction[:value]} (#{unit}) | #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] + / tabindex=0 seems the best fix for FF|S browsers on OSX better than trigger="click focus" which ends up in double click for FF. + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", 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 Please keep in mind that predictions are based on the measured activities of neighbors."}} %br - / TODO probability - if type == "Regression" %b 95% Prediction interval: - interval = prediction[:prediction_interval].nil? ? "[ - - ]" : prediction[:prediction_interval].collect{|i| i.round(2)} - = interval + = "[#{interval[0]} (#{unit}), #{interval[1]} (#{unit})]" + / prediction intervall popover + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction intervall", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"A prediction interval (wikipedia) is an estimate of an interval in which future observations will fall, with a certain probability, given what has already been observed."}} - else %b Confidence: = prediction[:confidence].round(2) unless prediction[:confidence].nil? - / %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."}} + / confidence popover + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Confidence", :tabindex=>"0", data: {trigger:"focus", 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) / Significant fragments: - / %a.btn.btn-default.btn-sm{:id=>"linkSigFragments", :href => "#detailsTop", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(@model_uri)}/#{@model_type[i]}/#{CGI.escape(@compound.uri)}/fingerprints")}} Significant fragments + / %a.btn.btn-default.btn-sm{:id=>"linkSigFragments", :href => "#detailsTop", :tabindex=>"0", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(@model_uri)}/#{@model_type[i]}/#{CGI.escape(@compound.uri)}/fingerprints")}} Significant fragments / - if @model_type[i] =~ /regression/i && (p.data_entries[0][1] != nil && p.data_entries[0][1] != 0.0) / 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 + / %a.btn.btn-default.btn-sm{:id=>"linkDescriptors", :href => "#detailsTop", :tabindex=>"0", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(@model_uri)}/#{@model_type[i]}/#{CGI.escape(@compound.uri)}/fingerprints")}} Descriptors / %p %p - else diff --git a/views/style.scss b/views/style.scss index a0502b5..70c8035 100644 --- a/views/style.scss +++ b/views/style.scss @@ -1,3 +1,6 @@ +body { + background-color:#E7E7E7; +} table.table-borderless tbody tr td{ border-top: none; } @@ -25,3 +28,12 @@ img { height: 300px; width: 300px; } +.faq { + text-align: block; + margin-left:15%; + margin-right:15%; + margin-top:2%; +} +.faq h1 { + text-align: center; +} -- cgit v1.2.3 From 512458e2489c8cc12a9d539d8895c1802d7b081a Mon Sep 17 00:00:00 2001 From: gebele Date: Wed, 20 Apr 2016 14:12:03 +0000 Subject: adopted changes from CH on the master branch --- views/neighbors.haml | 4 +++- views/prediction.haml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'views') diff --git a/views/neighbors.haml b/views/neighbors.haml index c94331a..3014255 100644 --- a/views/neighbors.haml +++ b/views/neighbors.haml @@ -75,9 +75,11 @@ %tr %td %td{:style=>"font-size:x-small;padding:0px;"} + / measured activity %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Measured Activity", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", 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", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", html:"true", content:"LAZAR calculates activity specific similarities based on the presence of statistically significant fragments. This procedure will
  • consider only those parts of a chemical structure that are relevant for a particular endpoint
  • ignore inert parts of the structure
  • 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.
"}, :style=>"z-index:auto+10;"} + / similarity + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Similarity", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", html:"true", content:"Tanimoto/Jaccard similarity based on Molprint2D fingerprints."}, :style=>"z-index:auto+10;"} / %td %tbody - type = @model_types[j] diff --git a/views/prediction.haml b/views/prediction.haml index 89c33d6..4a2877e 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -49,6 +49,7 @@ %b Prediction: = (type == "Regression") ? "#{'%.2e' % prediction[:value]} (#{unit}) | #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] / tabindex=0 seems the best fix for FF|S browsers on OSX better than trigger="click focus" which ends up in double click for FF. + / prediction popover %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", 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 Please keep in mind that predictions are based on the measured activities of neighbors."}} %br - if type == "Regression" -- cgit v1.2.3 From 5c40dfe6ca17d318a0ec0dfcfe07b174f4d71e59 Mon Sep 17 00:00:00 2001 From: gebele Date: Wed, 20 Apr 2016 14:19:02 +0000 Subject: edited model details --- views/model_details.haml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'views') diff --git a/views/model_details.haml b/views/model_details.haml index 34e86ac..1be75e7 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -4,21 +4,19 @@ Source: %a{:href=>model.source, :target=>"external"} = model.source %br -= "Algorithm:\tLAZAR" -%br - model.classification? ? type = "Classification" : type = "Regression" = "Type:\t" = type %br - training_dataset = OpenTox::Dataset.find model.training_dataset.id -= "Training dataset:\t" -= training_dataset.source.split("/").last -%br = "Training compounds:\t" = training_dataset.compounds.size %p -%b Crossvalidation (3 independent): +- if type == "Classification" + %b Independent crossvalidations: +- else + %b Independent crossvalidations (-log10 transformed): %div.row{:id=>"validations#{model.id}", :style=>"background-color:#f5f5f5;"} - model.crossvalidations.each do |crossvalidation| %span.col-xs-4.col-sm-4.col-md-4.col-lg-4 -- cgit v1.2.3 From 7759519665408673e2ab1bfd8d32a84168c2ee34 Mon Sep 17 00:00:00 2001 From: gebele Date: Wed, 20 Apr 2016 14:39:22 +0000 Subject: adjusted prediction intervall info; units ; depiction --- views/prediction.haml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'views') diff --git a/views/prediction.haml b/views/prediction.haml index 4a2877e..5265504 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -47,7 +47,7 @@ = type %br %b Prediction: - = (type == "Regression") ? "#{'%.2e' % prediction[:value]} (#{unit}) | #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] + = (type == "Regression") ? "#{'%.2e' % prediction[:value]} (#{unit}) , #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] / tabindex=0 seems the best fix for FF|S browsers on OSX better than trigger="click focus" which ends up in double click for FF. / prediction popover %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", 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 Please keep in mind that predictions are based on the measured activities of neighbors."}} @@ -55,9 +55,10 @@ - if type == "Regression" %b 95% Prediction interval: - interval = prediction[:prediction_interval].nil? ? "[ - - ]" : prediction[:prediction_interval].collect{|i| i.round(2)} - = "[#{interval[0]} (#{unit}), #{interval[1]} (#{unit})]" + %br + = "[#{interval[0]} - #{interval[1]}] (#{unit}), [#{'%.2e' % @compound.mmol_to_mg(interval[0])} - #{'%.2e' % @compound.mmol_to_mg(interval[1])}] (mg/L)" / prediction intervall popover - %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction intervall", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"A prediction interval (wikipedia) is an estimate of an interval in which future observations will fall, with a certain probability, given what has already been observed."}} + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction intervall", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"An estimate of prediction uncertainty. The \"real\" value should be with 95% probability within the prediction interval."}} - else %b Confidence: = prediction[:confidence].round(2) unless prediction[:confidence].nil? -- cgit v1.2.3 From 48738e50ab34768cccfc770d3010c4f055bd76eb Mon Sep 17 00:00:00 2001 From: gebele Date: Wed, 20 Apr 2016 14:44:57 +0000 Subject: updated similarity info; changed delimiter --- views/neighbors.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'views') diff --git a/views/neighbors.haml b/views/neighbors.haml index 3014255..2edc3ab 100644 --- a/views/neighbors.haml +++ b/views/neighbors.haml @@ -79,7 +79,7 @@ %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Measured Activity", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", html:"true", content:"Experimental result(s) from the training dataset."}, :style=>"z-index:auto+10;"} %td{:style=>"font-size:x-small;padding:0px;"} / similarity - %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Similarity", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", html:"true", content:"Tanimoto/Jaccard similarity based on Molprint2D fingerprints."}, :style=>"z-index:auto+10;"} + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Similarity", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", html:"true", content:"Tanimoto/Jaccard similarity based on Molprint2D fingerprints."}, :style=>"z-index:auto+10;"} / %td %tbody - type = @model_types[j] @@ -96,7 +96,7 @@ / Measured Activity = compound.features %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;white-space:nowrap;"} - features = c.features.collect{|k,v| v if k == predictionFeature[j]["id"] }.compact.flatten - = (predictionFeature[j]["type"] == "numeric") ? features.collect{|v| weight = c.mmol_to_mg(v); '%.2e' % v + " (#{@models[j].unit})"+" | #{'%.2e' % weight} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : features.join("
") + = (predictionFeature[j]["type"] == "numeric") ? features.collect{|v| weight = c.mmol_to_mg(v); '%.2e' % v + " (#{@models[j].unit})"+" , #{'%.2e' % weight} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : features.join("
") / Similarity = tanimoto %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"} / TODO differentiate between no neighbors found and compound found in dataset, display neighbors for compounds in dataset? -- cgit v1.2.3 From 9d6043aef3836e0678942dccda2d8eeda0dc17b4 Mon Sep 17 00:00:00 2001 From: gebele Date: Wed, 20 Apr 2016 14:49:21 +0000 Subject: keep back faq --- views/layout.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'views') diff --git a/views/layout.haml b/views/layout.haml index 46d326d..a49238f 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -27,9 +27,9 @@ %img.media-object{:src=>"/images/ist_logo.png", :alt=>"logo", :style=>"margin:0 3em 0 2em;"} %div.col-md-8 %h1.media-heading{:style=>"margin: 0 0 0 1em;"} Lazar Toxicity Predictions - %div.col-md-2 - %a.btn.btn-info{:href=> to("/faq"), :rel => "external"} - FAQ + /%div.col-md-2 + / %a.btn.btn-info{:href=> to("/faq"), :rel => "external"} + / FAQ %div.container-fluid :javascript -- cgit v1.2.3 From b8d1ce9a588534e1a92bd4461c94b97b6269291c Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 21 Apr 2016 08:18:51 +0000 Subject: removed brackets --- views/prediction.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'views') diff --git a/views/prediction.haml b/views/prediction.haml index 5265504..d8312bb 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -50,13 +50,13 @@ = (type == "Regression") ? "#{'%.2e' % prediction[:value]} (#{unit}) , #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] / tabindex=0 seems the best fix for FF|S browsers on OSX better than trigger="click focus" which ends up in double click for FF. / prediction popover - %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", 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 Please keep in mind that predictions are based on the measured activities of neighbors."}} + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", 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 Please keep in mind that predictions are based on the measured activities of neighbors."}} %br - if type == "Regression" %b 95% Prediction interval: - - interval = prediction[:prediction_interval].nil? ? "[ - - ]" : prediction[:prediction_interval].collect{|i| i.round(2)} + - interval = prediction[:prediction_interval].nil? ? " - - " : prediction[:prediction_interval].collect{|i| i.round(2)} %br - = "[#{interval[0]} - #{interval[1]}] (#{unit}), [#{'%.2e' % @compound.mmol_to_mg(interval[0])} - #{'%.2e' % @compound.mmol_to_mg(interval[1])}] (mg/L)" + = "#{interval[0]} - #{interval[1]} (#{unit}), #{'%.2e' % @compound.mmol_to_mg(interval[0])} - #{'%.2e' % @compound.mmol_to_mg(interval[1])} (mg/L)" / prediction intervall popover %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction intervall", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"An estimate of prediction uncertainty. The \"real\" value should be with 95% probability within the prediction interval."}} - else -- cgit v1.2.3 From 1a09ee962a769dfe2ef49dcd6fb865381c221788 Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 21 Apr 2016 10:29:52 +0000 Subject: updated prediction info --- views/prediction.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'views') diff --git a/views/prediction.haml b/views/prediction.haml index d8312bb..709e17e 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -50,7 +50,7 @@ = (type == "Regression") ? "#{'%.2e' % prediction[:value]} (#{unit}) , #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] / tabindex=0 seems the best fix for FF|S browsers on OSX better than trigger="click focus" which ends up in double click for FF. / prediction popover - %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", 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 Please keep in mind that predictions are based on the measured activities of neighbors."}} + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"

Lazar searches the training dataset for similar compounds (neighbors) and calculates the prediction from their experimental activities.

Classification:
Majority vote of neighbor activities weighted by similarity.

Regression:
Prediction from a local partial least squares regression model with neighbor activities weighted by similarity.

Original publication."}} %br - if type == "Regression" %b 95% Prediction interval: -- cgit v1.2.3 From b3fffd49c61745e953415c50084fee900d8029e9 Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 21 Apr 2016 13:45:20 +0000 Subject: fixed neighbors table; bg-color predictions due to safari; disabled neighbors sort option; enabled table header info icons --- views/layout.haml | 17 +++++++++-------- views/neighbors.haml | 24 ++++++++---------------- views/prediction.haml | 10 +++++----- views/style.scss | 4 ++++ 4 files changed, 26 insertions(+), 29 deletions(-) (limited to 'views') diff --git a/views/layout.haml b/views/layout.haml index a49238f..1220cf5 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -4,7 +4,7 @@ %meta{'charset'=>"utf-8"} %meta{'http-equiv'=>"X-UA-Compatible", :content=>"IE=edge"} %meta{'name'=>"viewport", :content=>"width=device-width, initial-scale=1"} - %title Lazar Toxicity Predictions + %title lazar Toxicity Predictions %link{:rel=>'icon', :type=>'image/x-icon', :href=>'/images/favicon.ico'} %link{:rel=>'stylesheet', :href=>"#{'/css/bootstrap.min.css'}"} %link{:rel=>'stylesheet', :href=>"#{'/css/theme.default.min.css'}"} @@ -20,17 +20,18 @@ %noscript %div{ :style=>"width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"} Your web browser must have JavaScript enabled in order for this application to display correctly. - %header.page-header + %header.page-header{:style=>"margin:20px 0 20px;text-align:justify;display:inline-block;width:100%;"} %div.row %div.col-md-2 %a{:href=> to("/predict")} - %img.media-object{:src=>"/images/ist_logo.png", :alt=>"logo", :style=>"margin:0 3em 0 2em;"} + %img.media-object{:src=>"/images/IST_logo_s.png", :alt=>"logo", :width=>"150px", :heigth=>"150px", :style=>"margin:0 3em 0 2em;"} %div.col-md-8 - %h1.media-heading{:style=>"margin: 0 0 0 1em;"} Lazar Toxicity Predictions - /%div.col-md-2 - / %a.btn.btn-info{:href=> to("/faq"), :rel => "external"} - / FAQ - + %h1.media-heading{:style=>"margin: 0 0 0 2em;"} + lazar Toxicity Predictions + %div.col-md-2 + %h1.media-heading{:style=>"margin: 0 0 0 1em;"} + %small + %a{:href=>"https://nano-lazar.in-silico.ch/predict"} nano-lazar %div.container-fluid :javascript $(document).ready(function(){ diff --git a/views/neighbors.haml b/views/neighbors.haml index 2edc3ab..096e432 100644 --- a/views/neighbors.haml +++ b/views/neighbors.haml @@ -38,7 +38,7 @@ $("table##{j+1}").tablesorter({ debug: false, theme: "bootstrap", - headerTemplate: '{content} {icon}', + headerTemplate: '', widgets: ['columns', 'uitheme', 'stickyHeaders'], widgetOptions: { stickyHeaders_attachTo : '.tab-content', @@ -53,34 +53,26 @@ stickyHeaders_yScroll : null, stickyHeaders_filteredToTop: true }, - headers: {0: {sorter: false}, 3: {sorter: false}}, sortList: [[2,1]], + headers: {sorter: false}, widthFixed: false }); }); - if prediction[:neighbors].size > 0 %div.table-responsive - %table.tablesorter{:id=>"#{j+1}", :style=>"border-style: solid;"} + %table{:id=>"#{j+1}", :style=>"border-style: solid;"} %thead %tr - %th{:style =>"vertical-align:middle;"} + %th.sorter-false{:style =>"vertical-align:middle;"} Compound - %th{:style =>"vertical-align:middle;"} + %th.sorter-false{:style =>"vertical-align:middle;"} Measured Activity - %th{:style =>"vertical-align:middle;"} + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Measured Activity", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", html:"true", content:"Experimental result(s) from the training dataset."}, :style=>"z-index:auto+10;"} + %th.sorter-false{:style =>"vertical-align:middle;"} Similarity + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Similarity", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", html:"true", content:"Tanimoto/Jaccard similarity based on Molprint2D fingerprints."}, :style=>"z-index:auto+10;"} / %th{:style =>"vertical-align:middle;"} / Supporting Information - %span - %tr - %td - %td{:style=>"font-size:x-small;padding:0px;"} - / measured activity - %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Measured Activity", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", html:"true", content:"Experimental result(s) from the training dataset."}, :style=>"z-index:auto+10;"} - %td{:style=>"font-size:x-small;padding:0px;"} - / similarity - %a.btn.glyphicon.glyphicon-info-sign{:href=>"#neighbors", :title=>"Similarity", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"left", html:"true", content:"Tanimoto/Jaccard similarity based on Molprint2D fingerprints."}, :style=>"z-index:auto+10;"} - / %td %tbody - type = @model_types[j] - unit = @models[j].unit diff --git a/views/prediction.haml b/views/prediction.haml index 709e17e..0f3d57b 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -12,7 +12,7 @@ / displays all prediction result in first table %h3 Prediction Results: %div.table-responsive - %table.table.table-bordered{:id=>"overview", :style=>"background-color:white;"} + %table.table.table-bordered{:id=>"overview"} %tbody %tr %td{:id=>"compound", :style=>"vertical-align:top;"} @@ -35,9 +35,9 @@ %b Measured activity: - p prediction[:value] - if prediction[:value].is_a?(Array) - = (type == "Regression") ? prediction[:value].collect{|v| weight = Compound.from_smiles(@compound.smiles).mmol_to_mg(v); '%.2e' % v + " (#{unit})"+"|#{'%.2e' % weight} #{unit == "mmol/L" ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : prediction[:value].join(", ") + = (type == "Regression") ? prediction[:value].collect{|v| weight = Compound.from_smiles(@compound.smiles).mmol_to_mg(v); '%.2e' % v + " (#{unit})"+", #{'%.2e' % weight} #{unit == "mmol/L" ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : prediction[:value].join(", ") - else - = (type == "Regression") ? "#{"%.2e" % prediction[:value]} (#{unit}) | #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] + = (type == "Regression") ? "#{"%.2e" % prediction[:value]} (#{unit}), #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] %p %b Compound is part of the training dataset - elsif prediction[:neighbors].size > 0 @@ -50,13 +50,13 @@ = (type == "Regression") ? "#{'%.2e' % prediction[:value]} (#{unit}) , #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] / tabindex=0 seems the best fix for FF|S browsers on OSX better than trigger="click focus" which ends up in double click for FF. / prediction popover - %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"

Lazar searches the training dataset for similar compounds (neighbors) and calculates the prediction from their experimental activities.

Classification:
Majority vote of neighbor activities weighted by similarity.

Regression:
Prediction from a local partial least squares regression model with neighbor activities weighted by similarity.

Original publication."}} + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"

lazar searches the training dataset for similar compounds (neighbors) and calculates the prediction from their experimental activities.

Classification:
Majority vote of neighbor activities weighted by similarity.

Regression:
Prediction from a local partial least squares regression model with neighbor activities weighted by similarity.

Original publication."}} %br - if type == "Regression" %b 95% Prediction interval: - interval = prediction[:prediction_interval].nil? ? " - - " : prediction[:prediction_interval].collect{|i| i.round(2)} %br - = "#{interval[0]} - #{interval[1]} (#{unit}), #{'%.2e' % @compound.mmol_to_mg(interval[0])} - #{'%.2e' % @compound.mmol_to_mg(interval[1])} (mg/L)" + = "#{interval[0]} - #{interval[1]} (#{unit}), #{'%.2e' % @compound.mmol_to_mg(interval[0])} - #{'%.2e' % @compound.mmol_to_mg(interval[1])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" / prediction intervall popover %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction intervall", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"An estimate of prediction uncertainty. The \"real\" value should be with 95% probability within the prediction interval."}} - else diff --git a/views/style.scss b/views/style.scss index 70c8035..29f532b 100644 --- a/views/style.scss +++ b/views/style.scss @@ -37,3 +37,7 @@ img { .faq h1 { text-align: center; } +.tablesorter-bootstrap thead .sorter-false { + cursor: default; +} + -- cgit v1.2.3 From feb1a1cef0d750d009e72914345dc4bf2bd625ba Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 25 Apr 2016 16:01:07 +0000 Subject: added links;share;acknowledgements --- views/layout.haml | 53 +++++++++++++++++++++++++++++++++++++++++++++++------ views/style.scss | 27 ++++++++++++++++++++++++++- 2 files changed, 73 insertions(+), 7 deletions(-) (limited to 'views') diff --git a/views/layout.haml b/views/layout.haml index 1220cf5..09968e9 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -20,7 +20,7 @@ %noscript %div{ :style=>"width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"} Your web browser must have JavaScript enabled in order for this application to display correctly. - %header.page-header{:style=>"margin:20px 0 20px;text-align:justify;display:inline-block;width:100%;"} + %header.page-header %div.row %div.col-md-2 %a{:href=> to("/predict")} @@ -29,10 +29,14 @@ %h1.media-heading{:style=>"margin: 0 0 0 2em;"} lazar Toxicity Predictions %div.col-md-2 - %h1.media-heading{:style=>"margin: 0 0 0 1em;"} + %h1.media-heading %small - %a{:href=>"https://nano-lazar.in-silico.ch/predict"} nano-lazar + %a{:href=>"https://nano-lazar.in-silico.ch"} nano-lazar + %a{:href=>"http://lazar-old.in-silico.ch"} lazar-old version + %div.container-fluid + Problems, bugs, ideas for improvements ? Please report at our + %a{:href => 'https://github.com/opentox/lazar-gui/issues', :rel => "external"} issue tracker :javascript $(document).ready(function(){ $("#back-top").hide(); @@ -40,14 +44,51 @@ $(this).attr('src', '/images/blind.png'); }); }); + $(document).ready(function(){ + $('[data-toggle="popover"]').popover(); + $('.modal').on('hidden.bs.modal', function () { + $(this).removeData('bs.modal'); + }); + }); = yield %footer.footer %div.container-fluid - %p.text-muted - © - %a{:href => 'http://www.in-silico.ch', :rel => "external"} in silico toxicology gmbh 2004 - #{Time.now.year.to_s} + %div.row + %div.col-md-8 + %p.text-muted + © + %a{:href => 'http://www.in-silico.ch', :rel => "external"} in silico toxicology gmbh 2004 - #{Time.now.year.to_s} + %div.col-md-4 + %button.btn.btn-default{:type=>"button", :data=>{:toggle=>"modal", :target=>"#acknowledgements"}} acknowledgements + %div.modal.fade{:id=>"acknowledgements", :role=>"dialog"} + %div.modal-dialog + %div.modal-content + %div.modal-header + %button{:type=>"button", :class=>"close", :data=>{:dismiss=>"modal"}} + × + %h4.modal-title Financial support: + %div.modal-body + %a{:href=>"http://www.bfr.bund.de/de/start.html", :target=>"_blank"} + %img{:src=>"/images/bfr_logo.gif"} + %a{:href=>"http://www.opentox.org/", :target=>"_blank"} + %img{:src=>"/images/ot_logo.png"} + %a{:href=>"https://enanomapper.net/", :target=>"_blank"} + %img{:src=>"/images/enm_logo.png"} + + %div.btn-group.dropup + %button.btn.btn-default.dropdown-toggle{:data=>{:toggle=>"dropdown"}, :aria=>{:haspopup=>"true", :expanded=>"false"}} share + %ul.dropdown-menu{:class=>"share-buttons"} + %li + %a{:href=>"https://twitter.com/intent/tweet?source=http%3A%2F%2Flazar.in-silico.ch&text=:%20http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Tweet"} + %img{:src=>"/images/Twitter.png"} + %li + %a{:href=>"https://plus.google.com/share?url=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on Google+"} + %img{:src=>"/images/Google+.png"} + %li + %a{:href=>"http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Flazar.in-silico.ch&title=&summary=&source=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on LinkedIn"} + %img{:src=>"/images/LinkedIn.png"} #back-top{:style => "z-index:100;position:fixed;bottom:1%;right:1%;"} %a{:href => "", :style=>"text:decoration:none;color:#ccc;"} diff --git a/views/style.scss b/views/style.scss index 29f532b..77c7c4e 100644 --- a/views/style.scss +++ b/views/style.scss @@ -40,4 +40,29 @@ img { .tablesorter-bootstrap thead .sorter-false { cursor: default; } - +ul.share-buttons{ + list-style: none; +} +.dropdown-menu { + min-width: 0px !important; + width:60px; +} +.dropdown-menu a { + padding: 0 2px 1px 2px !important; +} +.page-header{ + margin:20px 0 20px; + text-align:justify; + display:inline-block; + width:98.5%; +} +.footer .modal img{ + width: 250px; + padding: 1em; +} +footer button{ + padding-bottom: 1em !important; +} +.dropdown-menu img{ + margin-left: 0.7em; +} -- cgit v1.2.3 From 6c330fdcdf4ac941b0dab1aeb1add75bb5c4eae2 Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 25 Apr 2016 16:09:59 +0000 Subject: added content to acknowledgement --- views/layout.haml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'views') diff --git a/views/layout.haml b/views/layout.haml index 09968e9..5965ee1 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -76,6 +76,8 @@ %img{:src=>"/images/ot_logo.png"} %a{:href=>"https://enanomapper.net/", :target=>"_blank"} %img{:src=>"/images/enm_logo.png"} + %a{:href=>"https://www.researchgate.net/institution/Nestle_SA/department/Nestle_Research_Center", :target=>"_blank"} + %img{:src=>"/images/nestec.jpg"} %div.btn-group.dropup %button.btn.btn-default.dropdown-toggle{:data=>{:toggle=>"dropdown"}, :aria=>{:haspopup=>"true", :expanded=>"false"}} share -- cgit v1.2.3 From 02357098113713b5ac5268ac19bf9443804c930e Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 29 Apr 2016 06:58:00 +0000 Subject: changed share and acknowledgement always visible --- views/layout.haml | 59 +++++++++++++++++++++++-------------------------------- views/style.scss | 18 +++++++++-------- 2 files changed, 35 insertions(+), 42 deletions(-) (limited to 'views') diff --git a/views/layout.haml b/views/layout.haml index 5965ee1..43e1233 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -32,11 +32,22 @@ %h1.media-heading %small %a{:href=>"https://nano-lazar.in-silico.ch"} nano-lazar - %a{:href=>"http://lazar-old.in-silico.ch"} lazar-old version %div.container-fluid - Problems, bugs, ideas for improvements ? Please report at our - %a{:href => 'https://github.com/opentox/lazar-gui/issues', :rel => "external"} issue tracker + %topline + Problems, bugs, ideas for improvements ? Please report at our + %a{:href => 'https://github.com/opentox/lazar-gui/issues', :rel => "external"} issue tracker. + | + %a{:href=>"http://lazar-old.in-silico.ch"} lazar-old version + | + %a{:href=>"https://twitter.com/intent/tweet?source=http%3A%2F%2Flazar.in-silico.ch&text=:%20http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Tweet"} + %img.share{:src=>"/images/Twitter.png"} + %a{:href=>"https://plus.google.com/share?url=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on Google+"} + %img.share{:src=>"/images/Google+.png"} + %a{:href=>"http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Flazar.in-silico.ch&title=&summary=&source=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on LinkedIn"} + %img.share{:src=>"/images/LinkedIn.png"} + %a{:href=>"https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Flazar.in-silico.ch&title=&summary=&source=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on Facebook"} + %img.share{:src=>"/images/Facebook.png"} :javascript $(document).ready(function(){ $("#back-top").hide(); @@ -56,41 +67,21 @@ %footer.footer %div.container-fluid %div.row - %div.col-md-8 + %div.col-md-12 %p.text-muted © %a{:href => 'http://www.in-silico.ch', :rel => "external"} in silico toxicology gmbh 2004 - #{Time.now.year.to_s} - %div.col-md-4 - %button.btn.btn-default{:type=>"button", :data=>{:toggle=>"modal", :target=>"#acknowledgements"}} acknowledgements - %div.modal.fade{:id=>"acknowledgements", :role=>"dialog"} - %div.modal-dialog - %div.modal-content - %div.modal-header - %button{:type=>"button", :class=>"close", :data=>{:dismiss=>"modal"}} - × - %h4.modal-title Financial support: - %div.modal-body - %a{:href=>"http://www.bfr.bund.de/de/start.html", :target=>"_blank"} - %img{:src=>"/images/bfr_logo.gif"} - %a{:href=>"http://www.opentox.org/", :target=>"_blank"} - %img{:src=>"/images/ot_logo.png"} - %a{:href=>"https://enanomapper.net/", :target=>"_blank"} - %img{:src=>"/images/enm_logo.png"} - %a{:href=>"https://www.researchgate.net/institution/Nestle_SA/department/Nestle_Research_Center", :target=>"_blank"} - %img{:src=>"/images/nestec.jpg"} + %supporters.col-md-12 + %p Financial support: + %a{:href=>"http://www.bfr.bund.de/de/start.html", :target=>"_blank"} + %img{:src=>"/images/bfr_logo.gif"} + %a{:href=>"http://www.opentox.org/", :target=>"_blank"} + %img{:src=>"/images/ot_logo.png"} + %a{:href=>"https://enanomapper.net/", :target=>"_blank"} + %img{:src=>"/images/enm_logo.png"} + %a{:href=>"https://www.researchgate.net/institution/Nestle_SA/department/Nestle_Research_Center", :target=>"_blank"} + %img{:src=>"/images/nestec.jpg"} - %div.btn-group.dropup - %button.btn.btn-default.dropdown-toggle{:data=>{:toggle=>"dropdown"}, :aria=>{:haspopup=>"true", :expanded=>"false"}} share - %ul.dropdown-menu{:class=>"share-buttons"} - %li - %a{:href=>"https://twitter.com/intent/tweet?source=http%3A%2F%2Flazar.in-silico.ch&text=:%20http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Tweet"} - %img{:src=>"/images/Twitter.png"} - %li - %a{:href=>"https://plus.google.com/share?url=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on Google+"} - %img{:src=>"/images/Google+.png"} - %li - %a{:href=>"http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Flazar.in-silico.ch&title=&summary=&source=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on LinkedIn"} - %img{:src=>"/images/LinkedIn.png"} #back-top{:style => "z-index:100;position:fixed;bottom:1%;right:1%;"} %a{:href => "", :style=>"text:decoration:none;color:#ccc;"} diff --git a/views/style.scss b/views/style.scss index 77c7c4e..49e03ab 100644 --- a/views/style.scss +++ b/views/style.scss @@ -56,13 +56,15 @@ ul.share-buttons{ display:inline-block; width:98.5%; } -.footer .modal img{ - width: 250px; - padding: 1em; +.share{ + width: 30px; + padding-right: 5px; } -footer button{ - padding-bottom: 1em !important; -} -.dropdown-menu img{ - margin-left: 0.7em; +supporters{ + background-color: white; + + img{ + width: 200px; + margin-right: 1em; + } } -- cgit v1.2.3 From 45dcce0598ec31389991c9e67be2683a8dfcc354 Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 3 May 2016 08:44:30 +0000 Subject: final header adjustments --- views/layout.haml | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'views') diff --git a/views/layout.haml b/views/layout.haml index 43e1233..13f351c 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -27,7 +27,7 @@ %img.media-object{:src=>"/images/IST_logo_s.png", :alt=>"logo", :width=>"150px", :heigth=>"150px", :style=>"margin:0 3em 0 2em;"} %div.col-md-8 %h1.media-heading{:style=>"margin: 0 0 0 2em;"} - lazar Toxicity Predictions + lazar toxicity predictions %div.col-md-2 %h1.media-heading %small @@ -35,19 +35,26 @@ %div.container-fluid %topline - Problems, bugs, ideas for improvements ? Please report at our - %a{:href => 'https://github.com/opentox/lazar-gui/issues', :rel => "external"} issue tracker. - | - %a{:href=>"http://lazar-old.in-silico.ch"} lazar-old version - | - %a{:href=>"https://twitter.com/intent/tweet?source=http%3A%2F%2Flazar.in-silico.ch&text=:%20http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Tweet"} - %img.share{:src=>"/images/Twitter.png"} - %a{:href=>"https://plus.google.com/share?url=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on Google+"} - %img.share{:src=>"/images/Google+.png"} - %a{:href=>"http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Flazar.in-silico.ch&title=&summary=&source=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on LinkedIn"} - %img.share{:src=>"/images/LinkedIn.png"} - %a{:href=>"https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Flazar.in-silico.ch&title=&summary=&source=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on Facebook"} - %img.share{:src=>"/images/Facebook.png"} + %div.row + %div.col-md-8 + Problems, bugs, ideas for improvements ? Please report at our + %a{:href => 'https://github.com/opentox/lazar-gui/issues', :rel => "external"} issue tracker. + or send us an email: + %a{ :href=>"mailto:info@in-silico.ch", :target=>"_top"} + %img.share{:src=>"/images/Email.png"} + %div.col-md-2 + %div.col-md-2 + %a{:href=>"https://twitter.com/intent/tweet?source=http%3A%2F%2Flazar.in-silico.ch&text=:%20http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Tweet"} + %img.share{:src=>"/images/Twitter.png"} + %a{:href=>"https://plus.google.com/share?url=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on Google+"} + %img.share{:src=>"/images/Google+.png"} + %a{:href=>"http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Flazar.in-silico.ch&title=&summary=&source=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on LinkedIn"} + %img.share{:src=>"/images/LinkedIn.png"} + %a{:href=>"https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Flazar.in-silico.ch&title=&summary=&source=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on Facebook"} + %img.share{:src=>"/images/Facebook.png"} + %div.row + Previous version: + %a{:href=>"http://lazar-old.in-silico.ch"} lazar-old :javascript $(document).ready(function(){ $("#back-top").hide(); -- cgit v1.2.3 From 769f704a2b4e2d83256f580317ed8c0b48cc4f45 Mon Sep 17 00:00:00 2001 From: gebele Date: Wed, 8 Jun 2016 13:47:51 +0000 Subject: bumped version; added version to GUI --- views/layout.haml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'views') diff --git a/views/layout.haml b/views/layout.haml index 13f351c..a40b68c 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -38,10 +38,11 @@ %div.row %div.col-md-8 Problems, bugs, ideas for improvements ? Please report at our - %a{:href => 'https://github.com/opentox/lazar-gui/issues', :rel => "external"} issue tracker. - or send us an email: + %a{:href => 'https://github.com/opentox/lazar-gui/issues', :rel => "external"} issue tracker + or send us an email %a{ :href=>"mailto:info@in-silico.ch", :target=>"_top"} %img.share{:src=>"/images/Email.png"} + (version #{@version}). %div.col-md-2 %div.col-md-2 %a{:href=>"https://twitter.com/intent/tweet?source=http%3A%2F%2Flazar.in-silico.ch&text=:%20http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Tweet"} -- cgit v1.2.3 From f86c084311282036ffa7b4588c0fa0d5b59af95b Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 24 Nov 2016 16:03:09 +0000 Subject: several fixes; works with lazar tree e111369ce5564f159b3f5f85c92afdd22352eaa1 --- views/details.haml | 2 +- views/layout.haml | 18 ++++--- views/license.haml | 1 + views/model_details.haml | 134 +++++++++++++++++++++++++++-------------------- views/neighbors.haml | 13 +++-- views/predict.haml | 1 + views/prediction.haml | 35 ++++++++----- views/style.scss | 14 +++-- views/validation.haml | 16 ------ 9 files changed, 127 insertions(+), 107 deletions(-) create mode 100644 views/license.haml delete mode 100644 views/validation.haml (limited to 'views') diff --git a/views/details.haml b/views/details.haml index 8a57440..bb8250d 100644 --- a/views/details.haml +++ b/views/details.haml @@ -19,6 +19,6 @@ %hr %p{:style=>"padding-left:0.5em;"} / pubchem link - %a.btn.btn-primary{:href=>"http://aop.in-silico.ch/", :title=>"Link opens in new window.", :alt=>"pubchem read across", :target=>"_blank"} PubChem read across + %a.btn.btn-primary{:href=>"http://aop.in-silico.ch/", :title=>"Link opens in new window.", :alt=>"pubchem read across", :rel=>"external"} PubChem read across %i (experimental) %br diff --git a/views/layout.haml b/views/layout.haml index a40b68c..dddf854 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -15,7 +15,7 @@ %script{:src=>"/javascripts/bootstrap.min.js"} %script{:src=>"/javascripts/jquery.tablesorter.min.js"} %script{:src=>"/javascripts/jquery.tablesorter.widgets.js"} - %script{ :src=>"/javascripts/lazar-gui.js"} + %script{:src=>"/javascripts/lazar-gui.js"} %body %noscript %div{ :style=>"width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"} @@ -26,7 +26,7 @@ %a{:href=> to("/predict")} %img.media-object{:src=>"/images/IST_logo_s.png", :alt=>"logo", :width=>"150px", :heigth=>"150px", :style=>"margin:0 3em 0 2em;"} %div.col-md-8 - %h1.media-heading{:style=>"margin: 0 0 0 2em;"} + %h1.media-heading lazar toxicity predictions %div.col-md-2 %h1.media-heading @@ -55,7 +55,7 @@ %img.share{:src=>"/images/Facebook.png"} %div.row Previous version: - %a{:href=>"http://lazar-old.in-silico.ch"} lazar-old + %a{:href=>"http://lazar-old.in-silico.ch", :rel => "external"} lazar-old :javascript $(document).ready(function(){ $("#back-top").hide(); @@ -79,15 +79,17 @@ %p.text-muted © %a{:href => 'http://www.in-silico.ch', :rel => "external"} in silico toxicology gmbh 2004 - #{Time.now.year.to_s} + | + %a{:href => to("/license"), :rel => "external"} GPL3 License %supporters.col-md-12 - %p Financial support: - %a{:href=>"http://www.bfr.bund.de/de/start.html", :target=>"_blank"} + %p Financial support by + %a{:href=>"http://www.bfr.bund.de/de/start.html", :rel=>"external"} %img{:src=>"/images/bfr_logo.gif"} - %a{:href=>"http://www.opentox.org/", :target=>"_blank"} + %a{:href=>"http://www.opentox.org/", :rel=>"external"} %img{:src=>"/images/ot_logo.png"} - %a{:href=>"https://enanomapper.net/", :target=>"_blank"} + %a{:href=>"https://enanomapper.net/", :rel=>"external"} %img{:src=>"/images/enm_logo.png"} - %a{:href=>"https://www.researchgate.net/institution/Nestle_SA/department/Nestle_Research_Center", :target=>"_blank"} + %a{:href=>"https://www.researchgate.net/institution/Nestle_SA/department/Nestle_Research_Center", :rel=>"external"} %img{:src=>"/images/nestec.jpg"} diff --git a/views/license.haml b/views/license.haml new file mode 100644 index 0000000..2813220 --- /dev/null +++ b/views/license.haml @@ -0,0 +1 @@ += @license diff --git a/views/model_details.haml b/views/model_details.haml index 1be75e7..7646471 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -1,26 +1,39 @@ %b Model: %br Source: -%a{:href=>model.source, :target=>"external"} +%a{:href=>model.source, :rel=>"external"} = model.source %br - model.classification? ? type = "Classification" : type = "Regression" = "Type:\t" = type %br -- training_dataset = OpenTox::Dataset.find model.training_dataset.id +- training_dataset = OpenTox::Dataset.find model.model.training_dataset_id = "Training compounds:\t" = training_dataset.compounds.size - +%br +%b Algorithms: +%br +Similarity: +%a{:href=> "http://www.rubydoc.info/gems/lazar/OpenTox%2F#{model.model.algorithms["similarity"]["method"].sub("::", "%2F")}", :rel=>"external"} + = model.model.algorithms["similarity"]["method"] += ", min: #{model.model.algorithms["similarity"]["min"]}" +%br +Prediction: +%a{:href=>"http://www.rubydoc.info/gems/lazar/OpenTox%2F#{model.model.algorithms["prediction"]["method"].sub("::","%2f")}", :rel=>"external"} + = model.model.algorithms["prediction"]["method"] +%br +Descriptors: += model.model.algorithms["descriptors"]["method"]+"," += model.model.algorithms["descriptors"]["type"] %p - if type == "Classification" %b Independent crossvalidations: - else %b Independent crossvalidations (-log10 transformed): %div.row{:id=>"validations#{model.id}", :style=>"background-color:#f5f5f5;"} - - model.crossvalidations.each do |crossvalidation| + - crossvalidations.each do |cv| %span.col-xs-4.col-sm-4.col-md-4.col-lg-4 - - cv = OpenTox::CrossValidation.find crossvalidation.id = "Num folds:\t" = cv.folds %br @@ -34,76 +47,81 @@ Source: = "Accuracy:\t" = cv.accuracy.round(3) if cv.accuracy %br + = "Weighted accuracy:\t" + = cv.weighted_accuracy.round(3) if cv.weighted_accuracy + %br = "True positive rate:\t" - = cv.true_rate["active"].round(3) if cv.true_rate["active"] + = cv.true_rate["active"].round(3) if cv.true_rate %br = "True negative rate:\t" - = cv.true_rate["inactive"].round(3) if cv.true_rate["inactive"] + = cv.true_rate["inactive"].round(3) if cv.true_rate %br = "Positive predictive value:\t" - = cv.predictivity["active"].round(3) if cv.predictivity["active"] + = cv.predictivity["active"].round(3) if cv.predictivity %br = "Negative predictive value:\t" - = cv.predictivity["inactive"].round(3) if cv.predictivity["inactive"] + = cv.predictivity["inactive"].round(3) if cv.predictivity %p - %b Confusion Matrix: - %table.table.table-condensed.table-borderless{:style=>"width:20%;"} - %tbody - %tr - %td - %td - %td - %b actual - %td - %td - %tr - %td - %td - %td active - %td inactive - -#%td total - %tr - %td - %b predicted - %td active - %td - =cv.confusion_matrix[0][0] - %td - =cv.confusion_matrix[0][1] - -#%td - =cv.confusion_matrix[0][0]+cv.confusion_matrix[0][1] - %tr - %td - %td inactive - %td - =cv.confusion_matrix[1][0] - %td - =cv.confusion_matrix[1][1] - -#%td - =cv.confusion_matrix[1][0]+cv.confusion_matrix[1][1] - -#%tr - %td - %td total - %td - =cv.confusion_matrix[0][0]+cv.confusion_matrix[1][0] - %td - =cv.confusion_matrix[0][1]+cv.confusion_matrix[1][1] - %td - -#= "Confusion Matrix:\t" - -#= cv.confusion_matrix + - ["confusion_matrix", "weighted_confusion_matrix"].each_with_index do |matrix,idx| + %b= (idx == 0 ? "Confusion Matrix" : "Weighted Confusion Matrix") + %table.table.table-condensed.table-borderless{:style=>"width:20%;"} + %tbody + %tr + %td + %td + %td + %b actual + %td + %td + %tr + %td + %td + %td active + %td inactive + -#%td total + %tr + %td + %b predicted + %td active + %td + =( idx == 1 ? cv.send(matrix)[0][0].round(3) : cv.send(matrix)[0][0]) + %td + =( idx == 1 ? cv.send(matrix)[0][1].round(3) : cv.send(matrix)[0][1]) + -#%td + =cv.confusion_matrix[0][0]+cv.confusion_matrix[0][1] + %tr + %td + %td inactive + %td + =( idx == 1 ? cv.send(matrix)[1][0].round(3) : cv.send(matrix)[1][0]) + %td + =( idx == 1 ? cv.send(matrix)[1][1].round(3) : cv.send(matrix)[1][1]) + -#%td + =cv.confusion_matrix[1][0]+cv.confusion_matrix[1][1] + -#%tr + %td + %td total + %td + =cv.confusion_matrix[0][0]+cv.confusion_matrix[1][0] + %td + =cv.confusion_matrix[0][1]+cv.confusion_matrix[1][1] + %td + -#= "Confusion Matrix:\t" + -#= cv.confusion_matrix + %br %br /= "Confidence plot:" /%p.plot / %img{:src=>"confp#{cv.id}.svg"} - if model.regression? %br - = "Root mean squared error:\t" + %a.ht5{:href=>"https://en.wikipedia.org/wiki/Root-mean-square_deviation", :rel=>"external"} RMSE: = cv.rmse.round(3) if cv.rmse %br - = "Mean absolute error:\t" + %a.ht5{:href=>"https://en.wikipedia.org/wiki/Mean_absolute_error", :rel=>"external"} MAE: = cv.mae.round(3) if cv.mae %br - = "R square:\t" + %a.ht5{:href=>"https://en.wikipedia.org/wiki/Coefficient_of_determination", :rel=>"external"}= "R"+"2"+":" = cv.r_squared.round(3) if cv.r_squared %br /= "Confidence plot:" @@ -113,5 +131,5 @@ Source: /= "Correlation plot" /%p.plot / %img{:src=>"/corrp#{cv.id}.svg"} - + %br diff --git a/views/neighbors.haml b/views/neighbors.haml index 096e432..d9f2796 100644 --- a/views/neighbors.haml +++ b/views/neighbors.haml @@ -79,20 +79,19 @@ - prediction[:neighbors].uniq.each_with_index do |neighbor,count| %tr / Compound - - c = Compound.find(neighbor["_id"]) + - c = Compound.find(neighbor) %td{:style =>"vertical-align:middle;padding-left:1em;width:50%;"} /%a.btn.btn-link{:href => "#details#{j+1}", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(neighbor["_id"])}/details"), :id=>"link#{j+1}#{count}"}} %p= c.svg %p= c.smiles - - mw = c.molecular_weight - / Measured Activity = compound.features + / Measured Activity %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;white-space:nowrap;"} - - features = c.features.collect{|k,v| v if k == predictionFeature[j]["id"] }.compact.flatten - = (predictionFeature[j]["type"] == "numeric") ? features.collect{|v| weight = c.mmol_to_mg(v); '%.2e' % v + " (#{@models[j].unit})"+" , #{'%.2e' % weight} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : features.join("
") + = (type == "Regression" ? "#{neighbor[:measurement].delog10}" + " (#{unit})" : neighbor[:measurement]) + %br + = "#{c.mmol_to_mg(neighbor[:measurement].delog10)}" + " (#{(unit =~ /\b(mol\/L)\b/) ? "mg/L" : "mg/kg_bw/day"})" if type == "Regression" / Similarity = tanimoto %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"} - / TODO differentiate between no neighbors found and compound found in dataset, display neighbors for compounds in dataset? - = neighbor[:tanimoto] != nil ? neighbor[:tanimoto].to_f.round(3) : "Not enough similar compounds
in training dataset." + = neighbor[:similarity].round(3) - else %span.btn.btn-default.disabled diff --git a/views/predict.haml b/views/predict.haml index 010ed12..8ae5684 100644 --- a/views/predict.haml +++ b/views/predict.haml @@ -162,6 +162,7 @@ document.getElementById("details#{model.id}").appendChild(details); $(button).show(); $(image).hide(); + addExternalLinks(); }); } } diff --git a/views/prediction.haml b/views/prediction.haml index 0f3d57b..1aefe06 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -18,7 +18,6 @@ %td{:id=>"compound", :style=>"vertical-align:top;"} %p= @compound.svg %p= @compound.smiles - - mw = @compound.molecular_weight - @model_types = {} - @dbhit = {} - @predictions.each_with_index do |prediction,i| @@ -29,17 +28,20 @@ %b{:class => "title"} = "#{@models[i].endpoint.gsub('_', ' ')} (#{@models[i].species})" %p - - if prediction[:confidence] == "measured" + - if prediction[:warning] =~ /\b(identical)\b/i - @dbhit[i] = true %p + /TODO combine with regular view, if prediction value is present %b Measured activity: - p prediction[:value] - if prediction[:value].is_a?(Array) - = (type == "Regression") ? prediction[:value].collect{|v| weight = Compound.from_smiles(@compound.smiles).mmol_to_mg(v); '%.2e' % v + " (#{unit})"+", #{'%.2e' % weight} #{unit == "mmol/L" ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : prediction[:value].join(", ") + = (type == "Regression") ? prediction[:value].collect{|value| "#{value} (#{unit}) , #{@compound.mmol_to_mg(value.delog10)} #{unit =~ /mmol\/L/ ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : prediction[:value].join(", ") - else - = (type == "Regression") ? "#{"%.2e" % prediction[:value]} (#{unit}), #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] + = (type == "Regression") ? "#{prediction[:value]} (#{unit}), #{@compound.mmol_to_mg(prediction[:value].delog10)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] %p %b Compound is part of the training dataset + / warning popover + %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Warnings", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"#{prediction[:warning]}"}} - elsif prediction[:neighbors].size > 0 %p / model type (classification|regression) @@ -47,23 +49,30 @@ = type %br %b Prediction: - = (type == "Regression") ? "#{'%.2e' % prediction[:value]} (#{unit}) , #{'%.2e' % @compound.mmol_to_mg(prediction[:value])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] - / tabindex=0 seems the best fix for FF|S browsers on OSX better than trigger="click focus" which ends up in double click for FF. / prediction popover %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"

lazar searches the training dataset for similar compounds (neighbors) and calculates the prediction from their experimental activities.

Classification:
Majority vote of neighbor activities weighted by similarity.

Regression:
Prediction from a local partial least squares regression model with neighbor activities weighted by similarity.

Original publication."}} %br + = (type == "Regression") ? "#{prediction[:value].delog10} (#{unit})
#{@compound.mmol_to_mg(prediction[:value].delog10)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] + / tabindex=0 seems the best fix for FF|S browsers on OSX better than trigger="click focus" which ends up in double click for FF. + %br - if type == "Regression" %b 95% Prediction interval: - - interval = prediction[:prediction_interval].nil? ? " - - " : prediction[:prediction_interval].collect{|i| i.round(2)} - %br - = "#{interval[0]} - #{interval[1]} (#{unit}), #{'%.2e' % @compound.mmol_to_mg(interval[0])} - #{'%.2e' % @compound.mmol_to_mg(interval[1])} #{(unit == "mmol/L") ? "(mg/L)" : "(mg/kg_bw/day)"}" + - interval = (prediction[:prediction_interval].nil? ? ["- -","- -"] : prediction[:prediction_interval]) / prediction intervall popover %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction intervall", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"An estimate of prediction uncertainty. The \"real\" value should be with 95% probability within the prediction interval."}} + %br + = "#{interval[0].delog10} - #{interval[1].delog10} (#{unit})" + %br + = "#{@compound.mmol_to_mg(interval[0].delog10)} - #{@compound.mmol_to_mg(interval[1].delog10)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" if !prediction[:prediction_interval].nil? - else - %b Confidence: - = prediction[:confidence].round(2) unless prediction[:confidence].nil? - / confidence popover - %a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Confidence", :tabindex=>"0", data: {trigger:"focus", 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."}} + %b Probability: + - unless prediction[:probabilities].nil? + %br + = "#{prediction[:probabilities].keys[0]}: #{prediction[:probabilities].values[0]}" + %br + = "#{prediction[:probabilities].keys[1]}: #{prediction[:probabilities].values[1]}" + / probability popover + -#%a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Confidence", :tabindex=>"0", data: {trigger:"focus", 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) diff --git a/views/style.scss b/views/style.scss index 49e03ab..2c84781 100644 --- a/views/style.scss +++ b/views/style.scss @@ -51,10 +51,12 @@ ul.share-buttons{ padding: 0 2px 1px 2px !important; } .page-header{ - margin:20px 0 20px; - text-align:justify; + background-color: #fff; + padding:20px 0 20px 0; + margin: 0; + text-align:center; display:inline-block; - width:98.5%; + width:100%; } .share{ width: 30px; @@ -62,9 +64,13 @@ ul.share-buttons{ } supporters{ background-color: white; - + text-align:center; img{ width: 200px; margin-right: 1em; } } + +.footer{ + margin-top:3em; +} diff --git a/views/validation.haml b/views/validation.haml deleted file mode 100644 index fd63ea6..0000000 --- a/views/validation.haml +++ /dev/null @@ -1,16 +0,0 @@ -- case @model_type -- when "classification" - - prediction = @cv.metadata["http://www.opentox.org/api/1.2#classificationStatistics"]["http://www.opentox.org/api/1.2#numCorrect"] + @cv.metadata["http://www.opentox.org/api/1.2#classificationStatistics"]["http://www.opentox.org/api/1.2#numIncorrect"] - %p= "Number of predictions: #{prediction}" - - percent = @cv.metadata["http://www.opentox.org/api/1.2#classificationStatistics"]["http://www.opentox.org/api/1.2#percentCorrect"] - %p= "Correct predictions: #{percent.round(2)} %" -- when "regression" - - prediction = @cv.metadata["http://www.opentox.org/api/1.2#numInstances"].to_i - @cv.metadata["http://www.opentox.org/api/1.2#numUnpredicted"].to_i - %p= "Number of predictions: #{prediction}" - - rSquare = @cv.metadata["http://www.opentox.org/api/1.2#regressionStatistics"]["http://www.opentox.org/api/1.2#rSquare"] - %p= "R-squared: #{rSquare.round(2)} %" - - rootMeanSquaredError = @cv.metadata["http://www.opentox.org/api/1.2#regressionStatistics"]["http://www.opentox.org/api/1.2#rootMeanSquaredError"] - %p= "Root Mean Square Error: #{rootMeanSquaredError.round(2)} %" - - meanAbsoluteError = @cv.metadata["http://www.opentox.org/api/1.2#regressionStatistics"]["http://www.opentox.org/api/1.2#meanAbsoluteError"] - %p= "Mean Absolute Error: #{meanAbsoluteError.round(2)} %" - -- cgit v1.2.3