Class: Bio::KEGG::GLYCAN

Inherits:
Bio::KEGGDB show all
Includes:
Common::DblinksAsHash, Common::OrthologsAsHash, Common::PathwaysAsHash
Defined in:
lib/bio/db/kegg/glycan.rb

Constant Summary

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

Instance Method Summary (collapse)

Methods inherited from DB

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

Constructor Details

- (GLYCAN) initialize(entry)

Returns a new instance of GLYCAN



36
37
38
# File 'lib/bio/db/kegg/glycan.rb', line 36

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

Instance Method Details

- (Object) comment

COMMENT



118
119
120
# File 'lib/bio/db/kegg/glycan.rb', line 118

def comment
  field_fetch('COMMENT')
end

- (Object) composition

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

- (Object) compounds

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


23
# File 'lib/bio/db/kegg/glycan.rb', line 23

def dblinks_as_hash; super; end

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

- (Object) entry_id

ENTRY



41
42
43
# File 'lib/bio/db/kegg/glycan.rb', line 41

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

- (Object) enzymes

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

- (Object) kcf

ATOM, BOND



153
154
155
# File 'lib/bio/db/kegg/glycan.rb', line 153

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

- (Object) keggclass

CLASS



71
72
73
# File 'lib/bio/db/kegg/glycan.rb', line 71

def keggclass
  field_fetch('CLASS') 
end

- (Object) mass

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

- (Object) name

NAME



46
47
48
# File 'lib/bio/db/kegg/glycan.rb', line 46

def name
  field_fetch('NAME') 
end

- (Object) orthologs_as_hash Also known as: orthologs



33
# File 'lib/bio/db/kegg/glycan.rb', line 33

def orthologs_as_hash; super; end

- (Object) orthologs_as_strings

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

- (Object) pathways_as_hash Also known as: pathways



28
# File 'lib/bio/db/kegg/glycan.rb', line 28

def pathways_as_hash; super; end

- (Object) pathways_as_strings

PATHWAY



92
93
94
# File 'lib/bio/db/kegg/glycan.rb', line 92

def pathways_as_strings
  lines_fetch('PATHWAY') 
end

- (Object) reactions

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

- (Object) references

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

- (Object) remark

REMARK



123
124
125
# File 'lib/bio/db/kegg/glycan.rb', line 123

def remark
  field_fetch('REMARK')
end