Class: Bio::Blast::RPSBlast::Report::Iteration
- Inherits:
-
Default::Report::Iteration
- Object
- Default::Report::Iteration
- Bio::Blast::RPSBlast::Report::Iteration
- 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
-
#query_def ⇒ Object
readonly
definition of the query.
-
#query_len ⇒ Object
readonly
length of the query sequence.
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
-
#initialize(data, dummystr) ⇒ Iteration
constructor
Creates a new Iteration object.
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.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/bio/appl/blast/rpsblast.rb', line 143 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_def ⇒ Object (readonly)
definition of the query
163 164 165 |
# File 'lib/bio/appl/blast/rpsblast.rb', line 163 def query_def @query_def end |
#query_len ⇒ Object (readonly)
length of the query sequence
166 167 168 |
# File 'lib/bio/appl/blast/rpsblast.rb', line 166 def query_len @query_len end |