Sha256: ca29e90c77ac8bc04154cebe8f30dd6b88b813fbcc9800e29a47d41ca6280856
Contents?: true
Size: 1.59 KB
Versions: 18
Compression:
Stored size: 1.59 KB
Contents
require 'rbbt-util' require 'rbbt/resource' module CORUM extend Resource self.subdir = 'share/databases/CORUM' def self.organism(org="Hsa") Organism.default_code(org) end CORUM.claim CORUM.complex_names, :proc do url = "http://mips.helmholtz-muenchen.de/genre/proj/corum/allComplexes.csv" tsv = TSV.open(url, :header_hash => "", :sep => ';', :sep2 => ',', :fix => Proc.new{|l| "CORUM:" + l.gsub('"','')}) tsv.namespace = organism tsv.fields = tsv.fields.collect{|f| f.gsub('"','')} tsv.key_field = "CORUM Complex ID" tsv.slice("Complex name").to_single end CORUM.claim CORUM.complexes, :proc do url = "http://mips.helmholtz-muenchen.de/genre/proj/corum/allComplexes.csv" tsv = TSV.open(url, :header_hash => "", :sep => ';', :sep2 => ',', :fix => Proc.new{|l| "CORUM:" + l.gsub('"','')}) tsv.namespace = organism tsv.fields = tsv.fields.collect{|f| f.gsub('"','')}.collect{|f| case f when "subunits (UniProt IDs)" "UniProt/SwissProt Accession" when "subunits (Entrez IDs)" "Entrez Gene ID" else f end } tsv.key_field = "CORUM Complex ID" tsv.identifiers = CORUM.complex_names.produce.find tsv end end if defined? Entity module CORUMComplex extend Entity self.annotation :format self.annotation :organism self.add_identifiers CORUM.complex_names, "CORUM Complex ID", "Complex name" property :genes => :array2single do @genes ||= CORUM.complexes.tsv(:persist => true, :fields => ["UniProt/SwissProt Accession"], :type => :flat).values_at *self end end end
Version data entries
18 entries across 18 versions & 1 rubygems