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_as_hash ⇒ Object
(also: #dblinks)
Returns a Hash of the DB name and an Array of entry IDs in DBLINKS field.
-
#dblinks_as_strings ⇒ 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_as_hash ⇒ Object
(also: #orthologs)
Returns a Hash of the orthology ID and definition in ORTHOLOGY field.
-
#orthologs_as_strings ⇒ Object
ORTHOLOGY.
-
#pathways_as_hash ⇒ Object
(also: #pathways)
Returns a Hash of the pathway ID and name in PATHWAY field.
-
#pathways_as_strings ⇒ 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
118 119 120 |
# File 'lib/bio/db/kegg/glycan.rb', line 118 def comment field_fetch('COMMENT') end |
#composition ⇒ Object
COMPOSITION
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/bio/db/kegg/glycan.rb', line 51 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
76 77 78 79 80 81 |
# File 'lib/bio/db/kegg/glycan.rb', line 76 def compounds unless @data['COMPOUND'] @data['COMPOUND'] = fetch('COMPOUND').split(/\s+/) end @data['COMPOUND'] end |
#dblinks_as_hash ⇒ Object Also known as: dblinks
Returns a Hash of the DB name and an Array of entry IDs in DBLINKS field.
23 |
# File 'lib/bio/db/kegg/glycan.rb', line 23 def dblinks_as_hash; super; end |
#dblinks_as_strings ⇒ Object
DBLINKS
145 146 147 148 149 150 |
# File 'lib/bio/db/kegg/glycan.rb', line 145 def dblinks_as_strings unless @data['DBLINKS'] @data['DBLINKS'] = lines_fetch('DBLINKS') end @data['DBLINKS'] end |
#entry_id ⇒ Object
ENTRY
41 42 43 |
# File 'lib/bio/db/kegg/glycan.rb', line 41 def entry_id field_fetch('ENTRY')[/\S+/] end |
#enzymes ⇒ Object
ENZYME
97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/bio/db/kegg/glycan.rb', line 97 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
153 154 155 |
# File 'lib/bio/db/kegg/glycan.rb', line 153 def kcf return "#{get('NODE')}#{get('EDGE')}" end |
#keggclass ⇒ Object
CLASS
71 72 73 |
# File 'lib/bio/db/kegg/glycan.rb', line 71 def keggclass field_fetch('CLASS') end |
#mass ⇒ Object
MASS
63 64 65 66 67 68 |
# File 'lib/bio/db/kegg/glycan.rb', line 63 def mass unless @data['MASS'] @data['MASS'] = field_fetch('MASS')[/[\d\.]+/].to_f end @data['MASS'] end |
#name ⇒ Object
NAME
46 47 48 |
# File 'lib/bio/db/kegg/glycan.rb', line 46 def name field_fetch('NAME') end |
#orthologs_as_hash ⇒ Object Also known as: orthologs
Returns a Hash of the orthology ID and definition in ORTHOLOGY field.
33 |
# File 'lib/bio/db/kegg/glycan.rb', line 33 def orthologs_as_hash; super; end |
#orthologs_as_strings ⇒ Object
ORTHOLOGY
110 111 112 113 114 115 |
# File 'lib/bio/db/kegg/glycan.rb', line 110 def orthologs_as_strings unless @data['ORTHOLOGY'] @data['ORTHOLOGY'] = lines_fetch('ORTHOLOGY') end @data['ORTHOLOGY'] end |
#pathways_as_hash ⇒ Object Also known as: pathways
Returns a Hash of the pathway ID and name in PATHWAY field.
28 |
# File 'lib/bio/db/kegg/glycan.rb', line 28 def pathways_as_hash; super; end |
#pathways_as_strings ⇒ Object
PATHWAY
92 93 94 |
# File 'lib/bio/db/kegg/glycan.rb', line 92 def pathways_as_strings lines_fetch('PATHWAY') end |
#reactions ⇒ Object
REACTION
84 85 86 87 88 89 |
# File 'lib/bio/db/kegg/glycan.rb', line 84 def reactions unless @data['REACTION'] @data['REACTION'] = fetch('REACTION').split(/\s+/) end @data['REACTION'] end |
#references ⇒ Object
REFERENCE
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/bio/db/kegg/glycan.rb', line 128 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
123 124 125 |
# File 'lib/bio/db/kegg/glycan.rb', line 123 def remark field_fetch('REMARK') end |