class Bio::Blast::Default::Report::Hit

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

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) click to toggle source

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.

    # File lib/bio/appl/blast/format0.rb
803 def initialize(data)
804   @f0hitname = data.shift
805   @hsps = []
806   while r = data[0] and /\A\s+Score/ =~ r
807     @hsps << HSP.new(data)
808   end
809   @again = false
810 end

Public Instance Methods

bit_score() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
836 def bit_score
837   unless defined?(@bit_score)
838     if h = @hsps.first then
839       @bit_score = h.bit_score
840     end
841   end
842   @bit_score
843 end
definition() click to toggle source

Returns definition of the hit.

    # File lib/bio/appl/blast/format0.rb
878 def definition; parse_hitname; @definition; end
Also aliased as: target_def
each() { |x| ... } click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
818 def each
819   @hsps.each { |x| yield x }
820 end
evalue() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
847 def evalue
848   unless defined?(@evalue)
849     if h = @hsps.first then
850       @evalue = h.evalue
851     end
852   end
853   @evalue
854 end
found_again?() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
825 def found_again?
826   @again
827 end
identity() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
903 def identity;      hsp_first :identity;     end
lap_at() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
948 def lap_at
949   [ query_start, query_end, target_start, target_end ]
950 end
len() click to toggle source

Returns length of the hit.

    # File lib/bio/appl/blast/format0.rb
875 def len;        parse_hitname; @len;        end
Also aliased as: target_len
midline() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
923 def midline;       hsp_first :midline;      end
overlap() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
908 def overlap;       hsp_first :align_len;    end
query_end() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
933 def query_end;     hsp_first :query_to;     end
query_seq() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
913 def query_seq;     hsp_first :qseq;         end
query_start() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
928 def query_start;   hsp_first :query_from;   end
score() click to toggle source

Returns first hsp's score.

    # File lib/bio/appl/blast/format0.rb
830 def score
831   (h = @hsps.first) ? h.score : nil
832 end
target_def()
Alias for: definition
target_end() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
943 def target_end;    hsp_first :hit_to;       end
target_id() click to toggle source
    # File lib/bio/appl/blast/format0.rb
880 def target_id; definition[/^\s*(\S+)/, 1]; end
target_len()
Alias for: len
target_seq() click to toggle source

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

    # File lib/bio/appl/blast/format0.rb
918 def target_seq;    hsp_first :hseq;         end
target_start() click to toggle source

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

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