| Class | Bio::Blast::Report |
| In: |
lib/bio/appl/blast/xmlparser.rb
lib/bio/appl/blast/format8.rb lib/bio/appl/blast/report.rb lib/bio/appl/blast/rexml.rb |
| Parent: | Object |
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
| DELIMITER | = | RS = "</BlastOutput>\n" | for Bio::FlatFile support (only for XML data) | |
| FLATFILE_SPLITTER | = | BlastXmlSplitter | splitter for Bio::FlatFile support |
| db | [R] | database name or title (String) |
| 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] | program name (e.g. "blastp") (String) |
| query_def | [R] | query definition line (String) |
| query_id | [R] | query ID (String) |
| query_len | [R] | query length (Integer) |
| reference | [R] | reference (String) |
| reports | [R] |
When the report contains results for multiple query sequences, returns an
array of Bio::Blast::Report objects corresponding
to the multiple queries. Otherwise, returns nil.
Note for "No hits found": When no hits found for a query sequence, the result for the query is completely void and no information available in the result XML, including query ID and query definition. The only trace is that iteration number is skipped. This means that if the no-hit query is the last query, the query can not be detected, because the result XML is completely the same as the result XML without the query. |
| version | [R] | BLAST version (e.g. "blastp 2.2.18 [Mar-02-2008]") (String) |
Passing a BLAST output from ‘blastall -m 7’ or ’-m 8’ as a String. Formats are auto detected.
# File lib/bio/appl/blast/report.rb, line 81
81: def initialize(data, parser = nil)
82: @iterations = []
83: @parameters = {}
84: case parser
85: when :xmlparser # format 7
86: xmlparser_parse(data)
87: @reports = blastxml_split_reports
88: when :rexml # format 7
89: rexml_parse(data)
90: @reports = blastxml_split_reports
91: when :tab # format 8
92: tab_parse(data)
93: when false
94: # do not parse, creates an empty object
95: else
96: auto_parse(data)
97: end
98: end
Specify to use REXML to parse XML (-m 7) output.
# File lib/bio/appl/blast/report.rb, line 55
55: def self.rexml(data)
56: self.new(data, :rexml)
57: end
Specify to use XMLParser to parse XML (-m 7) output.
# File lib/bio/appl/blast/report.rb, line 50
50: def self.xmlparser(data)
51: self.new(data, :xmlparser)
52: end
Length of BLAST db
# File lib/bio/appl/blast/report.rb, line 187
187: def db_len; statistics['db-len']; end
Number of sequences in BLAST db
# File lib/bio/appl/blast/report.rb, line 185
185: def db_num; statistics['db-num']; end
Iterates on each Bio::Blast::Report::Hit object of the the last Iteration. Shortcut for the last iteration‘s hits (for blastall)
# File lib/bio/appl/blast/report.rb, line 163
163: def each_hit
164: @iterations.last.each do |x|
165: yield x
166: end
167: end
Iterates on each Bio::Blast::Report::Iteration object. (for blastpgp)
# File lib/bio/appl/blast/report.rb, line 155
155: def each_iteration
156: @iterations.each do |x|
157: yield x
158: end
159: end
Effective search space
# File lib/bio/appl/blast/report.rb, line 191
191: def eff_space; statistics['eff-space']; end
Limit of request to Entrez : shortcuts for @parameters
# File lib/bio/appl/blast/report.rb, line 152
152: def entrez_query; @parameters['entrez-query']; end
Karlin-Altschul parameter H
# File lib/bio/appl/blast/report.rb, line 197
197: def entropy; statistics['entropy']; end
Expectation threshold (-e) : shortcuts for @parameters
# File lib/bio/appl/blast/report.rb, line 136
136: def expect; @parameters['expect']; end
Filtering options (-F) : shortcuts for @parameters
# File lib/bio/appl/blast/report.rb, line 148
148: def filter; @parameters['filter']; end
Gap extension cost (-E) : shortcuts for @parameters
# File lib/bio/appl/blast/report.rb, line 146
146: def gap_extend; @parameters['gap-extend']; end
Gap opening cost (-G) : shortcuts for @parameters
# File lib/bio/appl/blast/report.rb, line 144
144: def gap_open; @parameters['gap-open']; end
Effective HSP length
# File lib/bio/appl/blast/report.rb, line 189
189: def hsp_len; statistics['hsp-len']; end
Inclusion threshold (-h) : shortcuts for @parameters
# File lib/bio/appl/blast/report.rb, line 138
138: def inclusion; @parameters['include']; end
Karlin-Altschul parameter K
# File lib/bio/appl/blast/report.rb, line 193
193: def kappa; statistics['kappa']; end
Karlin-Altschul parameter Lamba
# File lib/bio/appl/blast/report.rb, line 195
195: def lambda; statistics['lambda']; end
Matrix used (-M) : shortcuts for @parameters
# File lib/bio/appl/blast/report.rb, line 134
134: def matrix; @parameters['matrix']; end
Match score for NT (-r) : shortcuts for @parameters
# File lib/bio/appl/blast/report.rb, line 140
140: def sc_match; @parameters['sc-match']; end
Mismatch score for NT (-q) : shortcuts for @parameters
# File lib/bio/appl/blast/report.rb, line 142
142: def sc_mismatch; @parameters['sc-mismatch']; 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.
# File lib/bio/appl/blast/report.rb, line 180
180: def statistics
181: @iterations.last.statistics
182: end