Class: Bio::KEGG::GLYCAN
- Inherits:
-
Bio::KEGGDB
- Object
- DB
- NCBIDB
- Bio::KEGGDB
- Bio::KEGG::GLYCAN
- Defined in:
- lib/bio/db/kegg/glycan.rb
Constant Summary collapse
- DELIMITER =
RS = "\n///\n"
- TAGSIZE =
12
Instance Method Summary collapse
-
#comment ⇒ Object
COMMENT.
-
#composition ⇒ Object
COMPOSITION.
-
#compounds ⇒ Object
COMPOUND.
-
#dblinks ⇒ Object
DBLINKS.
-
#entry_id ⇒ Object
ENTRY.
-
#enzymes ⇒ Object
ENZYME.
-
#initialize(entry) ⇒ GLYCAN
constructor
A new instance of GLYCAN.
-
#kcf ⇒ Object
ATOM, BOND.
-
#keggclass ⇒ Object
CLASS.
-
#mass ⇒ Object
MASS.
-
#name ⇒ Object
NAME.
-
#orthologs ⇒ Object
ORTHOLOGY.
-
#pathways ⇒ Object
PATHWAY.
-
#reactions ⇒ Object
REACTION.
-
#references ⇒ Object
REFERENCE.
-
#remark ⇒ Object
REMARK.
Methods inherited from DB
#exists?, #fetch, #get, open, #tags
Constructor Details
Instance Method Details
#comment ⇒ Object
COMMENT
106 107 108 |
# File 'lib/bio/db/kegg/glycan.rb', line 106 def comment field_fetch('COMMENT') end |
#composition ⇒ Object
COMPOSITION
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/bio/db/kegg/glycan.rb', line 35 def composition unless @data['COMPOSITION'] hash = Hash.new(0) fetch('COMPOSITION').scan(/\((\S+)\)(\d+)/).each do |key, val| hash[key] = val.to_i end @data['COMPOSITION'] = hash end @data['COMPOSITION'] end |
#compounds ⇒ Object
COMPOUND
64 65 66 67 68 69 |
# File 'lib/bio/db/kegg/glycan.rb', line 64 def compounds unless @data['COMPOUND'] @data['COMPOUND'] = fetch('COMPOUND').split(/\s+/) end @data['COMPOUND'] end |
#dblinks ⇒ Object
DBLINKS
133 134 135 136 137 138 |
# File 'lib/bio/db/kegg/glycan.rb', line 133 def dblinks unless @data['DBLINKS'] @data['DBLINKS'] = lines_fetch('DBLINKS') end @data['DBLINKS'] end |
#entry_id ⇒ Object
ENTRY
25 26 27 |
# File 'lib/bio/db/kegg/glycan.rb', line 25 def entry_id field_fetch('ENTRY')[/\S+/] end |
#enzymes ⇒ Object
ENZYME
85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/bio/db/kegg/glycan.rb', line 85 def enzymes unless @data['ENZYME'] field = fetch('ENZYME') if /\(/.match(field) # old version @data['ENZYME'] = field.scan(/\S+ \(\S+\)/) else @data['ENZYME'] = field.scan(/\S+/) end end @data['ENZYME'] end |
#kcf ⇒ Object
ATOM, BOND
141 142 143 |
# File 'lib/bio/db/kegg/glycan.rb', line 141 def kcf return "#{get('NODE')}#{get('EDGE')}" end |
#keggclass ⇒ Object
CLASS
59 60 61 |
# File 'lib/bio/db/kegg/glycan.rb', line 59 def keggclass field_fetch('CLASS') end |
#mass ⇒ Object
MASS
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/bio/db/kegg/glycan.rb', line 47 def mass unless @data['MASS'] hash = Hash.new fetch('MASS').scan(/(\S+)\s+\((\S+)\)/).each do |val, key| hash[key] = val.to_f end @data['MASS'] = hash end @data['MASS'] end |
#name ⇒ Object
NAME
30 31 32 |
# File 'lib/bio/db/kegg/glycan.rb', line 30 def name field_fetch('NAME') end |
#orthologs ⇒ Object
ORTHOLOGY
98 99 100 101 102 103 |
# File 'lib/bio/db/kegg/glycan.rb', line 98 def orthologs unless @data['ORTHOLOGY'] @data['ORTHOLOGY'] = lines_fetch('ORTHOLOGY') end @data['ORTHOLOGY'] end |
#pathways ⇒ Object
PATHWAY
80 81 82 |
# File 'lib/bio/db/kegg/glycan.rb', line 80 def pathways lines_fetch('PATHWAY') end |
#reactions ⇒ Object
REACTION
72 73 74 75 76 77 |
# File 'lib/bio/db/kegg/glycan.rb', line 72 def reactions unless @data['REACTION'] @data['REACTION'] = fetch('REACTION').split(/\s+/) end @data['REACTION'] end |
#references ⇒ Object
REFERENCE
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/bio/db/kegg/glycan.rb', line 116 def references unless @data['REFERENCE'] ary = Array.new lines = lines_fetch('REFERENCE') lines.each do |line| if /^\d+\s+\[PMID/.match(line) ary << line else ary.last << " #{line.strip}" end end @data['REFERENCE'] = ary end @data['REFERENCE'] end |
#remark ⇒ Object
REMARK
111 112 113 |
# File 'lib/bio/db/kegg/glycan.rb', line 111 def remark field_fetch('REMARK') end |