Sha256: 59c3d6685583dac6bd9f470bef57c317b662995534cacf88951f9bcd64a25a14

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

require 'test_helper'

puts "\n\nfind_threshold test:"
class FindThresholdTest < Test::Unit::TestCase
  def test_process_several_pvalues
    pvalues = []
    IO.popen(Helpers.exec_cmd('find_threshold', 'test/data/KLF4_f2.pat -p 0.001 0.0005'), &:read).lines.each{|line| 
      pvalue, threshold, real_pvalue = line.strip.split("\t")
      pvalues << pvalue
      assert_equal Helpers.obtain_pvalue_by_threshold("test/data/KLF4_f2.pat #{threshold}"), real_pvalue
    }
    assert_equal pvalues, ['0.0005', '0.001']
  end
  def test_process_one_pvalue
    pvalue, threshold, real_pvalue = IO.popen(Helpers.exec_cmd('find_threshold', 'test/data/KLF4_f2.pat -p 0.001'), &:read).strip.split("\t")
    assert_equal '0.001', pvalue
    assert_equal Helpers.obtain_pvalue_by_threshold("test/data/KLF4_f2.pat #{threshold}"), real_pvalue
  end
  def test_process_default_pvalue
    pvalue, threshold, real_pvalue = IO.popen(Helpers.exec_cmd('find_threshold','test/data/KLF4_f2.pat'), &:read).strip.split("\t")
    assert_equal '0.0005', pvalue
    assert_equal Helpers.obtain_pvalue_by_threshold("test/data/KLF4_f2.pat #{threshold}"), real_pvalue
  end
  def test_custom_discretization
    pvalue, threshold, real_pvalue = IO.popen(Helpers.exec_cmd('find_threshold','test/data/KLF4_f2.pat -d 100'), &:read).strip.split("\t")
    assert_equal '0.0005', pvalue
    assert_equal Helpers.obtain_pvalue_by_threshold("test/data/KLF4_f2.pat #{threshold} -d 100"), real_pvalue
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
macroape-3.3.3 test/find_threshold_test.rb