summaryrefslogtreecommitdiff
path: root/application.rb
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2018-04-24 10:58:01 +0000
committergebele <gebele@in-silico.ch>2018-04-24 10:58:01 +0000
commit43b257c759ae3b83ae68b0448e2e4cff67f951be (patch)
tree48fbfc8b48bda415214e48ee9e959fffe4fd547d /application.rb
parent8a940a694366214164bcdb853388bc41ccbf4522 (diff)
always show sa prediction in batch mode
Diffstat (limited to 'application.rb')
-rw-r--r--application.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/application.rb b/application.rb
index edff1c9..ca1f2ee 100644
--- a/application.rb
+++ b/application.rb
@@ -100,7 +100,14 @@ get '/task/?' do
sorter << {"Lazar mutagenicity (Salmonella typhimurium)" => ""}
sorter << {"Prediction" => prediction[:value]}
sorter << {"Probability" => prediction[:probabilities].collect{|k,v| "#{k}: #{v.signif(3)}"}.join("</br>")}
- else
+ elsif !prediction[:value] && type == "Classification"
+ sorter << {"Consensus prediction" => prediction["Consensus prediction"]}
+ sorter << {"Consensus confidence" => prediction["Consensus confidence"]}
+ sorter << {"Structural alerts for mutagenicity" => prediction["Structural alerts for mutagenicity"]}
+ sorter << {"Lazar mutagenicity (Salmonella typhimurium)" => ""}
+ sorter << {"Prediction" => ""}
+ sorter << {"Probability" => ""}
+ #else
sorter << {"Warnings" => prediction[:warnings].join("</br>")}
end
sorter.each_with_index do |hash,idx|
@@ -337,7 +344,7 @@ post '/predict/?' do
end
prediction["Consensus prediction"] = sa_prediction[:prediction] == false ? "non-mutagenic" : "mutagenic"
prediction["Consensus confidence"] = confidence.signif(3)
- prediction["Structural alerts for mutagenicity"] = sa_prediction[:matches].blank? ? "none" : sa_prediction[:matches].collect{|a| a.first}.join("; ")
+ prediction["Structural alerts for mutagenicity"] = sa_prediction[:matches].blank? ? "none" : sa_prediction[:matches].collect{|a| a.first}.join("; ").gsub(/,/," ")
end
# add additionally fields for html representation
unless prediction[:value].blank? || type == "Classification"