class Bio::Tcoffee::DEFAULT_PARSER

CLUSTAL W result data (*.aln file) parser class.

Constants

DELIMITER

Delimiter of each entry. Bio::FlatFile uses it. In Bio::ClustalW::Report, it it nil (1 entry 1 file).

Attributes

raw[R]

string of whole result

seqclass[R]

sequence class (one of Bio::Sequence, Bio::Sequence::NA, Bio::Sequence::AA, …)

Public Class Methods

new(str, seqclass = nil) click to toggle source

Creates new instance. str should be a CLUSTAL format string. seqclass should on of following:

   # File lib/bio/appl/clustalw/report.rb
45 def initialize(str, seqclass = nil)
46   @raw = str
47   @align = nil
48   @match_line = nil
49   @header = nil
50   case seqclass
51   when /PROTEIN/i
52     @seqclass = Bio::Sequence::AA
53   when /[DR]NA/i
54     @seqclass = Bio::Sequence::NA
55   else
56     if seqclass.is_a?(Module) then
57       @seqclass = seqclass
58     else
59       @seqclass = Bio::Sequence
60     end
61   end
62 end

Public Instance Methods

align() click to toggle source

This will be deprecated. Instead, please use alignment.

Gets an multiple alignment. Returns a Bio::Alignment object.

    # File lib/bio/appl/clustalw/report.rb
111 def align
112   warn "Bio::ClustalW#align will be deprecated. Please use \'alignment\'."
113   alignment
114 end
alignment() click to toggle source

Gets an multiple alignment. Returns a Bio::Alignment object.

    # File lib/bio/appl/clustalw/report.rb
102 def alignment
103   do_parse() unless @align
104   @align
105 end
get_sequence(row) click to toggle source

Returns the Bio::Sequence in the matrix at row ‘row’ as Bio::Sequence object. When row is out of range a nil is returned.


Arguments:

  • (required) row: Integer

Returns

Bio::Sequence

   # File lib/bio/appl/clustalw/report.rb
83 def get_sequence(row)
84   a = alignment
85   return nil if row < 0 or row >= a.keys.size
86   id  = a.keys[row]
87   seq = a.to_hash[id]
88   s = Bio::Sequence.new(seq.seq)
89   s.definition = id
90   s
91 end
header() click to toggle source

Shows first line of the result data, for example, ‘CLUSTAL W (1.82) multiple sequence alignment’. Returns a string.

   # File lib/bio/appl/clustalw/report.rb
73 def header
74   @header or (do_parse or @header)
75 end
match_line() click to toggle source

Shows “match line” of CLUSTAL’s alignment result, for example, ‘:* :* .* * .::. ** :* . * . ’. Returns a string.

   # File lib/bio/appl/clustalw/report.rb
96 def match_line
97   @match_line or (do_parse or @match_line)
98 end
to_a() click to toggle source

Compatibility note: Behavior of the method will be changed in the future.

Gets an array of the sequences. Returns an array of Bio::FastaFormat objects.

    # File lib/bio/appl/clustalw/report.rb
130 def to_a
131   alignment.to_fastaformat_array
132 end
to_fasta(*arg) click to toggle source

This will be deprecated. Instead, please use alignment.output_fasta.

Gets an fasta-format string of the sequences. Returns a string.

    # File lib/bio/appl/clustalw/report.rb
120 def to_fasta(*arg)
121   warn "Bio::ClustalW::report#to_fasta is deprecated. Please use \'alignment.output_fasta\'"
122   alignment.output_fasta(*arg)
123 end