Class | Bio::ClustalW::Report |
In: |
lib/bio/appl/clustalw/report.rb
|
Parent: | Bio::DB |
CLUSTAL W result data (*.aln file) parser class.
DELIMITER | = | nil | Delimiter of each entry. Bio::FlatFile uses it. In Bio::ClustalW::Report, it it nil (1 entry 1 file). |
raw | [R] | string of whole result |
seqclass | [R] | sequence class (one of Bio::Sequence, Bio::Sequence::NA, Bio::Sequence::AA, …) |
Creates new instance. str should be a CLUSTAL format string. seqclass should on of following:
# 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
This will be deprecated. Instead, please use alignment.
Gets an multiple alignment. Returns a Bio::Alignment object.
# 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.
# 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:
Returns: | Bio::Sequence |
# 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
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, 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.
# 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