diff options
author | rautenberg <rautenberg@in-silico.ch> | 2013-04-29 17:54:19 +0200 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2013-04-29 17:54:19 +0200 |
commit | f0fa91838f2af446efdb5d2ed83d723fad5eb53a (patch) | |
tree | 0a0934291938e04612d9e751ef922232d62119cb | |
parent | dfb23736c7fce77e8dddcd7ae7d7133b0c4bdf99 (diff) |
add subjectid to several .new calls
-rw-r--r-- | descriptor.rb | 4 | ||||
-rw-r--r-- | lib/dataset.rb | 2 | ||||
-rw-r--r-- | lib/lazar.rb | 6 | ||||
-rw-r--r-- | webapp/fminer.rb | 12 | ||||
-rw-r--r-- | webapp/test.rb | 2 |
5 files changed, 13 insertions, 13 deletions
diff --git a/descriptor.rb b/descriptor.rb index 96599d6..25ec4f3 100644 --- a/descriptor.rb +++ b/descriptor.rb @@ -156,7 +156,7 @@ module OpenTox before '/descriptor/?*' do if request.get? - @algorithm = OpenTox::Algorithm.new @uri + @algorithm = OpenTox::Algorithm.new @uri, @subjectid @algorithm.parameters = [ { RDF::DC.description => "Dataset URI", RDF::OT.paramScope => "optional", @@ -233,7 +233,7 @@ module OpenTox if params[:compound_uri] compounds = [ Compound.new(params[:compound_uri], @subjectid) ] elsif params[:dataset_uri] - compounds = Dataset.new(params[:dataset_uri]).compounds + compounds = Dataset.new(params[:dataset_uri], @subjectid).compounds end [:openbabel, :cdk, :joelib].each{ |lib| send lib, compounds, descriptors[lib] } @feature_dataset.put diff --git a/lib/dataset.rb b/lib/dataset.rb index a42356b..4f51e41 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -13,7 +13,7 @@ module OpenTox # @return [Object] activity Database activity, or nil def database_activity(params) f=Feature.new params[:prediction_feature_uri], @subjectid - db_act = values(Compound.new(params[:compound_uri]), f) + db_act = values(Compound.new(params[:compound_uri], @subjectid), f) if !db_act.empty? if f.feature_type == "classification" db_act = db_act.to_scale.mode.dup diff --git a/lib/lazar.rb b/lib/lazar.rb index 3b8621c..ad0a406 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -24,7 +24,7 @@ module OpenTox instance_variable_set("@#{k}", []) } - @prediction_feature = OpenTox::Feature.new(@prediction_feature_uri,@subjectid) + @prediction_feature = OpenTox::Feature.new @prediction_feature_uri, @subjectid @predicted_variable = OpenTox::Feature.new @predicted_variable_uri, @subjectid @predicted_confidence = OpenTox::Feature.new @predicted_confidence_uri, @subjectid #@prediction_dataset.metadata = { @@ -113,7 +113,7 @@ module OpenTox if @compound_uri # add neighbors only for compound predictions @neighbors.each do |neighbor| - n = OpenTox::Compound.new(neighbor[:compound]) + n = OpenTox::Compound.new(neighbor[:compound], @subjectid) @prediction_dataset.add_data_entry n, @prediction_feature, @prediction_feature.value_map[neighbor[:activity]] @prediction_dataset.add_data_entry n, @similarity_feature, neighbor[:similarity] #@prediction_dataset << [ n, @prediction_feature.value_map[neighbor[:activity]], nil, nil, neighbor[:similarity] ] @@ -199,7 +199,7 @@ module OpenTox self[RDF::OT.featureDataset] = params["feature_dataset_uri"] else # run feature generation algorithm - feature_dataset_uri = OpenTox::Algorithm.new(params[:feature_generation_uri]).run(params) + feature_dataset_uri = OpenTox::Algorithm.new(params[:feature_generation_uri], @subjectid).run(params) @parameters << {RDF::DC.title => "feature_dataset_uri", RDF::OT.paramValue => feature_dataset_uri} self[RDF::OT.featureDataset] = feature_dataset_uri end diff --git a/webapp/fminer.rb b/webapp/fminer.rb index 4f9abfe..95d3621 100644 --- a/webapp/fminer.rb +++ b/webapp/fminer.rb @@ -33,7 +33,7 @@ module OpenTox # Get representation of BBRC algorithm # @return [String] Representation get "/fminer/bbrc/?" do - algorithm = OpenTox::Algorithm.new(to('/fminer/bbrc',:full)) + algorithm = OpenTox::Algorithm.new(to('/fminer/bbrc',:full), @subjectid) algorithm.metadata = { RDF::DC.title => 'Backbone Refinement Class Representatives', RDF::DC.creator => "andreas@maunz.de", @@ -55,7 +55,7 @@ module OpenTox # Get representation of BBRC-sample algorithm # @return [String] Representation get "/fminer/bbrc/sample/?" do - algorithm = OpenTox::Algorithm.new(to('/fminer/bbrc/sample',:full)) + algorithm = OpenTox::Algorithm.new(to('/fminer/bbrc/sample',:full), @subjectid) algorithm.metadata = { RDF::DC.title => 'Backbone Refinement Class Representatives, obtained from samples of a dataset', RDF::DC.creator => "andreas@maunz.de", @@ -77,7 +77,7 @@ module OpenTox # Get representation of fminer LAST-PM algorithm # @return [String] Representation get "/fminer/last/?" do - algorithm = OpenTox::Algorithm.new(to('/fminer/last',:full)) + algorithm = OpenTox::Algorithm.new(to('/fminer/last',:full), @subjectid) algorithm.metadata = { RDF::DC.title => 'Latent Structure Pattern Mining descriptors', RDF::DC.creator => "andreas@maunz.de", @@ -98,7 +98,7 @@ module OpenTox # Get representation of matching algorithm # @return [String] Representation get "/fminer/:method/match?" do - algorithm = OpenTox::Algorithm.new(to("/fminer/#{params[:method]}/match",:full)) + algorithm = OpenTox::Algorithm.new(to("/fminer/#{params[:method]}/match",:full), @subjectid) algorithm.metadata = { RDF::DC.title => 'fminer feature matching', RDF::DC.creator => "mguetlein@gmail.com, andreas@maunz.de", @@ -127,7 +127,7 @@ module OpenTox # @return [text/uri-list] Task URI post '/fminer/bbrc/?' do - @@fminer=OpenTox::Algorithm::Fminer.new(to('/fminer/bbrc',:full)) + @@fminer=OpenTox::Algorithm::Fminer.new(to('/fminer/bbrc',:full), @subjectid) @@fminer.check_params(params,5) task = OpenTox::Task.run("Mining BBRC features", uri('/fminer/bbrc'), @subjectid) do |task| @@ -283,7 +283,7 @@ module OpenTox # @return [text/uri-list] Task URI post '/fminer/last/?' do - @@fminer=OpenTox::Algorithm::Fminer.new(to('/fminer/last',:full)) + @@fminer=OpenTox::Algorithm::Fminer.new(to('/fminer/last',:full), @subjectid) @@fminer.check_params(params,80) task = OpenTox::Task.run("Mining LAST features", uri('/fminer/last'), @subjectid) do |task| diff --git a/webapp/test.rb b/webapp/test.rb index 75044da..dc5ac9f 100644 --- a/webapp/test.rb +++ b/webapp/test.rb @@ -6,7 +6,7 @@ module OpenTox post '/test/wait_for_error_in_task/?' do task = OpenTox::Task.run("wait_for_error_in_task",@uri,@subjectid) do |task| sleep 1 - uri = OpenTox::Dataset.new(File.join($dataset[:uri],'test/error_in_task')).post + uri = OpenTox::Dataset.new(File.join($dataset[:uri],'test/error_in_task'), @subjectid).post end response['Content-Type'] = 'text/uri-list' halt 202,task.uri.to_s+"\n" |