class Bio::Probcons::DEFAULT_PARSER
Data class for fasta-formatted multiple sequence alignment data, which is simply multiple entiries of fasta formatted sequences.
Constants
- DELIMITER
delimiter for flatfile
Public Class Methods
new(str)
click to toggle source
Creates a new data object. str
should be a (multi-)fasta formatted string.
# File lib/bio/appl/mafft/report.rb 46 def initialize(str) 47 ff = Bio::FlatFile.new(Bio::FastaFormat, StringIO.new(str)) 48 @data = ff.to_a 49 @alignment = nil 50 @seq_method = nil 51 end
Public Instance Methods
alignment(method = nil)
click to toggle source
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).
# File lib/bio/appl/mafft/report.rb 60 def alignment(method = nil) 61 m = determine_seq_method(@data, method) 62 if !@alignment or m != @seq_method then 63 @seq_method = m 64 @alignment = do_parse(@data, @seq_method) 65 end 66 @alignment 67 end
entries()
click to toggle source
Gets an array of the fasta formatted sequence objects. Returns an array of Bio::FastaFormat
objects.
# File lib/bio/appl/mafft/report.rb 71 def entries 72 @data 73 end