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
102 103 104 |
# File 'lib/bio/db/kegg/glycan.rb', line 102 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
60 61 62 63 64 65 |
# File 'lib/bio/db/kegg/glycan.rb', line 60 def compounds unless @data['COMPOUND'] @data['COMPOUND'] = fetch('COMPOUND').split(/\s+/) end @data['COMPOUND'] end |
#dblinks ⇒ Object
DBLINKS
129 130 131 132 133 134 |
# File 'lib/bio/db/kegg/glycan.rb', line 129 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
81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/bio/db/kegg/glycan.rb', line 81 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
137 138 139 |
# File 'lib/bio/db/kegg/glycan.rb', line 137 def kcf return "#{get('NODE')}#{get('EDGE')}" end |
#keggclass ⇒ Object
CLASS
55 56 57 |
# File 'lib/bio/db/kegg/glycan.rb', line 55 def keggclass field_fetch('CLASS') end |
#mass ⇒ Object
MASS
47 48 49 50 51 52 |
# File 'lib/bio/db/kegg/glycan.rb', line 47 def mass unless @data['MASS'] @data['MASS'] = field_fetch('MASS')[/[\d\.]+/].to_f 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
94 95 96 97 98 99 |
# File 'lib/bio/db/kegg/glycan.rb', line 94 def orthologs unless @data['ORTHOLOGY'] @data['ORTHOLOGY'] = lines_fetch('ORTHOLOGY') end @data['ORTHOLOGY'] end |
#pathways ⇒ Object
PATHWAY
76 77 78 |
# File 'lib/bio/db/kegg/glycan.rb', line 76 def pathways lines_fetch('PATHWAY') end |
#reactions ⇒ Object
REACTION
68 69 70 71 72 73 |
# File 'lib/bio/db/kegg/glycan.rb', line 68 def reactions unless @data['REACTION'] @data['REACTION'] = fetch('REACTION').split(/\s+/) end @data['REACTION'] end |
#references ⇒ Object
REFERENCE
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/bio/db/kegg/glycan.rb', line 112 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
107 108 109 |
# File 'lib/bio/db/kegg/glycan.rb', line 107 def remark field_fetch('REMARK') end |