Container class for HMMER search hsps.
Sets hsps.
# File lib/bio/appl/hmmer/report.rb, line 483 def initialize(hsp_data, is_hmmsearch) @is_hmmsearch = is_hmmsearch @accession, @domain, seq_f, seq_t, @seq_ft, hmm_f, hmm_t, @hmm_ft, score, evalue = hsp_data.split(' ') @seq_f = seq_f.to_i @seq_t = seq_t.to_i @hmm_f = hmm_f.to_i @hmm_t = hmm_t.to_i @score = score.to_f @evalue = evalue.to_f @hmmseq = '' @flatseq = '' @midline = '' @query_frame = 1 @target_frame = 1 # CS and RF lines are rarely used. @csline = nil @rfline = nil end
# File lib/bio/appl/hmmer/report.rb, line 550 def query_from @is_hmmsearch ? @hmm_f : @seq_f end
# File lib/bio/appl/hmmer/report.rb, line 530 def query_seq @is_hmmsearch ? @hmmseq : @flatseq end
# File lib/bio/appl/hmmer/report.rb, line 555 def query_to @is_hmmsearch ? @hmm_t : @seq_t end
# File lib/bio/appl/hmmer/report.rb, line 505 def set_alignment(alignment) # First, split the input alignment into an array of # "alignment blocks." One block usually has three lines, # i.e. hmmseq, midline and flatseq. # However, although infrequent, it can contain CS or RF lines. alignment.split(/ (?:\d+|-)\s*\n\n/).each do |blk| lines = blk.split(/\n/) cstmp = (lines[0] =~ /^ {16}CS/) ? lines.shift : nil rftmp = (lines[0] =~ /^ {16}RF/) ? lines.shift : nil aln_width = lines[0][/\S+/].length @csline = @csline.to_s + cstmp[19, aln_width] if cstmp @rfline = @rfline.to_s + rftmp[19, aln_width] if rftmp @hmmseq += lines[0][19, aln_width] @midline += lines[1][19, aln_width] @flatseq += lines[2][19, aln_width] end @csline = @csline[3...-3] if @csline @rfline = @rfline[3...-3] if @rfline @hmmseq = @hmmseq[3...-3] @midline = @midline[3...-3] @flatseq = @flatseq[3...-3] end
# File lib/bio/appl/hmmer/report.rb, line 540 def target_from @is_hmmsearch ? @seq_f : @hmm_f end
Generated with the Darkfish Rdoc Generator 2.