Class: Bio::AAindex
Overview
Super class for AAindex1 and AAindex2
Constant Summary collapse
- DELIMITER =
Delimiter
"\n//\n"
- RS =
Delimiter
DELIMITER
- TAGSIZE =
Bio::DB API
2
Class Method Summary collapse
-
.auto(str) ⇒ Object
Auto detecter for two AAindex formats.
Instance Method Summary collapse
-
#author ⇒ Object
Returns authors in the A line.
-
#comment ⇒ Object
Returns comment (if any).
-
#dblinks ⇒ Object
Returns database links in the R line.
-
#definition ⇒ Object
Returns definition in the D line.
-
#entry_id ⇒ Object
Returns entry_id in the H line.
-
#initialize(entry) ⇒ AAindex
constructor
A new instance of AAindex.
-
#journal ⇒ Object
Returns journal name in the J line.
-
#title ⇒ Object
Returns title in the T line.
Methods inherited from DB
#exists?, #fetch, #get, open, #tags
Constructor Details
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
#author ⇒ Object
Returns authors in the A line.
102 103 104 105 106 107 108 |
# File 'lib/bio/db/aaindex.rb', line 102 def if @data['author'] @data['author'] else @data['author'] = field_fetch('A') end end |
#comment ⇒ Object
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 |
#dblinks ⇒ Object
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 |
#definition ⇒ Object
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_id ⇒ Object
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 |
#journal ⇒ Object
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 |
#title ⇒ Object
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 |