Class | Bio::Blast::Default::Report |
In: |
lib/bio/appl/blast/format0.rb
|
Parent: | Object |
Bio::Blast::Default::Report parses NCBI BLAST default output and stores information in the data. It may store some Bio::Blast::Default::Report::Iteration objects.
DELIMITER | = | RS = "\nBLAST" | Delimiter of each entry. Bio::FlatFile uses it. | |
DELIMITER_OVERRUN | = | 5 | (Integer) excess read size included in DELIMITER. |
db_len | [R] | number of letters in database |
db_num | [R] | number of sequences in database |
eff_space | [R] | effective length of the database |
entry_overrun | [R] | piece of next entry. Bio::FlatFile uses it. |
expect | [R] | e-value threshold specified when BLAST was executed |
gap_extend | [R] | gap extend penalty |
gap_open | [R] | gap open penalty |
iterations | [R] | (PSI-BLAST) Returns iterations. It returns an array of Bio::Blast::Default::Report::Iteration class. Note that normal blastall result usually contains one iteration. |
matrix | [R] | name of the matrix |
num_hits | [R] | number of hits. Note that this may differ from hits.size. |
posted_date | [R] | posted date of the database |
sc_match | [R] | match score of the matrix |
sc_mismatch | [R] | mismatch score of the matrix |
Creates a new Report object from BLAST result text.
# File lib/bio/appl/blast/format0.rb, line 48 48: def initialize(str) 49: str = str.sub(/\A\s+/, '') 50: str.sub!(/\n(T?BLAST.*)/m, "\n") # remove trailing entries for sure 51: @entry_overrun = $1 52: @entry = str 53: data = str.split(/(?:^[ \t]*\n)+/) 54: 55: format0_split_headers(data) 56: @iterations = format0_split_search(data) 57: format0_split_stat_params(data) 58: end
Opens file by using Bio::FlatFile.open.
# File lib/bio/appl/blast/format0.rb, line 43 43: def self.open(filename, *mode) 44: Bio::FlatFile.open(self, filename, *mode) 45: end
(PSI-BLAST) Same as iterations.last.converged?. Returns true if the last iteration is converged, otherwise, returns false.
# File lib/bio/appl/blast/format0.rb, line 203 203: def converged? 204: @iterations.last.converged? 205: end
Returns the name (filename or title) of the database.
# File lib/bio/appl/blast/format0.rb, line 227 227: def db 228: unless defined?(@db) 229: if /Database *\: *(.*)/m =~ @f0database then 230: a = $1.split(/^/) 231: a.pop if a.size > 1 232: @db = a.collect { |x| x.sub(/\s+\z/, '') }.join(' ') 233: end 234: end #unless 235: @db 236: end
Iterates over each hit of the last iteration. Same as iterations.last.each_hit. Yields a Bio::Blast::Default::Report::Hit object. This is very useful in most cases, e.g. for blastall results.
# File lib/bio/appl/blast/format0.rb, line 178 178: def each_hit 179: @iterations.last.each do |x| 180: yield x 181: end 182: end
(PSI-BLAST) Iterates over each iteration. Same as iterations.each. Yields a Bio::Blast::Default::Report::Iteration object.
# File lib/bio/appl/blast/format0.rb, line 168 168: def each_iteration 169: @iterations.each do |x| 170: yield x 171: end 172: end
Same as iterations.last.gapped_entropy.
# File lib/bio/appl/blast/format0.rb, line 135 135: def gapped_entropy; @iterations.last.gapped_entropy; end
Same as iterations.last.gapped_kappa.
# File lib/bio/appl/blast/format0.rb, line 131 131: def gapped_kappa; @iterations.last.gapped_kappa; end
Same as iterations.last.gapped_lambda.
# File lib/bio/appl/blast/format0.rb, line 133 133: def gapped_lambda; @iterations.last.gapped_lambda; end
Same as iterations.last.hits. Returns the last iteration‘s hits. Returns an array of Bio::Blast::Default::Report::Hit object. This is very useful in most cases, e.g. for blastall results.
# File lib/bio/appl/blast/format0.rb, line 189 189: def hits 190: @iterations.last.hits 191: end
(PHI-BLAST) Same as iterations.first.pattern_positions. Note that it returns the FIRST iteration‘s value.
# File lib/bio/appl/blast/format0.rb, line 160 160: def pattern_positions 161: @iterations.first.pattern_positions 162: end
Returns definition of the query.
# File lib/bio/appl/blast/format0.rb, line 150 150: def query_def; format0_parse_query; @query_def; end
Returns length of the query.
# File lib/bio/appl/blast/format0.rb, line 147 147: def query_len; format0_parse_query; @query_len; end
Returns the bibliography reference of the BLAST software. Note that this method shows only the first reference. When you want to get additional references, you can use references method.
# File lib/bio/appl/blast/format0.rb, line 211 211: def reference 212: references[0] 213: end
Returns the bibliography references of the BLAST software. Returns an array of strings.
# File lib/bio/appl/blast/format0.rb, line 217 217: def references 218: unless defined?(@references) 219: @references = @f0references.collect do |x| 220: x.to_s.gsub(/\s+/, ' ').strip 221: end 222: end #unless 223: @references 224: end
Returns whole entry as a string.
# File lib/bio/appl/blast/format0.rb, line 69 69: def to_s; @entry; end