summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vorgrimmler <vorgrimmlerdavid@gmx.de>2012-04-18 14:27:41 +0200
committerDavid Vorgrimmler <vorgrimmlerdavid@gmx.de>2012-04-18 14:27:41 +0200
commitad7cd1120e982253ecf0b515cc90dd0e45267685 (patch)
treefc1041c8d33d88dd40c51df780254925919836a1
parent3bcc5faba7c72ec9d7efc9a80e1f28ccbe9cc54f (diff)
Improved compounds comparison in lookuppc_unified_from_jl
-rw-r--r--lib/algorithm.rb2
-rw-r--r--lib/compound.rb5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/algorithm.rb b/lib/algorithm.rb
index 4f18d89..8d661b5 100644
--- a/lib/algorithm.rb
+++ b/lib/algorithm.rb
@@ -78,7 +78,7 @@ module OpenTox
def add_fminer_data(fminer_instance, value_map)
id = 1 # fminer start id is not 0
- @training_dataset.data_entries.each do |compound,entry|
+ @training_dataset.data_entries.each do |compound,entry| #order of compounds does not influence result
begin
smiles = OpenTox::Compound.smiles(compound.to_s)
rescue
diff --git a/lib/compound.rb b/lib/compound.rb
index 770f1b5..b180b15 100644
--- a/lib/compound.rb
+++ b/lib/compound.rb
@@ -246,8 +246,9 @@ module OpenTox
ds = OpenTox::Dataset.find(feature_dataset_uri,subjectid)
#entry = ds.data_entries[self.uri]
entry = nil
- ds.data_entries.each { |c_uri, values|
- if c_uri.split('/compound/').last == self.to_inchi
+ ds.data_entries.each { |c_uri, values|
+ compound = OpenTox::Compound.new(c_uri)
+ if compound.to_inchi == self.to_inchi # Compare compounds by InChI
entry = ds.data_entries[c_uri]
break
end