Sha256: 4e07f65699147f5fb12ff85ee1a2905205848ffd403f5f02cf411c342655e79f

Contents?: true

Size: 1018 Bytes

Versions: 27

Compression:

Stored size: 1018 Bytes

Contents

require 'rbbt'
require 'rbbt/resource'
require 'rbbt/tsv'

module PSI_MI
  extend Resource
  self.subdir = Rbbt.share.databases.PSI_MI

  URL="http://psidev.cvs.sourceforge.net/viewvc/psidev/psi/mi/rel25/data/psi-mi25.obo"

  PSI_MI.claim PSI_MI.identifiers, :proc do
    tsv = TSV.setup({}, :type => :list, :key_field => "PSI-MI Term", :fields => ["Name", "Description"])
    Open.open(URL).read.split("[Term]").each do |chunk|
      id = chunk.scan(/id: ([^\n]*)/)[0]
      name = chunk.scan(/name: ([^\n]*)/)[0]
      description = chunk.scan(/def: "([^\n]*)"/)[0]
      tsv[id] = [name, description]
    end
    tsv.to_s
  end
end


if defined? Entity 
  require 'rbbt/entity/gene'
  require 'rbbt/entity/interactor'
  require 'rbbt/sources/PSI_MI'

  module PSI_MITerm
    extend Entity

    self.format = "PSI-MI Term"

    property :name => :array2single do
      @@index ||= PSI_MI.identifiers.tsv(:persist => true, :fields => ["Name"], :type => :single)
      @@index.values_at(*self)
    end
    
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
rbbt-sources-3.0.17 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.16 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.14 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.13 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.12 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.11 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.10 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.9 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.8 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.7 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.6 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.5 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.4 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.3 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.2 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.1 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-3.0.0 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-2.1.7 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-2.1.5 lib/rbbt/sources/PSI_MI.rb
rbbt-sources-2.1.4 lib/rbbt/sources/PSI_MI.rb