summaryrefslogtreecommitdiff
path: root/test/compound.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2015-08-07 19:49:31 +0200
committerChristoph Helma <helma@in-silico.ch>2015-08-07 19:49:31 +0200
commit2dc460ee78325c731ab12b375c2bd12e4e3393e8 (patch)
treee01efea5d9a187d58b4939bf257039a99a675921 /test/compound.rb
parent03be6b36a03f00bbb432c4161da7312011ffa076 (diff)
initial k-nn weighted average implementation, validation test added
Diffstat (limited to 'test/compound.rb')
-rw-r--r--test/compound.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/compound.rb b/test/compound.rb
index 86930b6..2bf0204 100644
--- a/test/compound.rb
+++ b/test/compound.rb
@@ -74,4 +74,20 @@ class CompoundTest < MiniTest::Test
assert !c.sdf_id.nil?
end
+ def test_fingerprint
+ c = OpenTox::Compound.from_smiles "CC(=O)CC(C)C#N"
+ assert c.fp4.collect{|fid| Feature.find(fid).name}.include? ("1,3-Tautomerizable")
+ assert_equal c.fp4.size, c.fp4_size
+ end
+
+ def test_neighbors
+ d = Dataset.from_csv_file "data/EPAFHM.csv"
+ d.compounds.each do |c|
+ refute_nil c.fp4
+ end
+ c = d.compounds[371]
+ #p c
+ p c.neighbors
+ end
+
end