Sha256: a510bc6cc73ccfb0772755cbe96c00a81c10eafe42ccced5e82b6751248d5c5a

Contents?: true

Size: 1.18 KB

Versions: 46

Compression:

Stored size: 1.18 KB

Contents

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

class TestAssociationIndex < Test::Unit::TestCase

  def setup
    Workflow.require_workflow "Genomics"
    require 'rbbt/entity/gene'
  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(10) 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

46 entries across 46 versions & 1 rubygems

Version Path
rbbt-util-5.5.47 test/rbbt/association/test_index.rb
rbbt-util-5.5.46 test/rbbt/association/test_index.rb
rbbt-util-5.5.45 test/rbbt/association/test_index.rb
rbbt-util-5.5.44 test/rbbt/association/test_index.rb
rbbt-util-5.5.43 test/rbbt/association/test_index.rb
rbbt-util-5.5.42 test/rbbt/association/test_index.rb
rbbt-util-5.5.41 test/rbbt/association/test_index.rb
rbbt-util-5.5.40 test/rbbt/association/test_index.rb
rbbt-util-5.5.39 test/rbbt/association/test_index.rb
rbbt-util-5.5.38 test/rbbt/association/test_index.rb
rbbt-util-5.5.37 test/rbbt/association/test_index.rb
rbbt-util-5.5.36 test/rbbt/association/test_index.rb
rbbt-util-5.5.35 test/rbbt/association/test_index.rb
rbbt-util-5.5.34 test/rbbt/association/test_index.rb
rbbt-util-5.5.33 test/rbbt/association/test_index.rb
rbbt-util-5.5.32 test/rbbt/association/test_index.rb
rbbt-util-5.5.31 test/rbbt/association/test_index.rb
rbbt-util-5.5.30 test/rbbt/association/test_index.rb
rbbt-util-5.5.29 test/rbbt/association/test_index.rb
rbbt-util-5.5.28 test/rbbt/association/test_index.rb