Sha256: c94640124237d7a0cf0eb19366d144291f6cfd6fc6d63cd2257292cd5d3dbc53

Contents?: true

Size: 893 Bytes

Versions: 4

Compression:

Stored size: 893 Bytes

Contents

require 'phgx'

module STRING
  extend Resource
  self.pkgdir = "phgx"
  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

4 entries across 4 versions & 2 rubygems

Version Path
rbbt-sources-3.0.0 lib/rbbt/sources/string.rb
rbbt-phgx-2.1.2 lib/rbbt/sources/string.rb
rbbt-phgx-2.1.1 lib/rbbt/sources/string.rb
rbbt-phgx-2.1.0 lib/rbbt/sources/string.rb