[BioRuby-cvs] bioruby/lib/bio/appl/blast format0.rb, 1.24, 1.25 wublast.rb, 1.11, 1.12

Naohisa Goto ngoto at dev.open-bio.org
Thu Dec 27 17:28:59 UTC 2007


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

Modified Files:
	format0.rb wublast.rb 
Log Message:
Fixed parse error for NCBI BLAST 2.2.17.
Added Default::Report#references and Default::Report::HSP#stat_method methods.


Index: wublast.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/wublast.rb,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** wublast.rb	21 Apr 2007 08:58:17 -0000	1.11
--- wublast.rb	27 Dec 2007 17:28:57 -0000	1.12
***************
*** 71,78 ****
          def format0_split_headers(data)
            @f0header = data.shift
            while r = data.first
              case r
              when /^Reference\: /
!               @f0reference = data.shift
              when /^Copyright /
                @f0copyright = data.shift
--- 71,79 ----
          def format0_split_headers(data)
            @f0header = data.shift
+           @f0references = []
            while r = data.first
              case r
              when /^Reference\: /
!               @f0references.push data.shift
              when /^Copyright /
                @f0copyright = data.shift

Index: format0.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/format0.rb,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** format0.rb	14 Dec 2007 16:12:17 -0000	1.24
--- format0.rb	27 Dec 2007 17:28:57 -0000	1.25
***************
*** 224,232 ****
  
          # Returns the bibliography reference of the BLAST software. 
          def reference
!           unless defined?(@reference)
!             @reference = @f0reference.to_s.gsub(/\s+/, ' ').strip
            end #unless
!           @reference
          end
  
--- 224,243 ----
  
          # 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 <tt>references</tt> method.
          def reference
!           references[0]
!         end
! 
!         # Returns the bibliography references of the BLAST software. 
!         # Returns an array of strings.
!         def references
!           unless defined?(@references)
!             @references = @f0references.collect do |x|
!               x.to_s.gsub(/\s+/, ' ').strip
!             end
            end #unless
!           @references
          end
  
***************
*** 277,281 ****
          def format0_split_headers(data)
            @f0header = data.shift
!           @f0reference = data.shift
            @f0query = data.shift
            @f0database = data.shift
--- 288,295 ----
          def format0_split_headers(data)
            @f0header = data.shift
!           @f0references = []
!           while data[0] and /\AQuery\=/ !~ data[0]
!             @f0references.push data.shift
!           end
            @f0query = data.shift
            @f0database = data.shift
***************
*** 1021,1024 ****
--- 1035,1042 ----
                    pv = '1' + pv if pv[0] == ?e
                    @pvalue = pv.to_f
+                 elsif sc.skip(/Method\:\s*(.+)/) then
+                   # signature of composition-based statistics method
+                   # for example, "Method: Composition-based stats."
+                   @stat_method = sc[1]
                  else
                    raise ScanError
***************
*** 1090,1093 ****
--- 1108,1118 ----
            method_after_parse_score :hit_strand
  
+           # statistical method for calculating evalue and/or score
+           # (nil or a string)
+           # (note that composition-based statistics for blastp or tblastn
+           # were enabled by default after NCBI BLAST 2.2.17)
+           attr_reader              :stat_method if false #dummy
+           method_after_parse_score :stat_method
+ 
            # Parses alignments.
            def parse_alignment




More information about the bioruby-cvs mailing list