class Bio::Spidey::Report

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

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

Constants

DELIMITER

Delimiter of each entry. Bio::FlatFile uses it.

DELIMITER_OVERRUN

(Integer) excess read size included in DELIMITER.

Attributes

all_hits[R]

Returns an Array of Bio::Spidey::Report::Hit objects. Unlike #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) click to toggle source

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

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

Public Instance Methods

each()
Alias for: each_hit
each_hit() { |hit| ... } click to toggle source

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

# File lib/bio/appl/spidey/report.rb, line 576
def each_hit(&x) #:yields: hit
  @hits.each(&x)
end
Also aliased as: each
mrna() click to toggle source

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

# File lib/bio/appl/spidey/report.rb, line 563
def mrna; @hit.mrna; end
num_hits() click to toggle source

Returns number of hits. Same as hits.size.

# File lib/bio/appl/spidey/report.rb, line 571
def num_hits;     @hits.size;     end
query_def() click to toggle source

Returns definition of the mRNA (query) sequence.

# File lib/bio/appl/spidey/report.rb, line 582
def query_def; @hit.mrna.definition; end
query_id() click to toggle source

Returns identifier of the mRNA (query) sequence.

# File lib/bio/appl/spidey/report.rb, line 585
def query_id;  @hit.mrna.entry_id;   end
query_len() click to toggle source

Returns the length of the mRNA (query) sequence.

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