Sha256: 5da9c842ceb312ade81425642ed5ec4e34c5c5f08fa68cdcf5f5f27e94b24266

Contents?: true

Size: 1.19 KB

Versions: 22

Compression:

Stored size: 1.19 KB

Contents

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

gem 'rbbt-sources'
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(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

22 entries across 22 versions & 1 rubygems

Version Path
rbbt-util-5.6.0 test/rbbt/association/test_index.rb
rbbt-util-5.5.68 test/rbbt/association/test_index.rb
rbbt-util-5.5.67 test/rbbt/association/test_index.rb
rbbt-util-5.5.66 test/rbbt/association/test_index.rb
rbbt-util-5.5.65 test/rbbt/association/test_index.rb
rbbt-util-5.5.64 test/rbbt/association/test_index.rb
rbbt-util-5.5.63 test/rbbt/association/test_index.rb
rbbt-util-5.5.62 test/rbbt/association/test_index.rb
rbbt-util-5.5.61 test/rbbt/association/test_index.rb
rbbt-util-5.5.60 test/rbbt/association/test_index.rb
rbbt-util-5.5.59 test/rbbt/association/test_index.rb
rbbt-util-5.5.58 test/rbbt/association/test_index.rb
rbbt-util-5.5.57 test/rbbt/association/test_index.rb
rbbt-util-5.5.56 test/rbbt/association/test_index.rb
rbbt-util-5.5.55 test/rbbt/association/test_index.rb
rbbt-util-5.5.54 test/rbbt/association/test_index.rb
rbbt-util-5.5.53 test/rbbt/association/test_index.rb
rbbt-util-5.5.52 test/rbbt/association/test_index.rb
rbbt-util-5.5.51 test/rbbt/association/test_index.rb
rbbt-util-5.5.50 test/rbbt/association/test_index.rb