diff options
author | gebele <gebele@in-silico.ch> | 2016-12-07 12:07:13 +0000 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2016-12-07 12:07:13 +0000 |
commit | 55bf06381a42c9bb1e1e991e990f5d6e90c8e33e (patch) | |
tree | 44044577e36e00485aa5d73531d9d56747e5b742 /views/prediction.haml | |
parent | b65956f3b250b4f10fe93b7d35924d21538cd6f5 (diff) |
rebuild code for public release;prepared to work with lazar v1.0.0;reintroduced compound details
Diffstat (limited to 'views/prediction.haml')
-rw-r--r-- | views/prediction.haml | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/views/prediction.haml b/views/prediction.haml index b090be5..362f006 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -1,10 +1,3 @@ -:javascript - $(document).ready(function(){ - $('[data-toggle="popover"]').popover(); - $('.modal').on('hidden.bs.modal', function () { - $(this).removeData('bs.modal'); - }); - }); %div.well %a.btn.btn-warning{:href => to('/predict')} %i.glyphicon.glyphicon-menu-left @@ -16,7 +9,8 @@ %tbody %tr %td{:id=>"compound", :style=>"vertical-align:top;"} - %p= @compound.svg + %a.btn.btn-link{:href => "#details0", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(@compound.id.to_s)}/details"), :id=>"link01"}} + = @compound.svg %p= @compound.smiles - @model_types = {} - @dbhit = {} @@ -57,7 +51,7 @@ %p %b Prediction: / prediction popover - -#%a.btn.glyphicon.glyphicon-info-sign{:href=>"#", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"<p>lazar searches the training dataset for similar compounds (neighbors) and calculates the prediction from their experimental activities.<p><b>Classification:</b></br>Majority vote of neighbor activities weighted by similarity.<p><b>Regression:</b></br>Prediction from a local partial least squares regression model with neighbor activities weighted by similarity.<p><a href=\"http://www.frontiersin.org/Journal/10.3389/fphar.2013.00038/abstract\", target=\"_blank\"> Original publication</a>."}} + %a.btn.glyphicon.glyphicon-info-sign{:href=>"javascript:void(0)", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"<p>lazar searches the training dataset for similar compounds (neighbors) and calculates the prediction from their experimental activities.<p><b>Classification:</b></br>Majority vote of neighbor activities weighted by similarity.<p><b>Regression:</b></br>Prediction from a local partial least squares regression model with neighbor activities weighted by similarity.<p><a href=\"http://www.frontiersin.org/Journal/10.3389/fphar.2013.00038/abstract\", target=\"_blank\"> Original publication</a>."}} %br = (type == "Regression") ? "#{prediction[:value].delog10} (#{unit})</br>#{@compound.mmol_to_mg(prediction[:value].delog10)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] @@ -67,20 +61,20 @@ %b 95% Prediction interval: - interval = (prediction[:prediction_interval].nil? ? nil : prediction[:prediction_interval]) / prediction interval 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."}} + %a.btn.glyphicon.glyphicon-info-sign{:href=>"javascript:void(0)", :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.nil? ? "--" : "#{interval[1].delog10} - #{interval[0].delog10} (#{unit})" %br = "#{@compound.mmol_to_mg(interval[1].delog10)} - #{@compound.mmol_to_mg(interval[0].delog10)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" if !prediction[:prediction_interval].nil? - else %b Probability: + / probability popover + %a.btn.glyphicon.glyphicon-info-sign{:href=>"javascript:void(0)", :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."}} - 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."}} / show warnings %p @@ -94,4 +88,8 @@ / always show the neighbors table, message is given there = haml :neighbors, :layout => false, :model_type => @model_types, :dbhit => @dbhit + +%div.modal.fade{:id=>"details0", :role=>"dialog"} + %div.modal-dialog.modal-lg + %div.modal-content |