class Bio::Blast::WU::Report::Iteration
Iteration
class for WU-BLAST report. Though WU-BLAST does not iterate like PSI-BLAST, Bio::Blast::WU::Report::Iteration
aims to keep compatibility with Bio::Blast::Default::Report::* classes. It may contain some Bio::Blast::WU::Report::Hit
objects. Because it inherits Bio::Blast::Default::Report::Iteration
, please also refer Bio::Blast::Default::Report::Iteration
.
Public Class Methods
new(data)
click to toggle source
Creates a new Iteration
object. It is designed to be called only internally from the Bio::Blast::WU::Report
class. Users shall not use the method directly.
# File lib/bio/appl/blast/wublast.rb 319 def initialize(data) 320 @f0stat = [] 321 @f0dbstat = Default::Report::AlwaysNil.instance 322 @f0hitlist = [] 323 @hits = [] 324 @num = 1 325 @f0message = [] 326 @f0warnings = [] 327 return unless r = data.first 328 return if /\AParameters\:$/ =~ r 329 return if /\AEXIT CODE *\d+/ =~ r 330 @f0hitlist << data.shift 331 return unless r = data.shift 332 unless /\*{3} +NONE +\*{3}/ =~ r then 333 @f0hitlist << r 334 while r = data.first and /^WARNING\: / =~ r 335 @f0warnings << data.shift 336 end 337 while r = data.first and /^\>/ =~ r 338 @hits << Hit.new(data) 339 end 340 end #unless 341 end
Public Instance Methods
warnings()
click to toggle source
Returns warning messages.
# File lib/bio/appl/blast/wublast.rb 344 def warnings 345 @f0warnings 346 end
Private Instance Methods
parse_hitlist()
click to toggle source
Parses hit list.
# File lib/bio/appl/blast/wublast.rb 350 def parse_hitlist 351 unless defined?(@parse_hitlist) 352 r = @f0hitlist.shift.to_s 353 if /Reading/ =~ r and /Frame/ =~ r then 354 flag_tblast = true 355 spnum = 5 356 else 357 flag_tblast = nil 358 spnum = 4 359 end 360 i = 0 361 @f0hitlist.each do |x| 362 b = x.split(/^/) 363 b.collect! { |y| y.empty? ? nil : y } 364 b.compact! 365 b.each do |y| 366 y.strip! 367 y.reverse! 368 z = y.split(/\s+/, spnum) 369 z.each { |y| y.reverse! } 370 dfl = z.pop 371 h = @hits[i] 372 unless h then 373 h = Hit.new([ dfl.to_s.sub(/\.+\z/, '') ]) 374 @hits[i] = h 375 end 376 z.pop if flag_tblast #ignore Reading Frame 377 scr = z.pop 378 scr = (scr ? scr.to_i : nil) 379 pval = z.pop.to_s 380 pval = '1' + pval if pval[0] == ?e 381 pval = (pval.empty? ? (1.0/0.0) : pval.to_f) 382 nnum = z.pop.to_i 383 h.instance_eval { 384 @score = scr 385 @pvalue = pval 386 @n_number = nnum 387 } 388 i += 1 389 end 390 end #each 391 @parse_hitlist = true 392 end #unless 393 end