Sha256: b1027e64113bf904357647675d283d5a585e2439fd967df3ffcfc386de52a000

Contents?: true

Size: 904 Bytes

Versions: 92

Compression:

Stored size: 904 Bytes

Contents

require 'rbbt'
require 'rbbt/resource'

module STRING
  extend Resource
  self.subdir = "share/databases/string"

  STRING.claim STRING.root, :rake, Rbbt.share.install.STRING.Rakefile.find(:lib)
end

if defined? Entity and defined? Gene and Entity === Gene
  module Gene
    property :string_interactors => :array2single do |*args|
      threshold = args.first || 800
      string = STRING.protein_protein.tsv(:unnamed => true, :persist => true, :type => :double)
      all = self.ensembl.collect do |gene|
        interactors = gene.proteins.collect{|protein| Misc.zip_fields((string[protein] || [[],[]])).select{|i, score| score.to_i > threshold}.collect{|ints,s| ints}}.compact.flatten.uniq
        Protein.setup(interactors, "Ensembl Protein ID", organism).transcript.gene.compact.uniq
      end

      all.compact.first.annotate all if Annotated === all.compact.first 

      all
    end
  end
end

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
rbbt-sources-3.4.2 lib/rbbt/sources/string.rb
rbbt-sources-3.4.1 lib/rbbt/sources/string.rb
rbbt-sources-3.3.0 lib/rbbt/sources/string.rb
rbbt-sources-3.2.16 lib/rbbt/sources/string.rb
rbbt-sources-3.2.15 lib/rbbt/sources/string.rb
rbbt-sources-3.2.14 lib/rbbt/sources/string.rb
rbbt-sources-3.2.13 lib/rbbt/sources/string.rb
rbbt-sources-3.2.12 lib/rbbt/sources/string.rb
rbbt-sources-3.2.11 lib/rbbt/sources/string.rb
rbbt-sources-3.2.10 lib/rbbt/sources/string.rb
rbbt-sources-3.2.9 lib/rbbt/sources/string.rb
rbbt-sources-3.2.8 lib/rbbt/sources/string.rb
rbbt-sources-3.2.6 lib/rbbt/sources/string.rb
rbbt-sources-3.2.4 lib/rbbt/sources/string.rb
rbbt-sources-3.2.3 lib/rbbt/sources/string.rb
rbbt-sources-3.2.2 lib/rbbt/sources/string.rb
rbbt-sources-3.2.1 lib/rbbt/sources/string.rb
rbbt-sources-3.2.0 lib/rbbt/sources/string.rb
rbbt-sources-3.1.52 lib/rbbt/sources/string.rb
rbbt-sources-3.1.51 lib/rbbt/sources/string.rb