From 43b257c759ae3b83ae68b0448e2e4cff67f951be Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 24 Apr 2018 10:58:01 +0000 Subject: always show sa prediction in batch mode --- application.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'application.rb') 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("
")} - 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("
")} 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" -- cgit v1.2.3