class Bio::MAFFT::Report
MAFFT result parser class. MAFFT is a very fast multiple sequence alignment software.
Since a result of MAFFT is simply a multiple-fasta format, the significance of this class is to keep standard form and interface between Bio::ClustalW::Report.
Attributes
sequence data. Returns an array of Bio::FastaFormat.
Sequence class (Bio::Sequence::AA, Bio::Sequence::NA, …)
Compatibility note: This method will be removed in the tufure.
Public Class Methods
Creates a new Report object. str
should be multi-fasta formatted text as a string.
Compatibility Note: the old usage (to get array of Bio::FastaFormat objects) is deprecated.
Compatibility Note 2: the argument seqclass
is deprecated.
seqclass
should be one of following: Class: Bio::Sequence::AA, Bio::Sequence::NA, … String:
'PROTEIN', 'DNA', …
# File lib/bio/appl/mafft/report.rb, line 142 def initialize(str, seqclass = nil) if str.is_a?(Array) then warn "Array of Bio::FastaFormat objects will be no longer accepted." @data = str else super(str) end if seqclass then warn "the 2nd argument (seqclass) will be no deprecated." case seqclass when /PROTEIN/i @seqclass = Bio::Sequence::AA when /[DR]NA/i @seqclass = Bio::Sequence::NA else if seqclass.is_a?(Module) then @seqclass = seqclass else @seqclass = nil end end end end
Public Instance Methods
This method will be deprecated. Instead, please use alignment.
Gets an multiple alignment. Returns a Bio::Alignment object.
# File lib/bio/appl/mafft/report.rb, line 185 def align warn "Bio::MAFFT::Report#align is deprecated. Please use \'alignment\'." alignment end
Gets an multiple alignment. Returns a Bio::Alignment object.
# File lib/bio/appl/mafft/report.rb, line 177 def alignment(method = nil) super end
Compatibility note: Behavior of the method will be changed in the future.
Gets an array of the sequences. Returns an array of Bio::FastaFormat instances.
# File lib/bio/appl/mafft/report.rb, line 206 def to_a @data end
This will be deprecated. Instead, please use alignment.output_fasta.
Gets an fasta-format string of the sequences. Returns a string. Same as align.to_fasta. Please refer to Bio::Alignment#output_fasta for arguments.
# File lib/bio/appl/mafft/report.rb, line 196 def to_fasta(*arg) warn "Bio::MAFFT::report#to_fasta is deprecated. Please use \'alignment.output_fasta\'" alignment.output_fasta(*arg) end
Private Instance Methods
Parsing a result.
# File lib/bio/appl/mafft/report.rb, line 212 def do_parse(ary, seqmethod) if @seqclass then a = Bio::Alignment.new a.add_sequences(ary) do |x| [ @seqclass.new(x.seq), x.definition ] end else super(ary, seqmethod) end end