[BioRuby-cvs] bioruby/lib/bio/appl/blast format0.rb, 1.20, 1.21 wublast.rb, 1.9, 1.10

Naohisa Goto ngoto at dev.open-bio.org
Sat Apr 21 08:25:15 UTC 2007


Update of /home/repository/bioruby/bioruby/lib/bio/appl/blast
In directory dev.open-bio.org:/tmp/cvs-serv21488/lib/bio/appl/blast

Modified Files:
	format0.rb wublast.rb 
Log Message:
* Incompatible Changes: In Bio::BLAST::Default::Report#expect and 
  and Bio::BLAST::WU::Report#expect are changed to return a Float or nil
  instead of a String or nil.
* Incompatible Changes: In Bio::BLAST::Default::Report::Hit,
  Bio::BLAST::Default::Report::HSP, Bio::BLAST::WU::Report::Hit,
  and Bio::BLAST::WU::Report::HSP, following methods are changed
  to return a Float object instead of a String object: evalue, pvalue
  (note that pvalue is only available in WU-BLAST).


Index: wublast.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/wublast.rb,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** wublast.rb	5 Apr 2007 23:35:39 -0000	1.9
--- wublast.rb	21 Apr 2007 08:25:13 -0000	1.10
***************
*** 138,141 ****
--- 138,145 ----
                end
              end
+             if ev = @parameters['E'] then
+               ev = '1' + ev if ev[0] == ?e
+               @parameters['E'] = ev.to_f
+             end
              @parse_parameters = true
            end
***************
*** 251,256 ****
                    scr = z.pop.to_s
                    pval = z.pop.to_s
                    nnum = z.pop.to_i
-                   #ev = '1' + ev if ev[0] == ?e
                    h.instance_eval {
                      @score = scr
--- 255,261 ----
                    scr = z.pop.to_s
                    pval = z.pop.to_s
+                   pval = '1' + pval if pval[0] == ?e
+                   pval = (pval.empty? ? (1.0/0.0) : pval.to_f)
                    nnum = z.pop.to_i
                    h.instance_eval {
                      @score = scr

Index: format0.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/format0.rb,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** format0.rb	5 Apr 2007 23:35:39 -0000	1.20
--- format0.rb	21 Apr 2007 08:25:13 -0000	1.21
***************
*** 328,332 ****
                while sc.rest?
                  if sc.match?(/Number of sequences better than +([e\-\.\d]+) *\: *(.+)/) then
!                   @expect = sc[1]
                    @num_hits = sc[2].tr(',', '').to_i
                  end
--- 328,334 ----
                while sc.rest?
                  if sc.match?(/Number of sequences better than +([e\-\.\d]+) *\: *(.+)/) then
!                   ev = sc[1]
!                   ev = '1' + ev if ev[0] == ?e
!                   @expect = ev.to_f
                    @num_hits = sc[2].tr(',', '').to_i
                  end
***************
*** 659,663 ****
                      bs = z.pop.to_s
                      ev = z.pop.to_s
!                     #ev = '1' + ev if ev[0] == ?e
                      h.instance_eval { @bit_score = bs; @evalue = ev }
                      @hits << h
--- 661,666 ----
                      bs = z.pop.to_s
                      ev = z.pop.to_s
!                     ev = '1' + ev if ev[0] == ?e
!                     ev = (ev.empty? ? (1.0/0.0) : ev.to_f)
                      h.instance_eval { @bit_score = bs; @evalue = ev }
                      @hits << h
***************
*** 950,955 ****
                  sc.skip(/\s*/)
                  if sc.skip(/Expect(?:\(\d\))? *\= *([e\-\.\d]+)/) then
!                   @evalue = sc[1]
!                   #@evalue = '1' + @evalue if @evalue[0] == ?e
                  elsif sc.skip(/Score *\= *([e\-\.\d]+) *bits *\( *([e\-\.\d]+) *\)/) then
                    @bit_score = sc[1]
--- 953,959 ----
                  sc.skip(/\s*/)
                  if sc.skip(/Expect(?:\(\d\))? *\= *([e\-\.\d]+)/) then
!                   ev = sc[1].to_s
!                   ev = '1' + ev if ev[0] == ?e
!                   @evalue = ev.to_f
                  elsif sc.skip(/Score *\= *([e\-\.\d]+) *bits *\( *([e\-\.\d]+) *\)/) then
                    @bit_score = sc[1]
***************
*** 1001,1009 ****
                    #WU-BLAST
                    @p_sum_n = nil
!                   @pvalue = sc[1]
                  elsif sc.skip(/Sum +P *\( *(\d+) *\) *\= *([e\-\.\d]+)/) then
                    #WU-BLAST
                    @p_sum_n = sc[1].to_i
!                   @pvalue = sc[2]
                  else
                    raise ScanError
--- 1005,1017 ----
                    #WU-BLAST
                    @p_sum_n = nil
!                   pv = sc[1]
!                   pv = '1' + pv if pv[0] == ?e
!                   @pvalue = pv.to_f
                  elsif sc.skip(/Sum +P *\( *(\d+) *\) *\= *([e\-\.\d]+)/) then
                    #WU-BLAST
                    @p_sum_n = sc[1].to_i
!                   pv = sc[2]
!                   pv = '1' + pv if pv[0] == ?e
!                   @pvalue = pv.to_f
                  else
                    raise ScanError




More information about the bioruby-cvs mailing list