summaryrefslogtreecommitdiff
path: root/application.rb
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2016-11-24 16:03:09 +0000
committergebele <gebele@in-silico.ch>2016-11-24 16:03:09 +0000
commitf86c084311282036ffa7b4588c0fa0d5b59af95b (patch)
treea1c80b18ba9b2c4b3b95d1cda97144fe43a40cda /application.rb
parent769f704a2b4e2d83256f580317ed8c0b48cc4f45 (diff)
several fixes; works with lazar tree e111369ce5564f159b3f5f85c92afdd22352eaa1
Diffstat (limited to 'application.rb')
-rw-r--r--application.rb18
1 files changed, 14 insertions, 4 deletions
diff --git a/application.rb b/application.rb
index b9c267c..5f64b84 100644
--- a/application.rb
+++ b/application.rb
@@ -1,5 +1,5 @@
#require_relative 'helper.rb'
-#require 'rdiscount'
+require 'rdiscount'
include OpenTox
#require File.join(ENV["HOME"],".opentox","config","lazar-gui.rb") # until added to ot-tools
@@ -20,20 +20,24 @@ helpers do
end
+before do
+ @version = File.read("VERSION").chomp
+end
+
get '/?' do
redirect to('/predict')
end
get '/predict/?' do
- @version = File.read("VERSION").chomp
@models = OpenTox::Model::Prediction.all
+ @models = @models.delete_if{|m| m.model.name =~ /\b(Net cell association)\b/}
@endpoints = @models.collect{|m| m.endpoint}.sort.uniq
@models.count <= 0 ? (haml :info) : (haml :predict)
end
get '/predict/modeldetails/:model' do
model = OpenTox::Model::Prediction.find params[:model]
- crossvalidations = model.crossvalidations
+ crossvalidations = OpenTox::Validation::RepeatedCrossValidation.find(model.repeated_crossvalidation_id).crossvalidations
#confidence_plots = crossvalidations.collect{|cv| [cv.id, cv.confidence_plot]}
#confidence_plots.each do |confp|
# File.open(File.join('public', "confp#{confp[0]}.svg"), 'w'){|file| file.write(confp[1])} unless File.exists? File.join('public', "confp#{confp[0]}.svg")
@@ -45,7 +49,7 @@ get '/predict/modeldetails/:model' do
# end
#end
- return haml :model_details, :layout=> false, :locals => {:model => model}
+ return haml :model_details, :layout=> false, :locals => {:model => model, :crossvalidations => crossvalidations}
end
get '/jme_help/?' do
@@ -305,6 +309,12 @@ post '/predict/?' do
haml :prediction
end
end
+
+get '/license' do
+ @license = RDiscount.new(File.read("LICENSE.md")).to_html
+ haml :license, :layout => false
+end
+
=begin
get '/faq' do
@faq = RDiscount.new(File.read("FAQ.md")).to_html