summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2011-03-28 18:44:13 +0200
committerChristoph Helma <helma@in-silico.ch>2011-03-28 18:44:13 +0200
commita31facccdff1c6b47b872263f202fb706c10f540 (patch)
tree5ae584e60b738d02ec43f02e0a62083522cd9681
parent3232b05dbcb4878c3ec0e82393035987ff1f79a5 (diff)
parent640f0f690a1e4427c5ba7e82d3aa587b25c98b29 (diff)
Merge branch 'hotfix/v1.0.5'v1.0.5
-rw-r--r--fminer.rb95
1 files changed, 50 insertions, 45 deletions
diff --git a/fminer.rb b/fminer.rb
index f5502bc..0b18c01 100644
--- a/fminer.rb
+++ b/fminer.rb
@@ -1,6 +1,7 @@
ENV['FMINER_SMARTS'] = 'true'
ENV['FMINER_NO_AROMATIC'] = 'true'
ENV['FMINER_PVALUES'] = 'true'
+ENV['FMINER_SILENT'] = 'true'
@@bbrc = Bbrc::Bbrc.new
@@last = Last::Last.new
@@ -118,29 +119,31 @@ post '/fminer/bbrc/?' do
next
end
entry.each do |feature,values|
- values.each do |value|
- if value.nil?
- LOGGER.warn "No #{feature} activiity for #{compound.to_s}."
- else
- case value.to_s
- when "true"
- nr_active += 1
- activity = 1
- when "false"
- nr_inactive += 1
- activity = 0
+ if feature == prediction_feature
+ values.each do |value|
+ if value.nil?
+ LOGGER.warn "No #{feature} activiity for #{compound.to_s}."
else
- activity = value.to_f
- @@bbrc.SetRegression(true)
- end
- begin
- @@bbrc.AddCompound(smiles,id)
- @@bbrc.AddActivity(activity, id)
- all_activities[id]=activity # DV: insert global information
- compounds[id] = compound
- id += 1
- rescue
- LOGGER.warn "Could not add " + smiles + "\t" + value.to_s + " to fminer"
+ case value.to_s
+ when "true"
+ nr_active += 1
+ activity = 1
+ when "false"
+ nr_inactive += 1
+ activity = 0
+ else
+ activity = value.to_f
+ @@bbrc.SetRegression(true)
+ end
+ begin
+ @@bbrc.AddCompound(smiles,id)
+ @@bbrc.AddActivity(activity, id)
+ all_activities[id]=activity # DV: insert global information
+ compounds[id] = compound
+ id += 1
+ rescue
+ LOGGER.warn "Could not add " + smiles + "\t" + value.to_s + " to fminer"
+ end
end
end
end
@@ -275,30 +278,32 @@ post '/fminer/last/?' do
next
end
entry.each do |feature,values|
- values.each do |value|
- if value.nil?
- LOGGER.warn "No #{feature} activiity for #{compound.to_s}."
- else
- case value.to_s
- when "true"
- nr_active += 1
- activity = 1
- when "false"
- nr_inactive += 1
- activity = 0
+ if feature == prediction_feature
+ values.each do |value|
+ if value.nil?
+ LOGGER.warn "No #{feature} activiity for #{compound.to_s}."
else
- activity = value.to_f
- @@last.SetRegression(true)
- end
- begin
- @@last.AddCompound(smiles,id)
- @@last.AddActivity(activity, id)
- all_activities[id]=activity # DV: insert global information
- compounds[id] = compound
- smi[id] = smiles # AM LAST: changed this to store SMILES.
- id += 1
- rescue
- LOGGER.warn "Could not add " + smiles + "\t" + value.to_s + " to fminer"
+ case value.to_s
+ when "true"
+ nr_active += 1
+ activity = 1
+ when "false"
+ nr_inactive += 1
+ activity = 0
+ else
+ activity = value.to_f
+ @@last.SetRegression(true)
+ end
+ begin
+ @@last.AddCompound(smiles,id)
+ @@last.AddActivity(activity, id)
+ all_activities[id]=activity # DV: insert global information
+ compounds[id] = compound
+ smi[id] = smiles # AM LAST: changed this to store SMILES.
+ id += 1
+ rescue
+ LOGGER.warn "Could not add " + smiles + "\t" + value.to_s + " to fminer"
+ end
end
end
end