Sha256: 0bfb12ff0ea0ab154678f114ce90346bb0fbd88c2b83fa4f03017460b450ca78

Contents?: true

Size: 1.33 KB

Versions: 14

Compression:

Stored size: 1.33 KB

Contents

#
# test/unit/bio/appl/paml/codeml/test_report.rb - Unit test for Bio::PAML::Codeml::Report
#
# Copyright::  Copyright (C) 2008 Michael D. Barton <mail@michaelbarton.me.uk>
# License::    The Ruby License
#

require 'pathname'
libpath = Pathname.new(File.join(File.join(File.dirname(__FILE__), ['..'] * 6, 'lib'))).cleanpath.to_s
$:.unshift(libpath) unless $:.include?(libpath)

require 'test/unit'
require 'bio/appl/paml/codeml/report'

module Bio; module TestPAMLCodeml
class TestCodemlReport < Test::Unit::TestCase

  bioruby_root  = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 6)).cleanpath.to_s
  TEST_DATA = Pathname.new(File.join(bioruby_root, 'test', 'data', 'paml', 'codeml')).cleanpath.to_s

  def setup
    str = File.read(File.join(TEST_DATA, 'output.txt'))
    @example_report = Bio::PAML::Codeml::Report.new(str)
  end

  def test_tree_log_likelihood
    assert_equal(-1817.465211, @example_report.tree_log_likelihood)
  end

  def test_tree_length
    assert_equal(0.77902, @example_report.tree_length)
  end

  def test_alpha
    assert_equal(0.58871, @example_report.alpha)
  end

  def test_tree
    tree = "(((rabbit: 0.082889, rat: 0.187866): 0.038008, human: 0.055050): 0.033639, goat-cow: 0.096992, marsupial: 0.284574);"
    assert_equal(tree, @example_report.tree)
  end

end

end; end #module TestPAMLCodeml; module Bio

Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
bioruby-bio-1.2.9.9001 test/unit/bio/appl/paml/codeml/test_report.rb
bioruby-bio-1.2.9.9501 test/unit/bio/appl/paml/codeml/test_report.rb
bioruby-bio-1.3.0.5000 test/unit/bio/appl/paml/codeml/test_report.rb
bioruby-bio-1.3.0.9901 test/unit/bio/appl/paml/codeml/test_report.rb
bioruby-bio-1.3.0 test/unit/bio/appl/paml/codeml/test_report.rb
bioruby-bio-1.3.1.5000 test/unit/bio/appl/paml/codeml/test_report.rb
ngoto-bio-1.2.9.9001 test/unit/bio/appl/paml/codeml/test_report.rb
ngoto-bio-1.2.9.9501 test/unit/bio/appl/paml/codeml/test_report.rb
ngoto-bio-1.3.0.5000 test/unit/bio/appl/paml/codeml/test_report.rb
ngoto-bio-1.3.0 test/unit/bio/appl/paml/codeml/test_report.rb
ngoto-bio-1.3.1.5000 test/unit/bio/appl/paml/codeml/test_report.rb
wwood-bioruby-1.2.11 test/unit/bio/appl/paml/codeml/test_report.rb
bio-1.3.1 test/unit/bio/appl/paml/codeml/test_report.rb
bio-1.3.0 test/unit/bio/appl/paml/codeml/test_report.rb