summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2017-12-12 13:57:28 +0000
committergebele <gebele@in-silico.ch>2017-12-12 13:57:28 +0000
commitf5a0d4ab14e55a72c4cb182ce0e81f599e4857ed (patch)
treea20c2f2cbb0a0f7581fbae014ad571dbdb92ee47 /views
parent332c68dc1bc59538a8a749ef592d5700ba316357 (diff)
prediction object adjusted for single predictions
Diffstat (limited to 'views')
-rw-r--r--views/prediction.haml24
1 files changed, 12 insertions, 12 deletions
diff --git a/views/prediction.haml b/views/prediction.haml
index 4660112..b4b51ca 100644
--- a/views/prediction.haml
+++ b/views/prediction.haml
@@ -25,19 +25,19 @@
- toxtree = @predictions.pop if @toxtree == true
- unless @predictions.blank?
- @predictions.each_with_index do |prediction,i|
- - if prediction.dimension > 0
- - sa_prediction = prediction[1]
- - prediction = prediction[0]
- - type = @models[i].model.class.to_s.match("Classification") ? "Classification" : "Regression"
+ - if prediction["Consensus prediction"]
+ - sa_prediction = true
+ - type = (@models[i].regression? ? "Regression" : "Classification")
- @model_types[i] = type
- unit = @models[i].unit
%td{:style=>"vertical-align:top;white-space:nowrap;"}
%b.title
= (sa_prediction ? "Consensus mutagenicity" : "#{@models[i].endpoint.gsub('_', ' ')} (#{@models[i].species})")
+ %p
/ check kazius
- if sa_prediction
- - hash = sa_prediction[:prediction]
- - confidence = sa_prediction[:confidence]
+ - sa_value = prediction["Consensus prediction"]
+ - confidence = prediction["Consensus confidence"]
/ check for database hit
- if prediction[:info] =~ /\b(identical)\b/i
- @dbhit[i] = true
@@ -52,21 +52,21 @@
= prediction[:measurements].join("; ")
%b Consensus prediction:
%br
- =(hash[:prediction] == true ? "mutagenic" : "non-mutagenic")
+ = sa_value
%p
%b Consensus confidence:
%br
- =confidence.to_f.signif(3)
+ = confidence
%p
%b Structural alerts for mutagenicity:
%br
- =hash[:matches].blank? ? "none" : hash[:matches].join("; ")
+ = prediction["Structural alerts for mutagenicity"].gsub(";","</br>")
/ check for prediction
- %p
- / regression
- if prediction[:value]
- %b.title= ("Lazar #{@models[i].endpoint.gsub('_', ' ').downcase} (#{@models[i].species}):" if sa_prediction)
%p
+ - if sa_prediction
+ %b.title= ("Lazar #{@models[i].endpoint.gsub('_', ' ').downcase} (#{@models[i].species}):")
+ %p
/ check for database hit
- if prediction[:info] =~ /\b(identical)\b/i
- @dbhit[i] = true