Class Bio::Fasta::Report
In: lib/bio/appl/fasta/format10.rb
Parent: Object

Summarized results of the fasta execution results.

Methods

each   lap_over   new   threshold  

Classes and Modules

Class Bio::Fasta::Report::Hit
Class Bio::Fasta::Report::Program

Attributes

hits  [R]  Returns an Array of Bio::Fasta::Report::Hit objects.
list  [R]  Returns the ‘The best scores are’ lines as a String.
log  [R]  Returns the trailing lines including library size, execution date, fasta function used, and fasta versions as a String.
program  [R]  Returns a Bio::Fasta::Report::Program object.

Public Class methods

[Source]

    # File lib/bio/appl/fasta/format10.rb, line 18
18:   def initialize(data)
19:     # header lines - brief list of the hits
20:     if data.sub!(/.*\nThe best scores are/m, '')
21:       data.sub!(/(.*)\n\n>>>/m, '')
22:       @list = "The best scores are" + $1
23:     else
24:       data.sub!(/.*\n!!\s+/m, '')
25:       data.sub!(/.*/) { |x| @list = x; '' }
26:     end
27: 
28:     # body lines - fasta execution result
29:     program, *hits = data.split(/\n>>/)
30: 
31:     # trailing lines - log messages of the execution
32:     @log = hits.pop
33:     @log.sub!(/.*<\n/m, '')
34:     @log.strip!
35: 
36:     # parse results
37:     @program = Program.new(program)
38:     @hits = []
39: 
40:     hits.each do |x|
41:       @hits.push(Hit.new(x))
42:     end
43:   end

Public Instance methods

Iterates on each Bio::Fasta::Report::Hit object.

[Source]

    # File lib/bio/appl/fasta/format10.rb, line 59
59:   def each
60:     @hits.each do |x|
61:       yield x
62:     end
63:   end

Returns an Array of Bio::Fasta::Report::Hit objects having longer overlap length than ‘length_min’.

[Source]

    # File lib/bio/appl/fasta/format10.rb, line 77
77:   def lap_over(length_min = 0)
78:     list = []
79:     @hits.each do |x|
80:       list.push(x) if x.overlap > length_min
81:     end
82:     return list
83:   end

Returns an Array of Bio::Fasta::Report::Hit objects having better evalue than ‘evalue_max’.

[Source]

    # File lib/bio/appl/fasta/format10.rb, line 67
67:   def threshold(evalue_max = 0.1)
68:     list = []
69:     @hits.each do |x|
70:       list.push(x) if x.evalue < evalue_max
71:     end
72:     return list
73:   end

[Validate]