Class Bio::KEGG::GLYCAN
In: lib/bio/db/kegg/glycan.rb
Parent: KEGGDB

Methods

comment   composition   compounds   dblinks   entry_id   enzymes   kcf   keggclass   mass   name   new   orthologs   pathways   reactions   references   remark  

Constants

DELIMITER = RS = "\n///\n"
TAGSIZE = 12

Public Class methods

[Source]

    # File lib/bio/db/kegg/glycan.rb, line 20
20:   def initialize(entry)
21:     super(entry, TAGSIZE)
22:   end

Public Instance methods

COMMENT

[Source]

     # File lib/bio/db/kegg/glycan.rb, line 102
102:   def comment
103:     field_fetch('COMMENT')
104:   end

COMPOSITION

[Source]

    # 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

COMPOUND

[Source]

    # File lib/bio/db/kegg/glycan.rb, line 60
60:   def compounds
61:     unless @data['COMPOUND']
62:       @data['COMPOUND'] = fetch('COMPOUND').split(/\s+/)
63:     end
64:     @data['COMPOUND']
65:   end

DBLINKS

[Source]

     # 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

[Source]

    # File lib/bio/db/kegg/glycan.rb, line 25
25:   def entry_id
26:     field_fetch('ENTRY')[/\S+/]
27:   end

ENZYME

[Source]

    # 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

[Source]

     # File lib/bio/db/kegg/glycan.rb, line 137
137:   def kcf
138:     return "#{get('NODE')}#{get('EDGE')}"
139:   end

CLASS

[Source]

    # File lib/bio/db/kegg/glycan.rb, line 55
55:   def keggclass
56:     field_fetch('CLASS') 
57:   end

MASS

[Source]

    # 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

NAME

[Source]

    # File lib/bio/db/kegg/glycan.rb, line 30
30:   def name
31:     field_fetch('NAME') 
32:   end

ORTHOLOGY

[Source]

    # File lib/bio/db/kegg/glycan.rb, line 94
94:   def orthologs
95:     unless @data['ORTHOLOGY']
96:       @data['ORTHOLOGY'] = lines_fetch('ORTHOLOGY')
97:     end
98:     @data['ORTHOLOGY']
99:   end

PATHWAY

[Source]

    # File lib/bio/db/kegg/glycan.rb, line 76
76:   def pathways
77:     lines_fetch('PATHWAY') 
78:   end

REACTION

[Source]

    # File lib/bio/db/kegg/glycan.rb, line 68
68:   def reactions
69:     unless @data['REACTION']
70:       @data['REACTION'] = fetch('REACTION').split(/\s+/)
71:     end
72:     @data['REACTION']
73:   end

REFERENCE

[Source]

     # 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

REMARK

[Source]

     # File lib/bio/db/kegg/glycan.rb, line 107
107:   def remark
108:     field_fetch('REMARK')
109:   end

[Validate]