[BioRuby-cvs] bioruby/lib/bio/appl/blat report.rb,1.11,1.12

Naohisa Goto ngoto at dev.open-bio.org
Thu Jun 29 11:54:35 UTC 2006


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

Modified Files:
	report.rb 
Log Message:
* psl without header is supported.
* New attribute ``psl_version'' is added.


Index: report.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blat/report.rb,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** report.rb	28 Jun 2006 13:43:31 -0000	1.11
--- report.rb	29 Jun 2006 11:54:33 -0000	1.12
***************
*** 59,62 ****
--- 59,67 ----
              @hits << Hit.new(line)
            else
+             # for headerless data
+             if /^\d/ =~ line then
+               flag = true
+               redo
+             end
              line = line.chomp
              if /\A\-+\s*\z/ =~ line
***************
*** 81,85 ****
        # Parses headers.
        def parse_header(ary)
!         ary.shift # first line is removed
          a0 = ary.collect { |x| x.split(/\t/) }
          k = []
--- 86,98 ----
        # Parses headers.
        def parse_header(ary)
!         while x = ary.shift
!           if /psLayout version (\S+)/ =~ x then
!             @psl_version = $1
!             break
!           elsif !(x.strip.empty?)
!             ary.unshift(x)
!             break
!           end
!         end
          a0 = ary.collect { |x| x.split(/\t/) }
          k = []
***************
*** 95,98 ****
--- 108,114 ----
        private :parse_header
  
+       # version of the psl format (String or nil).
+       attr_reader :psl_version
+ 
        # Bio::Blat::Report::SeqDesc stores sequence information of
        # query or subject of the BLAT report.




More information about the bioruby-cvs mailing list