class Bio::AAindex

Description

Bio::AAindex is the super class of Bio::AAindex1 and Bio::AAindex2, parser classes for AAindex Amino Acid Index Database.

Except Bio::AAindex.auto, do not use this class directly. Methods of this super class is used from AAindex1 and AAindex2 classes.

Examples

# auto-detection of data format
aax1 = Bio::AAindex.auto("PRAM900102.aaindex1")
aax2 = Bio::AAindex.auto("DAYM780301.aaindex2")

# Example of Bio::AAindex1 class
aax1 = Bio::AAindex1.new("PRAM900102.aaindex1")
aax1.entry_id
aax1.index

# Example of Bio::AAindex2 class
aax2 = Bio::AAindex2.new("DAYM780301.aaindex2")
aax2.entry_id
aax2.matrix
aax2.matrix[2,2]
aax2.matrix('R', 'A')
aax2['R', 'A']

References

Constants

DELIMITER

Delimiter

RS

Delimiter

TAGSIZE

Bio::DB API

Public Class Methods

auto(str) click to toggle source

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

   # File lib/bio/db/aaindex.rb
87 def self.auto(str)
88   case str
89   when /^I /m 
90     Bio::AAindex1.new(str)
91   when /^M /m
92     Bio::AAindex2.new(str)
93   else
94     raise
95   end        
96 end
new(entry) click to toggle source
Calls superclass method Bio::NCBIDB::new
    # File lib/bio/db/aaindex.rb
 99 def initialize(entry)
100   super(entry, TAGSIZE)
101 end

Public Instance Methods

author() click to toggle source

Returns authors in the A line.

    # File lib/bio/db/aaindex.rb
132 def author
133   if @data['author']
134     @data['author']
135   else
136     @data['author'] = field_fetch('A')
137   end
138 end
comment() click to toggle source

Returns comment (if any).

    # File lib/bio/db/aaindex.rb
159 def comment
160   if @data['comment']
161     @data['comment']
162   else
163     @data['comment'] = field_fetch('*')
164   end
165 end
definition() click to toggle source

Returns definition in the D line.

    # File lib/bio/db/aaindex.rb
113 def definition
114   if @data['definition']
115     @data['definition']
116   else
117     @data['definition'] = field_fetch('D')
118   end
119 end
entry_id() click to toggle source

Returns entry_id in the H line.

    # File lib/bio/db/aaindex.rb
104 def entry_id
105   if @data['entry_id']
106     @data['entry_id']
107   else
108     @data['entry_id'] = field_fetch('H')
109   end
110 end
journal() click to toggle source

Returns journal name in the J line.

    # File lib/bio/db/aaindex.rb
150 def journal
151   if @data['journal']
152     @data['journal']
153   else
154     @data['journal'] = field_fetch('J')
155   end
156 end
title() click to toggle source

Returns title in the T line.

    # File lib/bio/db/aaindex.rb
141 def title
142   if @data['title']
143     @data['title']
144   else
145     @data['title'] = field_fetch('T')
146   end
147 end