]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/plot_scores
polished plot_scores
[biopieces.git] / bp_bin / plot_scores
index 59cf3e3e7b84b9369523755e0f2f98f72062e2cf..20d12e3dffab519884f4642224b78d0dade8ef70 100755 (executable)
@@ -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"