diff options
author | Christoph Helma <helma@in-silico.ch> | 2015-09-17 14:56:25 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2015-09-17 14:56:25 +0200 |
commit | 6ac119c32cef094d4f1c2fb5c2daa4e274401f70 (patch) | |
tree | 9028a2922b68a5e2175687fe48caa1b1119e5939 /lib/neighbor.rb | |
parent | 2fdecbed76c4db8dfe3f10f825fed9772e653197 (diff) |
neighbor calculation moved to Compound class
Diffstat (limited to 'lib/neighbor.rb')
-rw-r--r-- | lib/neighbor.rb | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/neighbor.rb b/lib/neighbor.rb deleted file mode 100644 index d849cbf..0000000 --- a/lib/neighbor.rb +++ /dev/null @@ -1,25 +0,0 @@ -module OpenTox - module Algorithm - class Neighbor - - def self.fingerprint_similarity compound, params={} - compound.neighbors params[:min_sim] - end - - def self.fminer_similarity compound, params - feature_dataset = Dataset.find params[:feature_dataset_id] - query_fingerprint = Algorithm::Descriptor.smarts_match(compound, feature_dataset.features) - neighbors = [] - - # find neighbors - feature_dataset.data_entries.each_with_index do |fingerprint, i| - sim = Algorithm::Similarity.tanimoto fingerprint, query_fingerprint - if sim > params[:min_sim] - neighbors << [feature_dataset.compound_ids[i],sim] # use compound_ids, instantiation of Compounds is too time consuming - end - end - neighbors - end - end - end -end |