Class: Bio::Blast::RPSBlast::Report::Iteration

Inherits:
Default::Report::Iteration show all
Defined in:
lib/bio/appl/blast/rpsblast.rb

Overview

Iteration class for RPS-Blast. Though RPS-Blast does not iterate like PSI-BLAST, it aims to store a result of single query sequence.

Normally, the instance of the class is generated by Bio::Blast::RPSBlast::Report object.

Instance Attribute Summary collapse

Attributes inherited from Default::Report::Iteration

#database, #db_len, #db_num, #eff_space, #entropy, #expect, #gapped_entropy, #gapped_kappa, #gapped_lambda, #kappa, #lambda, #message, #num, #pattern_in_database, #posted_date

Instance Method Summary collapse

Methods inherited from Default::Report::Iteration

#converged?, #each, #hits, #hits_for_pattern, #hits_found_again, #hits_newly_found, #pattern, #pattern_positions

Constructor Details

#initialize(data, dummystr) ⇒ Iteration

Creates a new Iteration object. It is designed to be called only internally from the Bio::Blast::RPSBlast::Report class. Users shall not use the method directly.



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/bio/appl/blast/rpsblast.rb', line 245

def initialize(data, dummystr)
  if /\AQuery\=/ =~ data[0] then
    sc = StringScanner.new(data.shift)
    sc.skip(/\s*/)
    if sc.skip_until(/Query\= */) then
      q = []
      begin
        q << sc.scan(/.*/)
        sc.skip(/\s*^ ?/)
      end until !sc.rest or r = sc.skip(/ *\( *([\,\d]+) *letters *\)\s*\z/)
      @query_len = sc[1].delete(',').to_i if r
      @query_def = q.join(' ')
    end
  end
  data.unshift(dummystr)
  
  super(data)
end

Instance Attribute Details

#query_defObject (readonly)

definition of the query



265
266
267
# File 'lib/bio/appl/blast/rpsblast.rb', line 265

def query_def
  @query_def
end

#query_lenObject (readonly)

length of the query sequence



268
269
270
# File 'lib/bio/appl/blast/rpsblast.rb', line 268

def query_len
  @query_len
end