Class | Bio::Spidey::Report
In: | lib/bio/appl/spidey/report.rb
Parent: | Object

Spidey report parser class. Please see bio/appl/spidey/report.rb for details.

Its object may contain some Bio::Spidey::Report::Hit objects.

### Methods

each each_hit mrna new num_hits query_def query_id query_len

### Classes and Modules

Class Bio::Spidey::Report::Hit
Class Bio::Spidey::Report::Segment
Class Bio::Spidey::Report::SegmentPair
Class Bio::Spidey::Report::SeqDesc

### Constants

DELIMITER | = | RS = "\n--SPIDEY " |  | Delimiter of each entry. Bio::FlatFile uses it.
DELIMITER_OVERRUN | = | 9 |  | (Integer) excess read size included in DELIMITER.

### Attributes

all_hits | [R] | Returns an Array of Bio::Spidey::Report::Hit objects. Unlike Bio::Spidey::Report#hits, the method returns results of all trials of pairwise alignment. This would be a Bio::Spidey specific method.
entry_overrun | [R] | piece of next entry. Bio::FlatFile uses it.
hits | [R] | Returns an Array of Bio::Spidey::Report::Hit objects. Because current version of SPIDEY supports only 1 genomic sequences, the number of hits is 1 or 0.

### Public Class methods

new(str)

Creates a new Bio::Spidey::Report object from String. You can use Bio::FlatFile to read a file.

[Source]

        # File lib/bio/appl/spidey/report.rb, line 47
    47:       def initialize(str)
    48:         str = str.sub(/\A\s+/, '')
    49:         str.sub!(/\n(^\-\-SPIDEY .*)/m, '')  # remove trailing entries for sure
    50:         @entry_overrun = $1
    51:         data = str.split(/\r?\n(?:\r?\n)+/)
    52:         d0 = data.shift.to_s.split(/\r?\n/)
    53:         @hit = Hit.new(data, d0)
    54:         @all_hits = [ @hit ]
    55:         if d0.empty? or /\ANo alignment found\.\s*\z/ =~ d0[-1] then
    56:           @hits = []
    57:         else
    58:           @hits = [ @hit ]
    59:         end
    60:       end

### Public Instance methods

each()

Alias for each_hit

each_hit() {|hit| ...}

Iterates over each hits. Same as hits.each. Yields a Bio::Spidey::Report::Hit object.

[Source]

         # File lib/bio/appl/spidey/report.rb, line 576
    576:       def each_hit(&x) #:yields: hit
    577:         @hits.each(&x)
    578:       end

mrna()

Returns sequence informationsof the mRNA. Returns a Bio::Spidey::Report::SeqDesc object. This would be a Bio::Spidey specific method.

[Source]

         # File lib/bio/appl/spidey/report.rb, line 563
    563:       def mrna; @hit.mrna; end

num_hits()

Returns number of hits. Same as hits.size.

[Source]

         # File lib/bio/appl/spidey/report.rb, line 571
    571:       def num_hits;     @hits.size;     end

query_def()

Returns definition of the mRNA (query) sequence.

[Source]

         # File lib/bio/appl/spidey/report.rb, line 582
    582:       def query_def; @hit.mrna.definition; end

query_id()

Returns identifier of the mRNA (query) sequence.

[Source]

         # File lib/bio/appl/spidey/report.rb, line 585
    585:       def query_id;  @hit.mrna.entry_id;   end

query_len()

Returns the length of the mRNA (query) sequence.

[Source]

         # File lib/bio/appl/spidey/report.rb, line 588
    588:       def query_len; @hit.mrna.len;        end

[Validate]