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 20 20: def initialize(entry) 21: super(entry, TAGSIZE) 22: end
COMMENT
# File lib/bio/db/kegg/glycan.rb, line 102 102: def comment 103: field_fetch('COMMENT') 104: end
COMPOSITION
# File lib/bio/db/kegg/glycan.rb, line 35 35: def composition 36: unless @data['COMPOSITION'] 37: hash = Hash.new(0) 38: fetch('COMPOSITION').scan(/\((\S+)\)(\d+)/).each do |key, val| 39: hash[key] = val.to_i 40: end 41: @data['COMPOSITION'] = hash 42: end 43: @data['COMPOSITION'] 44: end
DBLINKS
# File lib/bio/db/kegg/glycan.rb, line 129 129: def dblinks 130: unless @data['DBLINKS'] 131: @data['DBLINKS'] = lines_fetch('DBLINKS') 132: end 133: @data['DBLINKS'] 134: end
ENTRY
# File lib/bio/db/kegg/glycan.rb, line 25 25: def entry_id 26: field_fetch('ENTRY')[/\S+/] 27: end
# File lib/bio/db/kegg/glycan.rb, line 81 81: def enzymes 82: unless @data['ENZYME'] 83: field = fetch('ENZYME') 84: if /\(/.match(field) # old version 85: @data['ENZYME'] = field.scan(/\S+ \(\S+\)/) 86: else 87: @data['ENZYME'] = field.scan(/\S+/) 88: end 89: end 90: @data['ENZYME'] 91: end
ATOM, BOND
# File lib/bio/db/kegg/glycan.rb, line 137 137: def kcf 138: return "#{get('NODE')}#{get('EDGE')}" 139: end
MASS
# File lib/bio/db/kegg/glycan.rb, line 47 47: def mass 48: unless @data['MASS'] 49: @data['MASS'] = field_fetch('MASS')[/[\d\.]+/].to_f 50: end 51: @data['MASS'] 52: end
PATHWAY
# File lib/bio/db/kegg/glycan.rb, line 76 76: def pathways 77: lines_fetch('PATHWAY') 78: end
REFERENCE
# File lib/bio/db/kegg/glycan.rb, line 112 112: def references 113: unless @data['REFERENCE'] 114: ary = Array.new 115: lines = lines_fetch('REFERENCE') 116: lines.each do |line| 117: if /^\d+\s+\[PMID/.match(line) 118: ary << line 119: else 120: ary.last << " #{line.strip}" 121: end 122: end 123: @data['REFERENCE'] = ary 124: end 125: @data['REFERENCE'] 126: end