]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed QA_454_report.rb to work with new analyze_vals
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 17 Oct 2013 11:12:41 +0000 (11:12 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 17 Oct 2013 11:12:41 +0000 (11:12 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@2239 74ccb610-7750-0410-82ae-013aeee3265d

bp_scripts/QA_454_report.rb

index ea06bddb3a1c5b29f3ad2c336f8f1641cf94a099..12397892fd0dd179cf19c3ef297fb04b20a05a19 100755 (executable)
@@ -68,7 +68,7 @@ class Report
          progress_meter |
          analyze_seq |
          analyze_vals -k GC%,HARD_MASK%,SOFT_MASK% |
-         write_tab -co #{@anal_file} -x"
+         write_tab -o #{@anal_file} -x"
        )
       STDERR.puts "done.\n"
     end
@@ -76,31 +76,14 @@ class Report
     def parse_analyze_vals
       File.open(@anal_file, "r") do |ios|
         while not ios.eof?
-          line = ios.readline.chomp
-
-          case line
-          when /COUNT\s+(\d+)/           then @count = $1
-          when /MIN\s+(\d+)/             then @min   = $1
-          when /MAX\s+(\d+)/             then @max   = $1
-          when /MEAN\s+(\d+)/            then @mean  = $1
-          when /SUM\s+(\d+)/             then @bases = $1
-          when /GC%_MEAN:\s+(.+)/        then @gc    = $1
-          when /HARD_MASK%_MEAN:\s+(.+)/ then @hard  = $1
-          when /SOFT_MASK%_MEAN:\s+(.+)/ then @soft  = $1
-          end
-        end
-      end
-    end
-
-    def parse_mean_vals
-      File.open(@out2_file, "r") do |ios|
-        while not ios.eof?
-          line = ios.readline.chomp
-
-          case line
-          when /GC%_MEAN: (.+)/;        then @gc   = $1
-          when /HARD_MASK%_MEAN: (.+)/; then @hard = $1
-          when /SOFT_MASK%_MEAN: (.+)/; then @soft = $1
+          line   = ios.readline.chomp
+          fields = line.split("\t")
+
+          case fields.first
+          when "SEQ"        then @count, @min, @max, @sum, @mean = fields[2], fields[3], fields[4], fields[5], fields[6]
+          when "GC%"        then @gc   = fields[6]
+          when "HARD_MASK%" then @hard = fields[6]
+          when "SOFT_MASK%" then @soft = fields[6]
           end
         end
       end