Sha256: ec34fd07ca731137f3c01aab42c8c95189a5cc7a1b126f67b2ed3e01001ac679

Contents?: true

Size: 1.29 KB

Versions: 44

Compression:

Stored size: 1.29 KB

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helper.rb')
require 'rbbt-util'
require 'rbbt/entity'
require 'rbbt/entity/identifiers'

module Gene
  extend Entity
end

require 'rbbt/sources/kegg'
require 'rbbt/sources/organism'
Gene.add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
Gene.add_identifiers KEGG.identifiers
Gene.add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
Gene.add_identifiers KEGG.identifiers

class TestEntityIdentifiers < Test::Unit::TestCase
  def test_name
    Gene.add_identifiers datafile_test('identifiers'), "Ensembl Gene ID", "Associated Gene Name"
    assert_equal "TP53", Gene.setup("ENSG00000141510").name
  end

  def test_name_organism
    assert_equal "TP53", Gene.setup("ENSG00000141510", "Ensembl Gene ID", "Hsa/feb2014").name
  end

  def test_identifier_files
    assert Gene.identifier_files.any?
  end

  def test_Entity_identifier_files
    assert Entity.identifier_files("Ensembl Gene ID").any?
  end

  def test_translate_kegg
    assert_match "hsa", Gene.setup("ENSG00000141510", "Ensembl Gene ID", "Hsa/feb2014").to("KEGG Gene ID")
    assert_match "TP53", Gene.setup("ENSG00000141510", "Ensembl Gene ID", "Hsa/feb2014").to("KEGG Gene ID").to(:name)
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
rbbt-util-5.17.11 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.17.10 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.17.9 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.17.7 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.17.6 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.17.5 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.17.4 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.17.3 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.17.2 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.17.1 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.17.0 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.16.3 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.16.2 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.16.1 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.16.0 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.15.3 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.15.2 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.15.1 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.14.39 test/rbbt/entity/test_identifiers.rb
rbbt-util-5.14.38 test/rbbt/entity/test_identifiers.rb