diff options
author | mguetlein <martin.guetlein@gmail.com> | 2012-01-31 11:28:01 +0100 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2012-01-31 11:28:01 +0100 |
commit | 01e296c18ed62e81d442a67aca6b2893fd35e12e (patch) | |
tree | dae5177410a3d12999abbe6492a78bf7e0560b83 | |
parent | 3c56259cfbb71425719e3018e9ccf3dae193e004 (diff) |
add test for fminer matching
-rw-r--r-- | fminer.rb | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -363,5 +363,20 @@ end #} cleanup end + + def test_match + feature = @@classification_training_dataset.features.keys.first + feature_dataset_uri = OpenTox::Algorithm::Fminer::BBRC.new.run({ + :dataset_uri => @@classification_training_dataset.uri, :prediction_feature => feature, :subjectid => @@subjectid}).to_s + feature_dataset = OpenTox::Dataset.find(feature_dataset_uri,@@subjectid) + matched_dataset_uri = OpenTox::RestClientWrapper.post(File.join(CONFIG[:services]["opentox-algorithm"],"fminer","bbrc","match"), + {:feature_dataset_uri => feature_dataset_uri, :dataset_uri => @@multinomial_training_dataset.uri, :subjectid => @@subjectid}).to_s + matched_dataset = OpenTox::Dataset.find(matched_dataset_uri,@@subjectid) + # matched dataset should have same features as feature dataset + assert_equal feature_dataset.features.keys.sort,matched_dataset.features.keys.sort + # matched datset should have same compounds as input dataset for matching + assert_equal matched_dataset.compounds.sort,@@multinomial_training_dataset.compounds.sort + [feature_dataset_uri, matched_dataset_uri].each{|uri| OpenTox::RestClientWrapper.delete(uri,{:subjectid=>@@subjectid})} + end end |