diff options
-rw-r--r-- | lib/algorithm.rb | 2 | ||||
-rw-r--r-- | lib/compound.rb | 5 |
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 |