terminals = "dumb,x11,aqua,post,pdf,png,svg"
title = "Mean Quality Scores"
terminals = "dumb,x11,aqua,post,pdf,png,svg"
title = "Mean Quality Scores"
casts = []
casts << {:long=>'no_stream', :short=>'x', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
casts = []
casts << {:long=>'no_stream', :short=>'x', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
casts << {:long=>'data_out', :short=>'o', :type=>'file', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
casts << {:long=>'terminal', :short=>'t', :type=>'string', :mandatory=>false, :default=>'dumb', :allowed=>terminals, :disallowed=>nil}
casts << {:long=>'title', :short=>'T', :type=>'string', :mandatory=>false, :default=>title, :allowed=>nil, :disallowed=>nil}
casts << {:long=>'xlabel', :short=>'X', :type=>'string', :mandatory=>false, :default=>xlabel, :allowed=>nil, :disallowed=>nil}
casts << {:long=>'ylabel', :short=>'Y', :type=>'string', :mandatory=>false, :default=>ylabel, :allowed=>nil, :disallowed=>nil}
casts << {:long=>'data_out', :short=>'o', :type=>'file', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
casts << {:long=>'terminal', :short=>'t', :type=>'string', :mandatory=>false, :default=>'dumb', :allowed=>terminals, :disallowed=>nil}
casts << {:long=>'title', :short=>'T', :type=>'string', :mandatory=>false, :default=>title, :allowed=>nil, :disallowed=>nil}
casts << {:long=>'xlabel', :short=>'X', :type=>'string', :mandatory=>false, :default=>xlabel, :allowed=>nil, :disallowed=>nil}
casts << {:long=>'ylabel', :short=>'Y', :type=>'string', :mandatory=>false, :default=>ylabel, :allowed=>nil, :disallowed=>nil}
-bp.each_record do |record|
- if record[:SCORES]
- scores = record[:SCORES]
- (0 ... scores.length).each do |i|
- sum_hash[i] += (scores[i].ord - BASE_SOLEXA)
- count_hash[i] += 1
+ scores_vec[0 ... scores.length] += NArray.to_na(scores, "byte") - Seq::SCORE_BASE
+ count_vec[0 ... scores.length] += 1
+
+ max = scores.length if scores.length > max
+ end
plot.ylabel options[:ylabel]
plot.output options[:data_out] if options[:data_out]
plot.xrange "[#{x.min - 1}:#{x.max + 1}]"
plot.ylabel options[:ylabel]
plot.output options[:data_out] if options[:data_out]
plot.xrange "[#{x.min - 1}:#{x.max + 1}]"
- plot.data << Gnuplot::DataSet.new([x, y]) do |ds|
- ds.with = "boxes"
- ds.notitle
+ plot.data << Gnuplot::DataSet.new([x, y1]) do |ds|
+ ds.with = "boxes"
+ ds.title = "mean score"
+ end
+
+ if options[:count]
+ plot.data << Gnuplot::DataSet.new([x, y2]) do |ds|
+ ds.with = "lines lt rgb \"black\""
+ ds.title = "relative count"
+ end