Class | Bio::KEGG::GENOME |
In: |
lib/bio/db/kegg/genome.rb
|
Parent: | KEGGDB |
DELIMITER | = | RS = "\n///\n" |
TAGSIZE | = | 12 |
# File lib/bio/db/kegg/genome.rb, line 38 38: def initialize(entry) 39: super(entry, TAGSIZE) 40: end
CHROMOSOME — Returns contents of the CHROMOSOME records as an Array of Hash.
# File lib/bio/db/kegg/genome.rb, line 140 140: def chromosomes 141: unless @data['CHROMOSOME'] 142: @data['CHROMOSOME'] = [] 143: toptag2array(get('CHROMOSOME')).each do |chr| 144: hash = Hash.new('') 145: subtag2array(chr).each do |field| 146: hash[tag_get(field)] = truncate(tag_cut(field)) 147: end 148: @data['CHROMOSOME'].push(hash) 149: end 150: end 151: @data['CHROMOSOME'] 152: end
Returns number of nucleotides from the STATISTICS record as a Fixnum.
# File lib/bio/db/kegg/genome.rb, line 189 189: def nalen 190: statistics['num_nuc'] 191: end
Returns number of protein genes from the STATISTICS record as a Fixnum.
# File lib/bio/db/kegg/genome.rb, line 195 195: def num_gene 196: statistics['num_gene'] 197: end
Returns number of rna from the STATISTICS record as a Fixnum.
# File lib/bio/db/kegg/genome.rb, line 200 200: def num_rna 201: statistics['num_rna'] 202: end
PLASMID — Returns contents of the PLASMID records as an Array of Hash.
# File lib/bio/db/kegg/genome.rb, line 155 155: def plasmids 156: unless @data['PLASMID'] 157: @data['PLASMID'] = [] 158: toptag2array(get('PLASMID')).each do |chr| 159: hash = Hash.new('') 160: subtag2array(chr).each do |field| 161: hash[tag_get(field)] = truncate(tag_cut(field)) 162: end 163: @data['PLASMID'].push(hash) 164: end 165: end 166: @data['PLASMID'] 167: end
REFERENCE — Returns contents of the REFERENCE records as an Array of Bio::Reference objects.
# File lib/bio/db/kegg/genome.rb, line 35 35: def references; super; end
STATISTICS — Returns contents of the STATISTICS record as a Hash.
# File lib/bio/db/kegg/genome.rb, line 170 170: def statistics 171: unless @data['STATISTICS'] 172: hash = Hash.new(0.0) 173: get('STATISTICS').each_line do |line| 174: case line 175: when /nucleotides:\s+(\d+)/ 176: hash['num_nuc'] = $1.to_i 177: when /protein genes:\s+(\d+)/ 178: hash['num_gene'] = $1.to_i 179: when /RNA genes:\s+(\d+)/ 180: hash['num_rna'] = $1.to_i 181: end 182: end 183: @data['STATISTICS'] = hash 184: end 185: @data['STATISTICS'] 186: end
TAXONOMY — Returns contents of the TAXONOMY record as a Hash.
# File lib/bio/db/kegg/genome.rb, line 81 81: def taxonomy 82: unless @data['TAXONOMY'] 83: taxid, lineage = subtag2array(get('TAXONOMY')) 84: taxid = taxid ? truncate(tag_cut(taxid)) : '' 85: lineage = lineage ? truncate(tag_cut(lineage)) : '' 86: @data['TAXONOMY'] = { 87: 'taxid' => taxid, 88: 'lineage' => lineage, 89: } 90: @data['TAXONOMY'].default = '' 91: end 92: @data['TAXONOMY'] 93: end