Class | Bio::KEGG::GLYCAN |
In: |
lib/bio/db/kegg/glycan.rb
|
Parent: | KEGGDB |
DELIMITER | = | RS = "\n///\n" |
TAGSIZE | = | 12 |
# File lib/bio/db/kegg/glycan.rb, line 36 36: def initialize(entry) 37: super(entry, TAGSIZE) 38: end
COMMENT
# File lib/bio/db/kegg/glycan.rb, line 118 118: def comment 119: field_fetch('COMMENT') 120: end
COMPOSITION
# File lib/bio/db/kegg/glycan.rb, line 51 51: def composition 52: unless @data['COMPOSITION'] 53: hash = Hash.new(0) 54: fetch('COMPOSITION').scan(/\((\S+)\)(\d+)/).each do |key, val| 55: hash[key] = val.to_i 56: end 57: @data['COMPOSITION'] = hash 58: end 59: @data['COMPOSITION'] 60: end
DBLINKS
# File lib/bio/db/kegg/glycan.rb, line 145 145: def dblinks_as_strings 146: unless @data['DBLINKS'] 147: @data['DBLINKS'] = lines_fetch('DBLINKS') 148: end 149: @data['DBLINKS'] 150: end
ENTRY
# File lib/bio/db/kegg/glycan.rb, line 41 41: def entry_id 42: field_fetch('ENTRY')[/\S+/] 43: end
# File lib/bio/db/kegg/glycan.rb, line 97 97: def enzymes 98: unless @data['ENZYME'] 99: field = fetch('ENZYME') 100: if /\(/.match(field) # old version 101: @data['ENZYME'] = field.scan(/\S+ \(\S+\)/) 102: else 103: @data['ENZYME'] = field.scan(/\S+/) 104: end 105: end 106: @data['ENZYME'] 107: end
ATOM, BOND
# File lib/bio/db/kegg/glycan.rb, line 153 153: def kcf 154: return "#{get('NODE')}#{get('EDGE')}" 155: end
MASS
# File lib/bio/db/kegg/glycan.rb, line 63 63: def mass 64: unless @data['MASS'] 65: @data['MASS'] = field_fetch('MASS')[/[\d\.]+/].to_f 66: end 67: @data['MASS'] 68: end
REFERENCE
# File lib/bio/db/kegg/glycan.rb, line 128 128: def references 129: unless @data['REFERENCE'] 130: ary = Array.new 131: lines = lines_fetch('REFERENCE') 132: lines.each do |line| 133: if /^\d+\s+\[PMID/.match(line) 134: ary << line 135: else 136: ary.last << " #{line.strip}" 137: end 138: end 139: @data['REFERENCE'] = ary 140: end 141: @data['REFERENCE'] 142: end