Class Bio::Alignment::MultiFastaFormat
In: lib/bio/appl/mafft/report.rb  (CVS)
Parent: Object

Data class for fasta-formatted multiple sequence alignment data, which is simply multiple entiries of fasta formatted sequences.

Methods

alignment   entries   new  

Constants

DELIMITER = RS = nil   delimiter for flatfile

Public Class methods

Creates a new data object. str should be a (multi-)fasta formatted string.

[Source]

# File lib/bio/appl/mafft/report.rb, line 46
      def initialize(str)
        ff = Bio::FlatFile.new(Bio::FastaFormat, StringIO.new(str))
        @data = ff.to_a
        @alignment = nil
        @seq_method = nil
      end

Public Instance methods

Gets an multiple alignment. Returns a Bio::Alignment object. method should be one of :naseq, :aaseq, :seq, or nil (default). nil means to automatically determine nucleotide or amino acid.

This method returns previously parsed object if the same method is given (or guessed method is the same).

[Source]

# File lib/bio/appl/mafft/report.rb, line 60
      def alignment(method = nil)
        m = determine_seq_method(@data, method)
        if !@alignment or m != @seq_method then
          @seq_method = m
          @alignment = do_parse(@data, @seq_method)
        end
        @alignment
      end

Gets an array of the fasta formatted sequence objects. Returns an array of Bio::FastaFormat objects.

[Source]

# File lib/bio/appl/mafft/report.rb, line 71
      def entries
        @data
      end

[Validate]