summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2012-05-04 13:58:53 +0200
committerAndreas Maunz <andreas@maunz.de>2012-05-04 13:58:53 +0200
commit6f203f40ba5e500d695eb4146eab11e60e03d01c (patch)
tree2d6331497d8c46a43c4bbdc6648ee3913e253dc8
parentd37c44bcdb76f000c5c9a175a698f5d92b51b3a0 (diff)
Cleaner parameter handling for sampling
-rw-r--r--fminer.rb19
m---------last-utils0
2 files changed, 4 insertions, 15 deletions
diff --git a/fminer.rb b/fminer.rb
index fd32043..53985ab 100644
--- a/fminer.rb
+++ b/fminer.rb
@@ -57,7 +57,7 @@ end
# Get RDF/XML representation of fminer bbrc algorithm
# @return [application/rdf+xml] OWL-DL representation of fminer bbrc algorithm
-get "/fminer/bbrc/sample?" do
+get "/fminer/bbrc/sample/?" do
algorithm = OpenTox::Algorithm::Generic.new(url_for('/fminer/bbrc/sample',:full))
algorithm.metadata = {
DC.title => 'fminer backbone refinement class representatives, obtained from samples of a dataset',
@@ -293,7 +293,7 @@ end
post '/fminer/bbrc/sample/?' do
fminer=OpenTox::Algorithm::Fminer.new
- fminer.check_params(params,80,@subjectid)
+ fminer.check_params(params,100,@subjectid) # AM: 100 per-mil (10%) as default minfreq
# num_boots
unless params[:num_boots]
@@ -313,17 +313,6 @@ post '/fminer/bbrc/sample/?' do
min_sampling_support= params[:min_sampling_support].to_i.ceil
end
- # re-set min_frequency
- unless params[:min_frequency]
- min_frequency = (fminer.training_dataset.compounds.size * 0.1).ceil
- LOGGER.debug "Set min_frequency to default value #{fminer.minfreq}"
- else
- raise OpenTox::BadRequestError.new "min_frequency is not numeric" unless OpenTox::Algorithm.numeric? params[:min_frequency]
- min_frequency= params[:min_frequency].to_i.ceil
- end
-
- fminer.training_dataset.compounds.size
-
task = OpenTox::Task.create("Mining BBRC sample features", url_for('/fminer',:full)) do |task|
if fminer.prediction_feature.feature_type == "regression"
raise OpenTox::BadRequestError.new "BBRC sampling is only for classification"
@@ -352,11 +341,11 @@ post '/fminer/bbrc/sample/?' do
fminer.smi = [] # AM LAST: needed for matching the patterns back
# Add data to fminer
- fminer.add_fminer_data(@@last, @value_map)
+ fminer.add_fminer_data(nil, @value_map) # AM: 'nil' as instance to only fill in administrative data
raise "No compounds in dataset #{fminer.training_dataset.uri}" if fminer.compounds.size==0
- # run bbrc-sample
+ # run bbrc-sample, obtain smarts and p-values
features = Set.new
task.progress 10
diff --git a/last-utils b/last-utils
-Subproject cf0238477127e54509b6ab8b5c38f50dd6ffce0
+Subproject efcc3f41dd9e2f590a1520dfee3bf709120b2e4