class Bio::KEGG::GENOME

Description

Parser for the KEGG GENOME database

References

Constants

DELIMITER
TAGSIZE

Public Class Methods

new(entry) click to toggle source
Calls superclass method Bio::NCBIDB::new
   # File lib/bio/db/kegg/genome.rb
38 def initialize(entry)
39   super(entry, TAGSIZE)
40 end

Public Instance Methods

chromosomes() click to toggle source

CHROMOSOME – Returns contents of the CHROMOSOME records as an Array of Hash.

    # File lib/bio/db/kegg/genome.rb
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
comment() click to toggle source

COMMENT – Returns contents of the COMMENT record as a String.

    # File lib/bio/db/kegg/genome.rb
134 def comment
135   field_fetch('COMMENT')
136 end
data_source() click to toggle source

DATA_SOURCE – Returns contents of the DATA_SOURCE record as a String.

    # File lib/bio/db/kegg/genome.rb
106 def data_source
107   field_fetch('DATA_SOURCE')
108 end
definition() click to toggle source

DEFINITION – Returns contents of the DEFINITION record as a String.

   # File lib/bio/db/kegg/genome.rb
75 def definition
76   field_fetch('DEFINITION')
77 end
Also aliased as: organism
disease() click to toggle source

DISEASE – Returns contents of the COMMENT record as a String.

    # File lib/bio/db/kegg/genome.rb
129 def disease
130   field_fetch('DISEASE')
131 end
entry_id() click to toggle source

ENTRY – Returns contents of the ENTRY record as a String.

   # File lib/bio/db/kegg/genome.rb
65 def entry_id
66   field_fetch('ENTRY')[/\S+/]
67 end
length()
Alias for: nalen
lineage() click to toggle source

Returns contents of the TAXONOMY/LINEAGE record as a String.

    # File lib/bio/db/kegg/genome.rb
101 def lineage
102   taxonomy['lineage']
103 end
nalen() click to toggle source

Returns number of nucleotides from the STATISTICS record as a Fixnum.

    # File lib/bio/db/kegg/genome.rb
189 def nalen
190   statistics['num_nuc']
191 end
Also aliased as: length
name() click to toggle source

NAME – Returns contents of the NAME record as a String.

   # File lib/bio/db/kegg/genome.rb
70 def name
71   field_fetch('NAME')
72 end
num_gene() click to toggle source

Returns number of protein genes from the STATISTICS record as a Fixnum.

    # File lib/bio/db/kegg/genome.rb
195 def num_gene
196   statistics['num_gene']
197 end
num_rna() click to toggle source

Returns number of rna from the STATISTICS record as a Fixnum.

    # File lib/bio/db/kegg/genome.rb
200 def num_rna
201   statistics['num_rna']
202 end
organism()
Alias for: definition
original_databases() click to toggle source

Returns ORIGINAL_DB record as an Array containing String objects.


Arguments:

Returns

Array containing String objects

    # File lib/bio/db/kegg/genome.rb
124 def original_databases
125   lines_fetch('ORIGINAL_DB')
126 end
original_db() click to toggle source

ORIGINAL_DB – Returns contents of the ORIGINAL_DB record as a String.

    # File lib/bio/db/kegg/genome.rb
111 def original_db
112   #field_fetch('ORIGINAL_DB')
113   unless defined?(@original_db)
114     @original_db = fetch('ORIGINAL_DB')
115   end
116   @original_db
117 end
plasmids() click to toggle source

PLASMID – Returns contents of the PLASMID records as an Array of Hash.

    # File lib/bio/db/kegg/genome.rb
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
references() click to toggle source

REFERENCE – Returns contents of the REFERENCE records as an Array of Bio::Reference objects.

   # File lib/bio/db/kegg/genome.rb
35 def references; super; end
statistics() click to toggle source

STATISTICS – Returns contents of the STATISTICS record as a Hash.

    # File lib/bio/db/kegg/genome.rb
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
taxid() click to toggle source

Returns NCBI taxonomy ID from the TAXONOMY record as a String.

   # File lib/bio/db/kegg/genome.rb
96 def taxid
97   taxonomy['taxid']
98 end
taxonomy() click to toggle source

TAXONOMY – Returns contents of the TAXONOMY record as a Hash.

   # File lib/bio/db/kegg/genome.rb
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