Module: KEGG

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

Class Method Summary collapse

Class Method Details

.description(id) ⇒ Object



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

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

.descriptionsObject



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

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

.id2name(id) ⇒ Object



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

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

.index2ensObject



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

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

.index2genesObject



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

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



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

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

.name2id(name) ⇒ Object



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

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

.namesObject



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

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