class Bio::Blast::Default::Report
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.
Constants
- DELIMITER
-
Delimiter of each entry.
Bio::FlatFile
uses it. - DELIMITER_OVERRUN
-
(Integer) excess read size included in
DELIMITER
.
Attributes
number of letters in database
number of sequences in database
effective length of the database
piece of next entry. Bio::FlatFile
uses it.
e-value threshold specified when BLAST was executed
gap extend penalty
gap open penalty
(PSI-BLAST) Returns iterations. It returns an array of Bio::Blast::Default::Report::Iteration
class. Note that normal blastall result usually contains one iteration.
name of the matrix
number of hits. Note that this may differ from hits.size
.
posted date of the database
match score of the matrix
mismatch score of the matrix
Public Class Methods
Source
# File lib/bio/appl/blast/format0.rb 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
Creates a new Report
object from BLAST result text.
Source
# File lib/bio/appl/blast/format0.rb 43 def self.open(filename, *mode) 44 Bio::FlatFile.open(self, filename, *mode) 45 end
Opens file by using Bio::FlatFile.open
.
Public Instance Methods
Source
# File lib/bio/appl/blast/format0.rb 203 def converged? 204 @iterations.last.converged? 205 end
(PSI-BLAST) Same as iterations.last.converged?
. Returns true if the last iteration is converged, otherwise, returns false.
Source
# File lib/bio/appl/blast/format0.rb 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
Returns the name (filename or title) of the database.
Source
# File lib/bio/appl/blast/format0.rb 178 def each_hit 179 @iterations.last.each do |x| 180 yield x 181 end 182 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.
Source
# File lib/bio/appl/blast/format0.rb 168 def each_iteration 169 @iterations.each do |x| 170 yield x 171 end 172 end
(PSI-BLAST) Iterates over each iteration. Same as iterations.each
. Yields a Bio::Blast::Default::Report::Iteration
object.
Source
# File lib/bio/appl/blast/format0.rb 128 def entropy; @iterations.last.entropy; end
Same as iterations.last.entropy
.
Source
# File lib/bio/appl/blast/format0.rb 135 def gapped_entropy; @iterations.last.gapped_entropy; end
Same as iterations.last.gapped_entropy
.
Source
# File lib/bio/appl/blast/format0.rb 131 def gapped_kappa; @iterations.last.gapped_kappa; end
Same as iterations.last.gapped_kappa
.
Source
# File lib/bio/appl/blast/format0.rb 133 def gapped_lambda; @iterations.last.gapped_lambda; end
Same as iterations.last.gapped_lambda
.
Source
# File lib/bio/appl/blast/format0.rb 189 def hits 190 @iterations.last.hits 191 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.
Source
# File lib/bio/appl/blast/format0.rb 124 def kappa; @iterations.last.kappa; end
Same as iterations.last.kappa
.
Source
# File lib/bio/appl/blast/format0.rb 126 def lambda; @iterations.last.lambda; end
Same as iterations.last.lambda
.
Source
# File lib/bio/appl/blast/format0.rb 195 def message 196 @iterations.last.message 197 end
(PSI-BLAST) Same as iterations.last.message
.
Source
# File lib/bio/appl/blast/format0.rb 155 def pattern; @iterations.first.pattern; end
(PHI-BLAST) Same as iterations.first.pattern
. Note that it returns the FIRST iteration’s value.
Source
# File lib/bio/appl/blast/format0.rb 160 def pattern_positions 161 @iterations.first.pattern_positions 162 end
(PHI-BLAST) Same as iterations.first.pattern_positions
. Note that it returns the FIRST iteration’s value.
Source
# File lib/bio/appl/blast/format0.rb 138 def program; format0_parse_header; @program; end
Returns program name.
Source
# File lib/bio/appl/blast/format0.rb 150 def query_def; format0_parse_query; @query_def; end
Returns definition of the query.
Source
# File lib/bio/appl/blast/format0.rb 147 def query_len; format0_parse_query; @query_len; end
Returns length of the query.
Source
# File lib/bio/appl/blast/format0.rb 211 def reference 212 references[0] 213 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.
Source
# File lib/bio/appl/blast/format0.rb 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 the bibliography references of the BLAST software. Returns an array of strings.
Source
# File lib/bio/appl/blast/format0.rb 69 def to_s; @entry; end
Returns whole entry as a string.
Source
# File lib/bio/appl/blast/format0.rb 140 def version; format0_parse_header; @version; end
Returns version of the program.
Source
# File lib/bio/appl/blast/format0.rb 144 def version_date; format0_parse_header; @version_date; end
Returns released date of the program.
Source
# File lib/bio/appl/blast/format0.rb 142 def version_number; format0_parse_header; @version_number; end
Returns version number string of the program.