Class: Bio::AAindex

Inherits:
KEGGDB show all
Defined in:
lib/bio/db/aaindex.rb

Overview

Super class for AAindex1 and AAindex2

Direct Known Subclasses

AAindex1, AAindex2

Constant Summary collapse

DELIMITER =

Delimiter

"\n//\n"
RS =

Delimiter

DELIMITER
TAGSIZE =

Bio::DB API

2

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DB

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

Constructor Details

#initialize(entry) ⇒ AAindex

Returns a new instance of AAindex.



69
70
71
# File 'lib/bio/db/aaindex.rb', line 69

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

Class Method Details

.auto(str) ⇒ Object

Auto detecter for two AAindex formats. returns a Bio::AAindex1 object or a Bio::AAindex2 object.



57
58
59
60
61
62
63
64
65
66
# File 'lib/bio/db/aaindex.rb', line 57

def self.auto(str)
  case str
  when /^I /m 
    Bio::AAindex1.new(str)
  when /^M /m
    Bio::AAindex2.new(str)
  else
    raise
  end        
end

Instance Method Details

#authorObject

Returns authors in the A line.



102
103
104
105
106
107
108
# File 'lib/bio/db/aaindex.rb', line 102

def author
  if @data['author']
    @data['author']
  else
    @data['author'] = field_fetch('A')
  end
end

#commentObject

Returns comment (if any).



129
130
131
132
133
134
135
# File 'lib/bio/db/aaindex.rb', line 129

def comment
  if @data['comment']
    @data['comment']
  else
    @data['comment'] = field_fetch('*')
  end
end

Returns database links in the R line. cf.) [‘LIT:123456’, ‘PMID:12345678’]



93
94
95
96
97
98
99
# File 'lib/bio/db/aaindex.rb', line 93

def dblinks
  if @data['ref']
    @data['ref']
  else
    @data['ref'] = field_fetch('R').split(' ')
  end
end

#definitionObject

Returns definition in the D line.



83
84
85
86
87
88
89
# File 'lib/bio/db/aaindex.rb', line 83

def definition
  if @data['definition']
    @data['definition']
  else
    @data['definition'] = field_fetch('D')
  end
end

#entry_idObject

Returns entry_id in the H line.



74
75
76
77
78
79
80
# File 'lib/bio/db/aaindex.rb', line 74

def entry_id
  if @data['entry_id']
    @data['entry_id']
  else
    @data['entry_id'] = field_fetch('H')
  end
end

#journalObject

Returns journal name in the J line.



120
121
122
123
124
125
126
# File 'lib/bio/db/aaindex.rb', line 120

def journal
  if @data['journal']
    @data['journal']
  else
    @data['journal'] = field_fetch('J')
  end
end

#titleObject

Returns title in the T line.



111
112
113
114
115
116
117
# File 'lib/bio/db/aaindex.rb', line 111

def title
  if @data['title']
    @data['title']
  else
    @data['title'] = field_fetch('T')
  end
end