From 18f4c5371c25aa7ab35b4bf971f1367751bacea5 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Wed, 25 May 2011 08:41:35 +0000 Subject: [PATCH] polished plot_scores git-svn-id: http://biopieces.googlecode.com/svn/trunk@1430 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/plot_scores | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bp_bin/plot_scores b/bp_bin/plot_scores index 59cf3e3..20d12e3 100755 --- a/bp_bin/plot_scores +++ b/bp_bin/plot_scores @@ -44,7 +44,9 @@ casts << {:long=>'ylabel', :short=>'Y', :type=>'string', :mandatory=>false, : options = Biopieces.options_parse(ARGV, casts) -BASE_SOLEXA = 64 +ILLUMINA_BASE = 64 +ILLUMINA_MIN = 0 +ILLUMINA_MAX = 40 sum_hash = Hash.new(0) count_hash = Hash.new(0) @@ -54,7 +56,7 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| if record[:SCORES] scores = record[:SCORES] (0 ... scores.length).each do |i| - sum_hash[i] += (scores[i].ord - BASE_SOLEXA) + sum_hash[i] += (scores[i].ord - ILLUMINA_BASE) count_hash[i] += 1 end end @@ -79,7 +81,7 @@ Gnuplot.open do |gp| plot.ylabel options[:ylabel] plot.output options[:data_out] if options[:data_out] plot.xrange "[#{x.min - 1}:#{x.max + 1}]" - plot.yrange "[0:40]" + plot.yrange "[#{ILLUMINA_MIN}:#{ILLUMINA_MAX}]" plot.style "fill solid 0.5 border" plot.xtics "out" plot.ytics "out" -- 2.39.2