summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2011-07-29 11:47:53 +0200
committerAndreas Maunz <andreas@maunz.de>2011-07-29 11:47:53 +0200
commitc6fa4a98cdf1b3ba87a6b58bb2961bed9bfa7a04 (patch)
tree8ad9ab5662b2258206389d02fcf14361b7e18228
parent6d29bded8a59146755b07f07f35c44a19ec7d7da (diff)
Added TUM clustering
-rw-r--r--Rakefile2
-rw-r--r--algorithm.rb14
2 files changed, 15 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index f183527..be97237 100644
--- a/Rakefile
+++ b/Rakefile
@@ -33,7 +33,7 @@ task :teardown do
end
#[:all, :feature, :dataset, :fminer, :lazar, :authorization, :validation].each do |t|
-[:all, :feature, :dataset, :fminer, :lazar, :authorization, :parser, :validation ].each do |t|
+[:all, :algorithm, :feature, :dataset, :fminer, :lazar, :authorization, :parser, :validation ].each do |t|
task :teardown => t
task t => :setup
end
diff --git a/algorithm.rb b/algorithm.rb
index 4acfeec..3ff1304 100644
--- a/algorithm.rb
+++ b/algorithm.rb
@@ -75,7 +75,21 @@ class AlgorithmTest < Test::Unit::TestCase
params[:nr_hits] = true
assert_in_delta OpenTox::Algorithm::Similarity.tanimoto(features_a, features_c, weights, params), 0.235749338271022, 0.000001
}
+ end
+
+ def test_clustering
+ # Parameters
+ dataset_uri = @@classification_training_dataset.uri
+ query_compound = OpenTox::Compound.from_smiles("O1COc2cc(ccc12)C")
+ c = OpenTox::Algorithm::Similarity::StructuralClustering.new dataset_uri
+ cluster_datasets = Array.new
+ if c.trained?
+ c.get_clusters query_compound.uri
+ cluster_datasets = c.target_clusters_array
end
+ assert_equal cluster_datasets.size, 2
+
+ end
end