Class | Bio::Blast::Default::Report::Hit
In: | lib/bio/appl/blast/format0.rb
Parent: | Object

Bio::Blast::Default::Report::Hit contains information about a hit. It may contain some Bio::Blast::Default::Report::HSP objects.

### Methods

bit_score definition each evalue found_again? identity lap_at len midline new overlap query_end query_seq query_start score target_def target_end target_id target_len target_seq target_start

### Attributes

hsps | [R] | Hsp(high-scoring segment pair)s of the hit. Returns an array of Bio::Blast::Default::Report::HSP objects.

### Public Class methods

new(data)

Creates a new Hit object. It is designed to be called only internally from the Bio::Blast::Default::Report::Iteration class. Users should not call the method directly.

[Source]

         # File lib/bio/appl/blast/format0.rb, line 810
    810:           def initialize(data)
    811:             @f0hitname = data.shift
    812:             @hsps = []
    813:             while r = data[0] and /\A\s+Score/ =~ r
    814:               @hsps << HSP.new(data)
    815:             end
    816:             @again = false
    817:           end

### Public Instance methods

bit_score()

Returns first hsp‘s bit score. (shown in hit list of BLAST result)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 843
    843:           def bit_score
    844:             unless defined?(@bit_score)
    845:               if h = @hsps.first then
    846:                 @bit_score = h.bit_score
    847:               end
    848:             end
    849:             @bit_score
    850:           end

definition()

Returns definition of the hit.

[Source]

         # File lib/bio/appl/blast/format0.rb, line 885
    885:           def definition; parse_hitname; @definition; end

each() {|x| ...}

Iterates over each hsp(high-scoring segment pair) of the hit. Yields a Bio::Blast::Default::Report::HSP object.

[Source]

         # File lib/bio/appl/blast/format0.rb, line 825
    825:           def each
    826:             @hsps.each { |x| yield x }
    827:           end

evalue()

Returns first hsp‘s e-value. (shown in hit list of BLAST result)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 854
    854:           def evalue
    855:             unless defined?(@evalue)
    856:               if h = @hsps.first then
    857:                 @evalue = h.evalue
    858:               end
    859:             end
    860:             @evalue
    861:           end

found_again?()

(PSI-BLAST) Returns true if the hit is found again in the iteration. Otherwise, returns false or nil.

[Source]

         # File lib/bio/appl/blast/format0.rb, line 832
    832:           def found_again?
    833:             @again
    834:           end

identity()

Same as hsps.first.identity. Returns nil if there are no hsp in the hit. (Compatibility method with FASTA)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 910
    910:           def identity;      hsp_first :identity;     end

lap_at()

Returns an array which contains [ query_start, query_end, target_start, target_end ]. (Compatibility method with FASTA)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 955
    955:           def lap_at
    956:             [ query_start, query_end, target_start, target_end ]
    957:           end

len()

Returns length of the hit.

[Source]

         # File lib/bio/appl/blast/format0.rb, line 882
    882:           def len;        parse_hitname; @len;        end

midline()

Same as hsps.first.midline. Returns nil if there are no hsp in the hit. (Compatibility method with FASTA)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 930
    930:           def midline;       hsp_first :midline;      end

overlap()

Same as hsps.first.align_len. Returns nil if there are no hsp in the hit. (Compatibility method with FASTA)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 915
    915:           def overlap;       hsp_first :align_len;    end

query_end()

Same as hsps.first.query_to. Returns nil if there are no hsp in the hit. (Compatibility method with FASTA)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 940
    940:           def query_end;     hsp_first :query_to;     end

query_seq()

Same as hsps.first.qseq. Returns nil if there are no hsp in the hit. (Compatibility method with FASTA)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 920
    920:           def query_seq;     hsp_first :qseq;         end

query_start()

Same as hsps.first.query_from. Returns nil if there are no hsp in the hit. (Compatibility method with FASTA)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 935
    935:           def query_start;   hsp_first :query_from;   end

score()

Returns first hsp‘s score.

[Source]

         # File lib/bio/appl/blast/format0.rb, line 837
    837:           def score
    838:             (h = @hsps.first) ? h.score : nil
    839:           end

target_def()

Alias for definition

target_end()

Same as hsps.first.hit_to. Returns nil if there are no hsp in the hit. (Compatibility method with FASTA)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 950
    950:           def target_end;    hsp_first :hit_to;       end

target_id()

[Source]

         # File lib/bio/appl/blast/format0.rb, line 887
    887:           def target_id; definition[/^\s*(\S+)/, 1]; end

target_len()

Alias for len

target_seq()

Same as hsps.first.hseq. Returns nil if there are no hsp in the hit. (Compatibility method with FASTA)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 925
    925:           def target_seq;    hsp_first :hseq;         end

target_start()

Same as hsps.first.hit_from. Returns nil if there are no hsp in the hit. (Compatibility method with FASTA)

[Source]

         # File lib/bio/appl/blast/format0.rb, line 945
    945:           def target_start;  hsp_first :hit_from;     end

[Validate]