summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2011-10-10 12:47:52 +0200
committermr <mr@mrautenberg.de>2011-10-10 12:47:52 +0200
commit99a50ecb6c6cbff678048c2f60eafcfe476c1b64 (patch)
tree5549e6261484382f50ea6a73661d290a15e97a28
parentfad3229cca5d31670f1c1d99542f3d563e226d99 (diff)
add endpoint to features
-rw-r--r--application.rb4
-rw-r--r--helper.rb2
-rw-r--r--views/create.haml4
3 files changed, 5 insertions, 5 deletions
diff --git a/application.rb b/application.rb
index 3ed2af6..a75c6c0 100644
--- a/application.rb
+++ b/application.rb
@@ -1,7 +1,7 @@
['rubygems', "haml", "sass", "rack-flash"].each do |lib|
require lib
end
-gem "opentox-ruby", "~> 2"
+gem "opentox-ruby", "~> 3"
require 'opentox-ruby'
gem 'sinatra-static-assets'
require 'sinatra/static_assets'
@@ -280,6 +280,7 @@ post '/models' do # create a new model
else
raise "#{params[:file][:filename]} has an unsupported file type."
end
+ @dataset.features[@dataset.features.keys.first][OWL.sameAs] = params[:endpoint].split(',').first if params[:endpoint]
@dataset.save(@subjectid)
rescue => e
error "Dataset creation failed '#{e.message}'",e
@@ -290,7 +291,6 @@ post '/models' do # create a new model
@prediction_feature = OpenTox::Feature.find(@dataset.features.keys.first,@subjectid)
end
end
-
task.progress(10)
if @dataset.compounds.size < 10
error "Too few compounds to create a prediction model. Did you provide compounds in SMILES format and classification activities as described in the #{link_to "instructions", "/help"}? As a rule of thumb you will need at least 100 training compounds for nongeneric datasets. A lower number could be sufficient for congeneric datasets."
diff --git a/helper.rb b/helper.rb
index 234d612..0bcde74 100644
--- a/helper.rb
+++ b/helper.rb
@@ -134,7 +134,7 @@ helpers do
end
def endpoint_selection()
- out = "<span id='endpoint_label'></span><input type='button' id='endpoint_list_button' value='select endpoint' /> \n
+ out = "<span id='endpoint_label'></span><input type='button' id='endpoint_list_button' value='Select endpoint' /> \n
<div id='div_endpoint'>\n"
out += "<b>Please select:</b>\n"
out += endpoint_level
diff --git a/views/create.haml b/views/create.haml
index acfa098..a26ae05 100644
--- a/views/create.haml
+++ b/views/create.haml
@@ -15,11 +15,11 @@
$("#endpoint_list_button").click(function() {
if ($("div#div_endpoint").is(":hidden")) {
$("div#div_endpoint").slideDown("slow");
- $("input#endpoint_list_button").val("OK");
+ $("input#endpoint_list_button").val("Hide");
$("input#endpoint_list_button").toggleClass("ok_button", true);
} else {
$("div#div_endpoint").slideUp("slow");
- $("input#endpoint_list_button").val("select endpoint");
+ $("input#endpoint_list_button").val("Select endpoint");
$("input#endpoint_list_button").toggleClass("ok_button", false);
}
});