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

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

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 792
792:           def initialize(data)
793:             @f0hitname = data.shift
794:             @hsps = []
795:             while r = data[0] and /\A\s+Score/ =~ r
796:               @hsps << HSP.new(data)
797:             end
798:             @again = false
799:           end

Public Instance methods

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

[Source]

     # File lib/bio/appl/blast/format0.rb, line 825
825:           def bit_score
826:             unless defined?(@bit_score)
827:               if h = @hsps.first then
828:                 @bit_score = h.bit_score
829:               end
830:             end
831:             @bit_score
832:           end

Returns definition of the hit.

[Source]

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

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 807
807:           def each
808:             @hsps.each { |x| yield x }
809:           end

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

[Source]

     # File lib/bio/appl/blast/format0.rb, line 836
836:           def evalue
837:             unless defined?(@evalue)
838:               if h = @hsps.first then
839:                 @evalue = h.evalue
840:               end
841:             end
842:             @evalue
843:           end

(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 814
814:           def found_again?
815:             @again
816:           end

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 892
892:           def identity;      hsp_first :identity;     end

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 937
937:           def lap_at
938:             [ query_start, query_end, target_start, target_end ]
939:           end

Returns length of the hit.

[Source]

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

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 912
912:           def midline;       hsp_first :midline;      end

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 897
897:           def overlap;       hsp_first :align_len;    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 922
922:           def query_end;     hsp_first :query_to;     end

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 902
902:           def query_seq;     hsp_first :qseq;         end

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 917
917:           def query_start;   hsp_first :query_from;   end

Returns first hsp‘s score.

[Source]

     # File lib/bio/appl/blast/format0.rb, line 819
819:           def score
820:             (h = @hsps.first) ? h.score : nil
821:           end
target_def()

Alias for definition

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 932
932:           def target_end;    hsp_first :hit_to;       end

[Source]

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

Alias for len

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 907
907:           def target_seq;    hsp_first :hseq;         end

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 927
927:           def target_start;  hsp_first :hit_from;     end

[Validate]