Class: Bix::Blast::QueryHits
- Inherits:
-
Object
- Object
- Bix::Blast::QueryHits
- Defined in:
- lib/bix/blast.rb
Instance Attribute Summary collapse
-
#best_hit ⇒ Object
Returns the value of attribute best_hit.
-
#hits ⇒ Object
Returns the value of attribute hits.
-
#pref_min_aln_len ⇒ Object
Returns the value of attribute pref_min_aln_len.
-
#query ⇒ Object
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(hits, pref_min_aln_len = 0) ⇒ QueryHits
constructor
Suppose we want the best_hit to point to the best e-value of all hits over a certain aln len If there are no hits over that length, then we want the best e-value.
Constructor Details
#initialize(hits, pref_min_aln_len = 0) ⇒ QueryHits
Suppose we want the best_hit to point to the best e-value of all hits over a certain aln len If there are no hits over that length, then we want the best e-value
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/bix/blast.rb', line 45 def initialize(hits, pref_min_aln_len=0) @pref_min_aln_len = pref_min_aln_len @hits = hits raise "QueryHits error: must have > 0 hits" unless hits.size > 0 @query = hits.first.query @best_hit = hits.first for h in hits raise "QueryHits error: not all hits have same query!" if h.query != query if @best_hit.align_len < pref_min_aln_len && h.align_len >= pref_min_aln_len @best_hit = h elsif h.e_value < @best_hit.e_value @best_hit = h end end end |
Instance Attribute Details
#best_hit ⇒ Object
Returns the value of attribute best_hit.
41 42 43 |
# File 'lib/bix/blast.rb', line 41 def best_hit @best_hit end |
#hits ⇒ Object
Returns the value of attribute hits.
41 42 43 |
# File 'lib/bix/blast.rb', line 41 def hits @hits end |
#pref_min_aln_len ⇒ Object
Returns the value of attribute pref_min_aln_len.
41 42 43 |
# File 'lib/bix/blast.rb', line 41 def pref_min_aln_len @pref_min_aln_len end |
#query ⇒ Object
Returns the value of attribute query.
41 42 43 |
# File 'lib/bix/blast.rb', line 41 def query @query end |