diff options
author | Andreas Maunz <andreas@maunz.de> | 2012-02-08 14:40:09 +0100 |
---|---|---|
committer | Andreas Maunz <andreas@maunz.de> | 2012-02-08 14:40:09 +0100 |
commit | 3e160e2e0537e2bfc0f8c89570349aa2718e34c2 (patch) | |
tree | 68f4cb6a72985bb2331b7ad6bb07d8edd8393366 | |
parent | c2d9390594a2008b6fec2ce724462badd458ae74 (diff) |
Fixed minor bugs
-rw-r--r-- | application.rb | 3 | ||||
-rw-r--r-- | feature_selection.rb | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/application.rb b/application.rb index b62f6f5..f5b331f 100644 --- a/application.rb +++ b/application.rb @@ -11,6 +11,7 @@ require 'opentox-ruby' require 'openbabel.rb' require 'fminer.rb' require 'lazar.rb' +require 'feature_selection.rb' set :lock, true @@ -22,7 +23,7 @@ end # # @return [text/uri-list] algorithm URIs get '/?' do - list = [ url_for('/lazar', :full), url_for('/fminer/bbrc', :full), url_for('/fminer/last', :full) ].join("\n") + "\n" + list = [ url_for('/lazar', :full), url_for('/fminer/bbrc', :full), url_for('/fminer/last', :full), url_for('/feature_selection/rfe', :full) ].join("\n") + "\n" case request.env['HTTP_ACCEPT'] when /text\/html/ content_type "text/html" diff --git a/feature_selection.rb b/feature_selection.rb index c5bc4fa..efda812 100644 --- a/feature_selection.rb +++ b/feature_selection.rb @@ -71,11 +71,9 @@ post '/feature_selection/rfe/?' do task = OpenTox::Task.create("Recursive Feature Elimination", url_for('/feature_selection',:full)) do |task| r_result_file = OpenTox::Algorithm::FeatureSelection.rfe( { :ds_csv_file => tf_ds.path, :prediction_feature => prediction_feature, :fds_csv_file => tf_fds.path, :del_missing => del_missing } ) r_result_uri = OpenTox::Dataset.create_from_csv_file(r_result_file).uri - tf_ds.close! - tf_fds.close! + tf_ds.close!; tf_fds.close! + tf_ds.delete; tf_fds.delete File.unlink(r_result_file) - File.unlink(tf_ds.path) - File.unlink(tf_fds.path) r_result_uri end response['Content-Type'] = 'text/uri-list' |