Sha256: a1aaa54ea97092d1fdbf769bbf36e7e228ec64bb50f8e93357cd3cff20cc92b1

Contents?: true

Size: 894 Bytes

Versions: 9

Compression:

Stored size: 894 Bytes

Contents

require 'rbbt'
require 'rbbt/resource'

module STRING
  extend Resource
  self.subdir = "share/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

9 entries across 9 versions & 1 rubygems

Version Path
rbbt-sources-3.0.9 lib/rbbt/sources/string.rb
rbbt-sources-3.0.8 lib/rbbt/sources/string.rb
rbbt-sources-3.0.7 lib/rbbt/sources/string.rb
rbbt-sources-3.0.6 lib/rbbt/sources/string.rb
rbbt-sources-3.0.5 lib/rbbt/sources/string.rb
rbbt-sources-3.0.4 lib/rbbt/sources/string.rb
rbbt-sources-3.0.3 lib/rbbt/sources/string.rb
rbbt-sources-3.0.2 lib/rbbt/sources/string.rb
rbbt-sources-3.0.1 lib/rbbt/sources/string.rb