summaryrefslogtreecommitdiff
path: root/algorithm.rb
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 /algorithm.rb
parent6d29bded8a59146755b07f07f35c44a19ec7d7da (diff)
Added TUM clustering
Diffstat (limited to 'algorithm.rb')
-rw-r--r--algorithm.rb14
1 files changed, 14 insertions, 0 deletions
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