From 187c65e774da277ab41729ca06344cb24fe8e60a Mon Sep 17 00:00:00 2001 From: martinahansen Date: Thu, 17 Oct 2013 11:12:41 +0000 Subject: [PATCH] fixed QA_454_report.rb to work with new analyze_vals git-svn-id: http://biopieces.googlecode.com/svn/trunk@2239 74ccb610-7750-0410-82ae-013aeee3265d --- bp_scripts/QA_454_report.rb | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/bp_scripts/QA_454_report.rb b/bp_scripts/QA_454_report.rb index ea06bdd..1239789 100755 --- a/bp_scripts/QA_454_report.rb +++ b/bp_scripts/QA_454_report.rb @@ -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 -- 2.39.2