Class Bio::KEGG::GENOME
In: lib/bio/db/kegg/genome.rb
Parent: KEGGDB

Methods

Included Modules

Common::References

Constants

DELIMITER = RS = "\n///\n"
TAGSIZE = 12

Public Class methods

[Source]

    # File lib/bio/db/kegg/genome.rb, line 38
38:   def initialize(entry)
39:     super(entry, TAGSIZE)
40:   end

Public Instance methods

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

[Source]

     # 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

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

[Source]

     # File lib/bio/db/kegg/genome.rb, line 134
134:   def comment
135:     field_fetch('COMMENT')
136:   end

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

[Source]

     # File lib/bio/db/kegg/genome.rb, line 106
106:   def data_source
107:     field_fetch('DATA_SOURCE')
108:   end

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

[Source]

    # File lib/bio/db/kegg/genome.rb, line 75
75:   def definition
76:     field_fetch('DEFINITION')
77:   end

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

[Source]

     # File lib/bio/db/kegg/genome.rb, line 129
129:   def disease
130:     field_fetch('DISEASE')
131:   end

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

[Source]

    # File lib/bio/db/kegg/genome.rb, line 65
65:   def entry_id
66:     field_fetch('ENTRY')[/\S+/]
67:   end
length()

Alias for nalen

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

[Source]

     # File lib/bio/db/kegg/genome.rb, line 101
101:   def lineage
102:     taxonomy['lineage']
103:   end

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

[Source]

     # File lib/bio/db/kegg/genome.rb, line 189
189:   def nalen
190:     statistics['num_nuc']
191:   end

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

[Source]

    # File lib/bio/db/kegg/genome.rb, line 70
70:   def name
71:     field_fetch('NAME')
72:   end

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

[Source]

     # 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.

[Source]

     # File lib/bio/db/kegg/genome.rb, line 200
200:   def num_rna
201:     statistics['num_rna']
202:   end
organism()

Alias for definition

Returns ORIGINAL_DB record as an Array containing String objects.


Arguments:

Returns:Array containing String objects

[Source]

     # File lib/bio/db/kegg/genome.rb, line 124
124:   def original_databases
125:     lines_fetch('ORIGINAL_DB')
126:   end

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

[Source]

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

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

[Source]

     # 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.

[Source]

    # File lib/bio/db/kegg/genome.rb, line 35
35:   def references; super; end

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

[Source]

     # 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

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

[Source]

    # File lib/bio/db/kegg/genome.rb, line 96
96:   def taxid
97:     taxonomy['taxid']
98:   end

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

[Source]

    # 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

[Validate]