summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2011-09-23 11:54:24 +0200
committermr <mr@mrautenberg.de>2011-09-23 11:54:24 +0200
commit1492cf5ae9fd27a03b343d861673c33e55a2d135 (patch)
tree749a488abd5dd7fc2fc05fdd18c923c07a904b63
parentfb072193eebcd9dc1d64e66456846c9a08297163 (diff)
parentd6ddb236dbda13ba215e23ab8b1279874a8f380c (diff)
Merge branch 'release/v3.0.0'
-rw-r--r--fminer.rb4
-rw-r--r--lazar.rb13
2 files changed, 13 insertions, 4 deletions
diff --git a/fminer.rb b/fminer.rb
index da04431..94284db 100644
--- a/fminer.rb
+++ b/fminer.rb
@@ -281,7 +281,7 @@ post '/fminer/last/?' do
lu = LU.new # AM LAST: uses last-utils here
dom=lu.read(xml) # AM LAST: parse GraphML
smarts=lu.smarts_rb(dom,'nls') # AM LAST: converts patterns to LAST-SMARTS using msa variant (see last-pm.maunz.de)
- params[:nr_hits] != "true" ? hit_count=false: hit_count=true
+ params[:nr_hits] == "true" ? hit_count=true: hit_count=false
matches, counts = lu.match_rb(fminer.smi,smarts,hit_count) # AM LAST: creates instantiations
matches.each do |smarts, ids|
@@ -314,7 +314,7 @@ post '/fminer/last/?' do
feature_dataset.add_feature feature_uri, metadata
end
if !hit_count
- ids.each { |id| feature_dataset.add(fminer.compounds[id], feature_uri, true)}
+ ids.each { |id| feature_dataset.add(fminer.compounds[id], feature_uri, 1)}
else
ids.each_with_index { |id,i| feature_dataset.add(fminer.compounds[id], feature_uri, counts[smarts][i])}
end
diff --git a/lazar.rb b/lazar.rb
index 5de3790..f4915a7 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -61,8 +61,7 @@ post '/lazar/?' do
lazar = OpenTox::Model::Lazar.new
lazar.min_sim = params[:min_sim].to_f if params[:min_sim]
- lazar.nr_hits = true if params[:nr_hits] == "true"
-
+
if prediction_feature.feature_type == "classification"
@training_classes = training_activities.accept_values(prediction_feature.uri).sort
@training_classes.each_with_index { |c,i|
@@ -70,8 +69,18 @@ post '/lazar/?' do
params[:value_map] = lazar.value_map
}
elsif prediction_feature.feature_type == "regression"
+ lazar.nr_hits = true
lazar.prediction_algorithm = "Neighbors.local_svm_regression"
end
+
+ if params[:nr_hits] == "false" # if nr_hits is set optional to true/false it will return as String (but should be True/FalseClass)
+ lazar.nr_hits = false
+ #params[:nr_hits] = false
+ elsif params[:nr_hits] == "true"
+ lazar.nr_hits = true
+ end
+ params[:nr_hits] = "true" if lazar.nr_hits
+
task.progress 10
if params[:feature_dataset_uri]