Class | Bio::KEGG::GENES |
In: |
lib/bio/db/kegg/genes.rb
|
Parent: | KEGGDB |
DELIMITER | = | RS = "\n///\n" |
TAGSIZE | = | 12 |
Creates a new Bio::KEGG::GENES object.
Arguments:
Returns: | Bio::KEGG::GENES object |
# File lib/bio/db/kegg/genes.rb, line 115 115: def initialize(entry) 116: super(entry, TAGSIZE) 117: end
Returns length of the amino acid sequence described in the AASEQ lines.
Returns: | Integer |
# File lib/bio/db/kegg/genes.rb, line 393 393: def aalen 394: fetch('AASEQ')[/\d+/].to_i 395: end
Returns amino acid sequence described in the AASEQ lines.
Returns: | Bio::Sequence::AA object |
# File lib/bio/db/kegg/genes.rb, line 383 383: def aaseq 384: unless @data['AASEQ'] 385: @data['AASEQ'] = Bio::Sequence::AA.new(fetch('AASEQ').gsub(/\d+/, '')) 386: end 387: @data['AASEQ'] 388: end
Codon usage data described in the CODON_USAGE lines. (Deprecated: no more exists)
Returns: | Hash |
# File lib/bio/db/kegg/genes.rb, line 350 350: def codon_usage(codon = nil) 351: unless @data['CODON_USAGE'] 352: hash = Hash.new 353: list = cu_list 354: base = %w(t c a g) 355: base.each_with_index do |x, i| 356: base.each_with_index do |y, j| 357: base.each_with_index do |z, k| 358: hash["#{x}#{y}#{z}"] = list[i*16 + j*4 + k] 359: end 360: end 361: end 362: @data['CODON_USAGE'] = hash 363: end 364: @data['CODON_USAGE'] 365: end
Codon usage data described in the CODON_USAGE lines as an array.
Returns: | Array |
# File lib/bio/db/kegg/genes.rb, line 370 370: def cu_list 371: ary = [] 372: get('CODON_USAGE').sub(/.*/,'').each_line do |line| # cut 1st line 373: line.chomp.sub(/^.{11}/, '').scan(/..../) do |cu| 374: ary.push(cu.to_i) 375: end 376: end 377: return ary 378: end
Enzyme‘s EC numbers shown in the DEFINITION line.
Returns: | Array containing String |
# File lib/bio/db/kegg/genes.rb, line 206 206: def eclinks 207: unless defined? @eclinks 208: ec_list = 209: definition.slice(/\[EC\:([^\]]+)\]/, 1) || 210: definition.slice(/\(EC\:([^\)]+)\)/, 1) 211: ary = ec_list ? ec_list.strip.split(/\s+/) : [] 212: @eclinks = ary 213: end 214: @eclinks 215: end
Returns the "ENTRY" line content as a Hash. For example,
{"organism"=>"E.coli", "division"=>"CDS", "id"=>"b0356"}
Returns: | Hash |
# File lib/bio/db/kegg/genes.rb, line 125 125: def entry 126: unless @data['ENTRY'] 127: hash = Hash.new('') 128: if get('ENTRY').length > 30 129: e = get('ENTRY') 130: hash['id'] = e[12..29].strip 131: hash['division'] = e[30..39].strip 132: hash['organism'] = e[40..80].strip 133: end 134: @data['ENTRY'] = hash 135: end 136: @data['ENTRY'] 137: end
The method will be deprecated. Use Bio::KEGG::GENES#names.
Names of the entry as an Array, described in the NAME line.
Returns: | Array containing String |
# File lib/bio/db/kegg/genes.rb, line 182 182: def genes 183: names_as_array 184: end
Returns an Array of biological classes in CLASS field.
# File lib/bio/db/kegg/genes.rb, line 247 247: def keggclasses 248: keggclass.gsub(/ \[[^\]]+/, '').split(/\] ?/) 249: end
The position in the genome described in the POSITION line as Bio::Locations object.
Returns: | Bio::Locations object |
# File lib/bio/db/kegg/genes.rb, line 286 286: def locations 287: Bio::Locations.new(gbposition) 288: end
The specification of the method will be changed in the future. Please use Bio::KEGG::GENES#motifs.
Motif information described in the MOTIF lines.
Returns: | Hash |
# File lib/bio/db/kegg/genes.rb, line 325 325: def motif 326: motifs 327: end
Motif information described in the MOTIF lines.
Returns: | Hash |
# File lib/bio/db/kegg/genes.rb, line 300 300: def motifs_as_hash 301: unless @data['MOTIF'] 302: hash = {} 303: db = nil 304: motifs_as_strings.each do |line| 305: if line[/^\S+:/] 306: db, str = line.split(/:/, 2) 307: else 308: str = line 309: end 310: hash[db] ||= [] 311: hash[db] += str.strip.split(/\s+/) 312: end 313: @data['MOTIF'] = hash 314: end 315: @data['MOTIF'] # Hash of Array of IDs in MOTIF 316: end
Motif information described in the MOTIF lines.
Returns: | Strings |
# File lib/bio/db/kegg/genes.rb, line 293 293: def motifs_as_strings 294: lines_fetch('MOTIF') 295: end
Returns nucleic acid sequence length.
Returns: | Integer |
# File lib/bio/db/kegg/genes.rb, line 411 411: def ntlen 412: fetch('NTSEQ')[/\d+/].to_i 413: end
Returns nucleic acid sequence described in the NTSEQ lines.
Returns: | Bio::Sequence::NA object |
# File lib/bio/db/kegg/genes.rb, line 400 400: def ntseq 401: unless @data['NTSEQ'] 402: @data['NTSEQ'] = Bio::Sequence::NA.new(fetch('NTSEQ').gsub(/\d+/, '')) 403: end 404: @data['NTSEQ'] 405: end
Returns a Hash of the orthology ID and definition in ORTHOLOGY field.
# File lib/bio/db/kegg/genes.rb, line 107 107: def orthologs_as_hash; super; end
Returns structure ID information described in the STRUCTURE lines.
Returns: | Array containing String |
# File lib/bio/db/kegg/genes.rb, line 339 339: def structure 340: unless @data['STRUCTURE'] 341: @data['STRUCTURE'] = fetch('STRUCTURE').sub(/(PDB: )*/,'').split(/\s+/) 342: end 343: @data['STRUCTURE'] # ['PDB:1A9X', ...] 344: end