Class Bio::Blast::Report
In: lib/bio/appl/blast/format8.rb  (CVS)
lib/bio/appl/blast/report.rb  (CVS)
lib/bio/appl/blast/rexml.rb  (CVS)
lib/bio/appl/blast/xmlparser.rb  (CVS)
Parent: Object

Bio::Blast::Report

Parsed results of the blast execution for Tab-delimited and XML output format. Tab-delimited reports are consists of

  Query id,
  Subject id,
  percent of identity,
  alignment length,
  number of mismatches (not including gaps),
  number of gap openings,
  start of alignment in query,
  end of alignment in query,
  start of alignment in subject,
  end of alignment in subject,
  expected value,
  bit score.

according to the MEGABLAST document (README.mbl). As for XML output, see the following DTDs.

  * http://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.dtd
  * http://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.mod
  * http://www.ncbi.nlm.nih.gov/dtd/NCBI_Entity.mod

Methods

db_len   db_num   each   each_hit   each_iteration   eff_space   entrez_query   entropy   expect   filter   gap_extend   gap_open   hits   hsp_len   inclusion   kappa   lambda   matrix   message   new   pattern   rexml   sc_match   sc_mismatch   statistics   tab   xmlparser  

Classes and Modules

Class Bio::Blast::Report::Hit
Class Bio::Blast::Report::Hsp
Class Bio::Blast::Report::Iteration

Constants

DELIMITER = RS = "</BlastOutput>\n"   for Bio::FlatFile support (only for XML data)

Attributes

db  [R]  Shortcut for BlastOutput values.
iterations  [R]  Returns an Array of Bio::Blast::Report::Iteration objects.
parameters  [R]  Returns a Hash containing execution parameters. Valid keys are: ‘matrix’, ‘expect’, ‘include’, ‘sc-match’, ‘sc-mismatch’, ‘gap-open’, ‘gap-extend’, ‘filter
program  [R]  Shortcut for BlastOutput values.
query_def  [R]  Shortcut for BlastOutput values.
query_id  [R]  Shortcut for BlastOutput values.
query_len  [R]  Shortcut for BlastOutput values.
reference  [R]  Shortcut for BlastOutput values.
version  [R]  Shortcut for BlastOutput values.

Public Class methods

Passing a BLAST output from ‘blastall -m 7’ or ’-m 8’ as a String. Formats are auto detected.

[Source]

# File lib/bio/appl/blast/report.rb, line 78
  def initialize(data, parser = nil)
    @iterations = []
    @parameters = {}
    case parser
    when :xmlparser             # format 7
      xmlparser_parse(data)
    when :rexml         # format 7
      rexml_parse(data)
    when :tab           # format 8
      tab_parse(data)
    else
      auto_parse(data)
    end
  end

Specify to use REXML to parse XML (-m 7) output.

[Source]

# File lib/bio/appl/blast/report.rb, line 54
  def self.rexml(data)
    self.new(data, :rexml)
  end

Specify to use tab delimited output parser.

[Source]

# File lib/bio/appl/blast/report.rb, line 59
  def self.tab(data)
    self.new(data, :tab)
  end

Specify to use XMLParser to parse XML (-m 7) output.

[Source]

# File lib/bio/appl/blast/report.rb, line 49
  def self.xmlparser(data)
    self.new(data, :xmlparser)
  end

Public Instance methods

Length of BLAST db

[Source]

# File lib/bio/appl/blast/report.rb, line 158
  def db_len;    statistics['db-len'];    end

Number of sequences in BLAST db

[Source]

# File lib/bio/appl/blast/report.rb, line 156
  def db_num;    statistics['db-num'];    end
each()

Alias for each_hit

Iterates on each Bio::Blast::Report::Hit object of the the last Iteration. Shortcut for the last iteration‘s hits (for blastall)

[Source]

# File lib/bio/appl/blast/report.rb, line 134
  def each_hit
    @iterations.last.each do |x|
      yield x
    end
  end

Iterates on each Bio::Blast::Report::Iteration object. (for blastpgp)

[Source]

# File lib/bio/appl/blast/report.rb, line 126
  def each_iteration
    @iterations.each do |x|
      yield x
    end
  end

Effective search space

[Source]

# File lib/bio/appl/blast/report.rb, line 162
  def eff_space; statistics['eff-space']; end

Limit of request to Entrez : shortcuts for @parameters

[Source]

# File lib/bio/appl/blast/report.rb, line 123
  def entrez_query; @parameters['entrez-query'];     end

Karlin-Altschul parameter H

[Source]

# File lib/bio/appl/blast/report.rb, line 168
  def entropy;   statistics['entropy'];   end

Expectation threshold (-e) : shortcuts for @parameters

[Source]

# File lib/bio/appl/blast/report.rb, line 107
  def expect;       @parameters['expect'].to_i;      end

Filtering options (-F) : shortcuts for @parameters

[Source]

# File lib/bio/appl/blast/report.rb, line 119
  def filter;       @parameters['filter'];           end

Gap extension cost (-E) : shortcuts for @parameters

[Source]

# File lib/bio/appl/blast/report.rb, line 117
  def gap_extend;   @parameters['gap-extend'].to_i;  end

Gap opening cost (-G) : shortcuts for @parameters

[Source]

# File lib/bio/appl/blast/report.rb, line 115
  def gap_open;     @parameters['gap-open'].to_i;    end

Returns a Array of Bio::Blast::Report::Hits of the last iteration. Shortcut for the last iteration‘s hits

[Source]

# File lib/bio/appl/blast/report.rb, line 143
  def hits
    @iterations.last.hits
  end

Effective HSP length

[Source]

# File lib/bio/appl/blast/report.rb, line 160
  def hsp_len;   statistics['hsp-len'];   end

Inclusion threshold (-h) : shortcuts for @parameters

[Source]

# File lib/bio/appl/blast/report.rb, line 109
  def inclusion;    @parameters['include'].to_i;     end

Karlin-Altschul parameter K

[Source]

# File lib/bio/appl/blast/report.rb, line 164
  def kappa;     statistics['kappa'];     end

Karlin-Altschul parameter Lamba

[Source]

# File lib/bio/appl/blast/report.rb, line 166
  def lambda;    statistics['lambda'];    end

Matrix used (-M) : shortcuts for @parameters

[Source]

# File lib/bio/appl/blast/report.rb, line 105
  def matrix;       @parameters['matrix'];           end

Returns a String (or nil) containing execution message of the last iteration (typically "CONVERGED"). Shortcut for the last iteration‘s message (for checking ‘CONVERGED’)

[Source]

# File lib/bio/appl/blast/report.rb, line 173
  def message
    @iterations.last.message
  end

PHI-BLAST pattern : shortcuts for @parameters

[Source]

# File lib/bio/appl/blast/report.rb, line 121
  def pattern;      @parameters['pattern'];          end

Match score for NT (-r) : shortcuts for @parameters

[Source]

# File lib/bio/appl/blast/report.rb, line 111
  def sc_match;     @parameters['sc-match'].to_i;    end

Mismatch score for NT (-q) : shortcuts for @parameters

[Source]

# File lib/bio/appl/blast/report.rb, line 113
  def sc_mismatch;  @parameters['sc-mismatch'].to_i; end

Returns a Hash containing execution statistics of the last iteration. Valid keys are: ‘db-num’, ‘db-len’, ‘hsp-len’, ‘eff-space’, ‘kappa’, ‘lambda’, ‘entropy’ Shortcut for the last iteration‘s statistics.

[Source]

# File lib/bio/appl/blast/report.rb, line 151
  def statistics
    @iterations.last.statistics
  end

[Validate]