Sha256: f124e74bf0b47e556fc55b27ee4f4a8ac86f4113980793e36aacc048c4fd0c41

Contents?: true

Size: 1.17 KB

Versions: 114

Compression:

Stored size: 1.17 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
require 'rbbt/workflow'
require 'rbbt/association'
require 'rbbt/association/index'

#Workflow.require_workflow "Genomics"
#require 'rbbt/entity/gene'

class TestAssociationIndex < Test::Unit::TestCase

  def setup
  end

  def teardown
  end


  def __test_subset
    require 'rbbt/sources/pina'
    require 'rbbt/sources/kegg'
    tp53 = Gene.setup("TP53", "Associated Gene Name", "Hsa/jan2013").ensembl
    index = Association.index(Pina.protein_protein,
                              {:namespace => tp53.organism, 
                                :target => "Interactor UniProt/SwissProt Accession=~UniProt/SwissProt Accession",
                                :format => "Ensembl Gene ID",
                                :undirected => true}, 
                                {:dir => '/tmp/test_association3', :update => false})
    genes = tp53.pina_interactors.ensembl
    genes << tp53

    Misc.benchmark(100) do
      index.subset_entities("Ensembl Gene ID" => genes).length
    end

    assert_equal 204, index.subset_entities("Ensembl Gene ID" => genes).select{|m| m.partition("~")[0] == tp53}.uniq.length
  end
end

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
rbbt-util-5.14.10 test/rbbt/association/test_index.rb
rbbt-util-5.14.9 test/rbbt/association/test_index.rb
rbbt-util-5.14.8 test/rbbt/association/test_index.rb
rbbt-util-5.14.7 test/rbbt/association/test_index.rb
rbbt-util-5.14.6 test/rbbt/association/test_index.rb
rbbt-util-5.14.5 test/rbbt/association/test_index.rb
rbbt-util-5.14.4 test/rbbt/association/test_index.rb
rbbt-util-5.14.3 test/rbbt/association/test_index.rb
rbbt-util-5.14.2 test/rbbt/association/test_index.rb
rbbt-util-5.14.1 test/rbbt/association/test_index.rb
rbbt-util-5.14.0 test/rbbt/association/test_index.rb
rbbt-util-5.13.37 test/rbbt/association/test_index.rb
rbbt-util-5.13.36 test/rbbt/association/test_index.rb
rbbt-util-5.13.35 test/rbbt/association/test_index.rb
rbbt-util-5.13.34 test/rbbt/association/test_index.rb
rbbt-util-5.13.33 test/rbbt/association/test_index.rb
rbbt-util-5.13.32 test/rbbt/association/test_index.rb
rbbt-util-5.13.31 test/rbbt/association/test_index.rb
rbbt-util-5.13.30 test/rbbt/association/test_index.rb
rbbt-util-5.13.29 test/rbbt/association/test_index.rb