require 'pp'
VEC_MAX = 10_000
+Y_MAX = 100
terminals = "dumb,x11,aqua,post,pdf,png,svg"
title = "Nucleotide Distribution"
casts = []
casts << {:long=>'no_stream', :short=>'x', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'count', :short=>'c', :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}
g = ((vec_g / vec_tot) * 100)[0 ... max_len].to_a
n = ((vec_n / vec_tot) * 100)[0 ... max_len].to_a
+vec_tot *= (Y_MAX / vec_tot.max(0).to_f)
+y = vec_tot.to_a
+
a.unshift 0.0
t.unshift 0.0
c.unshift 0.0
plot.output options[:data_out] if options[:data_out]
plot.ytics "out"
plot.xtics "out"
- plot.yrange "[0:100]"
+ plot.yrange "[0:#{Y_MAX}]"
plot.xrange "[0:#{max_len}]"
plot.auto "fix"
plot.offsets "1"
ds.with = "histogram lt rgb \"red\""
ds.title = "A"
end
+
+ if options[:count]
+ plot.data << Gnuplot::DataSet.new([x, y]) do |ds|
+ ds.with = "lines lt rgb \"black\""
+ ds.title = "relative count"
+ end
+ end
end
end