Module: KEGG

Extended by:
Resource
Defined in:
lib/rbbt/sources/kegg.rb

Class Method Summary collapse

Class Method Details

.description(id) ⇒ Object



41
42
43
# File 'lib/rbbt/sources/kegg.rb', line 41

def self.description(id)
  descriptions[id]
end

.descriptionsObject



15
16
17
# File 'lib/rbbt/sources/kegg.rb', line 15

def self.descriptions
  @@descriptions ||= KEGG.pathways.tsv(:fields => ["Pathway Description"], :persist => true, :type => :single, :unnamed => true)
end

.id2name(id) ⇒ Object



32
33
34
# File 'lib/rbbt/sources/kegg.rb', line 32

def self.id2name(id)
  names[id]
end

.index2ensObject



24
25
26
# File 'lib/rbbt/sources/kegg.rb', line 24

def self.index2ens
  @@index2ens ||= KEGG.identifiers.index(:persist => true)
end

.index2genesObject



20
21
22
# File 'lib/rbbt/sources/kegg.rb', line 20

def self.index2genes
  @@index2genes ||= KEGG.gene_pathway.tsv(:key_field => "KEGG Pathway ID", :fields => ["KEGG Gene ID"], :persist => true, :type => :flat, :merge => true)
end

.index2keggObject



28
29
30
# File 'lib/rbbt/sources/kegg.rb', line 28

def self.index2kegg
  @@index2kegg ||= KEGG.identifiers.index(:target => "KEGG Gene ID", :persist => true)
end

.name2id(name) ⇒ Object



36
37
38
# File 'lib/rbbt/sources/kegg.rb', line 36

def self.name2id(name)
  names.select{|id,n| n.downcase.index(name.downcase) == 0}.collect{|id,n| id} rescue []
end

.namesObject



11
12
13
# File 'lib/rbbt/sources/kegg.rb', line 11

def self.names
  @@names ||= KEGG.pathways.tsv :fields => ["Pathway Name"], :persist => true, :type => :single, :unnamed => true
end