Class: EuPathDBGeneInformation

Inherits:
Object
  • Object
show all
Defined in:
lib/protk/eupathdb_gene_information_table.rb

Overview

Each gene in the gene information table is represented by 2 types of information - info and tables. info are 1 line data, whereas tables are tables of data with possibly multiple rows

Instance Method Summary collapse

Instance Method Details

#add_information(key, value) ⇒ Object



141
142
143
144
145
# File 'lib/protk/eupathdb_gene_information_table.rb', line 141

def add_information(key, value)
  @info ||= {}
  @info[key] = value
  "Added info #{key}, now is #{@info[key]}"
end

#add_table(name, headers, data) ⇒ Object



147
148
149
150
151
152
153
154
155
156
157
# File 'lib/protk/eupathdb_gene_information_table.rb', line 147

def add_table(name, headers, data)
  @tables ||= {}
  @tables[name] = []
  data.each do |row|
    final = {}
    row.each_with_index do |cell, i|
      final[headers[i]] = cell
    end
    @tables[name].push final
  end
end

#get_info(key) ⇒ Object Also known as: []



132
133
134
# File 'lib/protk/eupathdb_gene_information_table.rb', line 132

def get_info(key)
  @info[key]
end

#get_table(table_name) ⇒ Object



137
138
139
# File 'lib/protk/eupathdb_gene_information_table.rb', line 137

def get_table(table_name)
  @tables[table_name]
end

#infoObject



128
129
130
# File 'lib/protk/eupathdb_gene_information_table.rb', line 128

def info
  @info
end