diff options
author | gebele <gebele@in-silico.ch> | 2013-11-15 15:51:35 +0100 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2013-11-15 15:51:35 +0100 |
commit | 3c943fbb4de62a0b0042786edfe42b4bb3a20c36 (patch) | |
tree | 05f8a494ddb701e304c9349cf695a86beb175b7b /application.rb | |
parent | 8162484d7aa31ee5f76e72c2b195e3a9ac9e9531 (diff) |
models sorted by endpoint
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/application.rb b/application.rb index 378cb13..beb544e 100644 --- a/application.rb +++ b/application.rb @@ -12,7 +12,6 @@ helpers do # model uris must be manually added @@models = [] CSV.foreach("./prediction_models.csv"){|uri| m = OpenTox::Model::Lazar.find uri[0]; @@models << m} - #$logger.debug "model uris from csv file:\t#{@@models}\n" end get '/?' do @@ -20,7 +19,8 @@ get '/?' do end get '/predict/?' do - @models = @@models + # sort models by endpoint alphabetically + @models = @@models.sort{|a, b| a.type.find{|e| e =~ /endpoint/}.to_s.downcase <=> b.type.find{|e| e =~ /endpoint/i}.to_s.downcase}.reverse haml :predict end |