Class: Bio::KEGG::GLYCAN

Inherits:
Bio::KEGGDB show all
Defined in:
lib/bio/db/kegg/glycan.rb

Constant Summary collapse

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

Instance Method Summary collapse

Methods inherited from DB

#exists?, #fetch, #get, open, #tags

Constructor Details

#initialize(entry) ⇒ GLYCAN

Returns a new instance of GLYCAN.



20
21
22
# File 'lib/bio/db/kegg/glycan.rb', line 20

def initialize(entry)
  super(entry, TAGSIZE)
end

Instance Method Details

#commentObject

COMMENT



106
107
108
# File 'lib/bio/db/kegg/glycan.rb', line 106

def comment
  field_fetch('COMMENT')
end

#compositionObject

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

#compoundsObject

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



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_idObject

ENTRY



25
26
27
# File 'lib/bio/db/kegg/glycan.rb', line 25

def entry_id
  field_fetch('ENTRY')[/\S+/]
end

#enzymesObject

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

#kcfObject

ATOM, BOND



141
142
143
# File 'lib/bio/db/kegg/glycan.rb', line 141

def kcf
  return "#{get('NODE')}#{get('EDGE')}"
end

#keggclassObject

CLASS



59
60
61
# File 'lib/bio/db/kegg/glycan.rb', line 59

def keggclass
  field_fetch('CLASS') 
end

#massObject

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

#nameObject

NAME



30
31
32
# File 'lib/bio/db/kegg/glycan.rb', line 30

def name
  field_fetch('NAME') 
end

#orthologsObject

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

#pathwaysObject

PATHWAY



80
81
82
# File 'lib/bio/db/kegg/glycan.rb', line 80

def pathways
  lines_fetch('PATHWAY') 
end

#reactionsObject

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

#referencesObject

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

#remarkObject

REMARK



111
112
113
# File 'lib/bio/db/kegg/glycan.rb', line 111

def remark
  field_fetch('REMARK')
end