summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2011-06-30 13:43:44 +0200
committerAndreas Maunz <andreas@maunz.de>2011-06-30 13:43:44 +0200
commit9cd7518db30bd9846b5112b54d25359ecd76df64 (patch)
tree9bdae468381978d40943df7d43fe04bc37ba6cc4
parent2149d6e017d747927ccef80bab9e0709491a76ea (diff)
Fixed fminer tests
-rw-r--r--fminer.rb84
1 files changed, 42 insertions, 42 deletions
diff --git a/fminer.rb b/fminer.rb
index ade99a4..d553ac7 100644
--- a/fminer.rb
+++ b/fminer.rb
@@ -68,7 +68,7 @@ class FminerTest < Test::Unit::TestCase
feature = File.join @@regression_training_dataset.uri,"feature/LC50_mmol"
@dataset_uri = OpenTox::Algorithm::Fminer::BBRC.new.run({:dataset_uri => @@regression_training_dataset.uri, :prediction_feature => feature, :subjectid => @@subjectid, :feature_type=>"paths"}).to_s
dump
- assert_equal 177, @dataset.features.size # 32 bit
+ assert_equal 132, @dataset.features.size # 32 bit
#assert_equal 219, @dataset.features.size
# assert no hit counts present
@@ -76,13 +76,13 @@ class FminerTest < Test::Unit::TestCase
@dataset.data_entries.each { |c,e|
if c.to_s.scan('InChI=1S/C5H10N2O2S/c1-4(10-3)7-9-5(8)6-2/h1-3H3,(H,6,8)').size > 0
e.each { |p,h|
- if p.to_s.scan('bbrc/92').size>0
+ if p.to_s.scan('bbrc/87').size>0
count += 1 if h[0] == true
end
- if p.to_s.scan('bbrc/129').size>0
+ if p.to_s.scan('bbrc/54').size>0
count += 1 if h[0] == true
end
- if p.to_s.scan('bbrc/56').size>0
+ if p.to_s.scan('bbrc/32').size>0
count += 1 if h[0] == true
end
}
@@ -141,44 +141,44 @@ class FminerTest < Test::Unit::TestCase
end
- def test_regression_last
- feature = File.join @@regression_training_dataset.uri,"feature/LC50_mmol"
- @dataset_uri = OpenTox::Algorithm::Fminer::LAST.new.run({:dataset_uri => @@regression_training_dataset.uri, :prediction_feature => feature,
- :min_frequency => 40,
- :subjectid => @@subjectid}).to_s
- dump
- assert_equal 17, @dataset.features.size
-
-
- # assert no hit counts present
- count=0
- @dataset.data_entries.each { |c,e|
- if c.to_s.scan('InChI=1S/C9H10O3/c1-2-12-9-5-7(6-10)3-4-8(9)11/h3-6,11H,2H2,1H3').size > 0
- e.each { |p,h|
- if p.to_s.scan('last/6').size>0
- count += 1 if h[0] == true
- end
- if p.to_s.scan('last/13').size>0
- count += 1 if h[0] == true
- end
- if p.to_s.scan('last/8').size>0
- count += 1 if h[0] == true
- end
- }
- end
- }
- assert_equal 3, count
-
- # assert some values
- @dataset.features.each { |c,e|
- if c.to_s.scan('feature/last/3').size > 0
- assert_equal e['http://www.opentox.org/api/1.1#effect'], "activating"
- assert_equal e['http://www.opentox.org/api/1.1#pValue'].to_f.round_to(2), 0.45
- assert_equal e['http://www.opentox.org/api/1.1#smarts'], "[#8&A]-[#6&A]-[#6&A]-[#6&A]-[#6&A]-[#6&A]"
- end
- }
- cleanup
- end
+ def test_regression_last
+ feature = File.join @@regression_training_dataset.uri,"feature/LC50_mmol"
+ @dataset_uri = OpenTox::Algorithm::Fminer::LAST.new.run({:dataset_uri => @@regression_training_dataset.uri, :prediction_feature => feature,
+ :min_frequency => 40,
+ :subjectid => @@subjectid}).to_s
+ dump
+ assert_equal 21, @dataset.features.size
+
+
+ # assert no hit counts present
+ count=0
+ @dataset.data_entries.each { |c,e|
+ if c.to_s.scan('InChI=1S/C9H10O3/c1-2-12-9-5-7(6-10)3-4-8(9)11/h3-6,11H,2H2,1H3').size > 0
+ e.each { |p,h|
+ if p.to_s.scan('last/17').size>0
+ count += 1 if h[0] == true
+ end
+ if p.to_s.scan('last/18').size>0
+ count += 1 if h[0] == true
+ end
+ if p.to_s.scan('last/20').size>0
+ count += 1 if h[0] == true
+ end
+ }
+ end
+ }
+ assert_equal 3, count
+
+ # assert some values
+ @dataset.features.each { |c,e|
+ if c.to_s.scan('feature/last/3').size > 0
+ assert_equal e['http://www.opentox.org/api/1.1#effect'], "activating"
+ assert_equal e['http://www.opentox.org/api/1.1#pValue'].to_f.round_to(2), 0.99
+ assert_equal e['http://www.opentox.org/api/1.1#smarts'], "[#6&A]-[#6&a]:[#6&a]:[#6&a]:[#6&a]:[#6&a]"
+ end
+ }
+ cleanup
+ end