From 99a50ecb6c6cbff678048c2f60eafcfe476c1b64 Mon Sep 17 00:00:00 2001 From: mr Date: Mon, 10 Oct 2011 12:47:52 +0200 Subject: add endpoint to features --- application.rb | 4 ++-- helper.rb | 2 +- views/create.haml | 4 ++-- 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 = " \n + out = " \n
\n" out += "Please select:\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); } }); -- cgit v1.2.3