Class Bio::ClustalW::Report
In: lib/bio/appl/clustalw/report.rb
Parent: Bio::DB

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

Methods

align   alignment   get_sequence   header   match_line   new   to_a   to_fasta  

Constants

DELIMITER = nil   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

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

[Source]

    # File lib/bio/appl/clustalw/report.rb, line 45
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

This will be deprecated. Instead, please use alignment.

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

[Source]

     # File lib/bio/appl/clustalw/report.rb, line 111
111:       def align
112:         warn "Bio::ClustalW#align will be deprecated. Please use \'alignment\'."
113:         alignment
114:       end

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

[Source]

     # File lib/bio/appl/clustalw/report.rb, line 102
102:       def alignment
103:         do_parse() unless @align
104:         @align
105:       end

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

[Source]

    # File lib/bio/appl/clustalw/report.rb, line 83
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

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

[Source]

    # File lib/bio/appl/clustalw/report.rb, line 73
73:       def header
74:         @header or (do_parse or @header)
75:       end

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

[Source]

    # File lib/bio/appl/clustalw/report.rb, line 96
96:       def match_line
97:         @match_line or (do_parse or @match_line)
98:       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 objects.

[Source]

     # File lib/bio/appl/clustalw/report.rb, line 130
130:       def to_a
131:         alignment.to_fastaformat_array
132:       end

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

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

[Source]

     # File lib/bio/appl/clustalw/report.rb, line 120
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

[Validate]