Class | Bio::HMMER::Report::Hit
In: | lib/bio/appl/hmmer/report.rb
Parent: | Object

Container class for HMMER search hits.

### Methods

append_hsp each each_hsp new target_def

### External Aliases

accession | -> | target_id
accession | -> | hit_id
accession | -> | entry_id
description | -> | definition
score | -> | bit_score

### Attributes

accession | [R] |
description | [R] |
evalue | [R] | E-value
hsps | [R] | An Array of Bio::HMMER::Report::Hsp objects.
num | [R] | Number of domains
score | [R] | Matching scores (total of all HSPs).

### Public Class methods

new(hit_data)

Sets hit data.

[Source]

         # File lib/bio/appl/hmmer/report.rb, line 391
    391:       def initialize(hit_data)
    392:         @hsps = Array.new
    393:         if /^(\S+)\s+(.*?)\s+(\S+)\s+(\S+)\s+(\S+)$/ =~ hit_data
    394:           @accession, @description, @score, @evalue, @num = \
    395:           [$1, $2, $3.to_f, $4.to_f, $5.to_i]
    396:         end
    397:       end

### Public Instance methods

append_hsp(hsp)

Appends a Bio::HMMER::Report::Hsp object.

[Source]

         # File lib/bio/appl/hmmer/report.rb, line 419
    419:       def append_hsp(hsp)
    420:         @hsps << hsp
    421:       end

each() {|hsp| ...}

Iterates on each Hsp object (Bio::HMMER::Report::Hsp).

[Source]

         # File lib/bio/appl/hmmer/report.rb, line 401
    401:       def each
    402:         @hsps.each do |hsp|
    403:           yield hsp
    404:         end
    405:       end

each_hsp()

Alias for each

target_def()

Shows the hit description.

[Source]

         # File lib/bio/appl/hmmer/report.rb, line 410
    410:       def target_def
    411:         if @hsps.size == 1
    412:           "<#{@hsps[0].domain}> #{@description}"
    413:         else
    414:           "<#{@num.to_s}> #{@description}"
    415:         end
    416:       end

[Validate]