]> 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 07:34:56 +0000 (07:34 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 17 Oct 2013 07:34:56 +0000 (07:34 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@2238 74ccb610-7750-0410-82ae-013aeee3265d

bp_scripts/QA_454_report.rb

index 8c079f379ba9de4f658a88214e4ed99245d3d55f..ea06bddb3a1c5b29f3ad2c336f8f1641cf94a099 100755 (executable)
@@ -45,8 +45,7 @@ class Report
 
     def initialize(sff_file, tmpdir)
       @sff_file  = sff_file
-      @out1_file = File.join(tmpdir, "out1.txt")
-      @out2_file = File.join(tmpdir, "out2.txt")
+      @anal_file = File.join(tmpdir, "out1.txt")
       @count     = 0
       @min       = 0
       @max       = 0
@@ -58,7 +57,6 @@ class Report
 
       bp_seq_analyze
       parse_analyze_vals
-      parse_mean_vals
     end
 
     private
@@ -68,24 +66,27 @@ class Report
       system(
         "read_sff -i #{@sff_file} |
          progress_meter |
-         analyze_vals -k SEQ -o #{@out1_file} |
          analyze_seq |
-         mean_vals -k 'GC%,HARD_MASK%,SOFT_MASK%' -o #{@out2_file} -x"
+         analyze_vals -k GC%,HARD_MASK%,SOFT_MASK% |
+         write_tab -co #{@anal_file} -x"
        )
       STDERR.puts "done.\n"
     end
 
     def parse_analyze_vals
-      File.open(@out1_file, "r") do |ios|
+      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 /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