Sha256: 41fd85b2a2e1d2967e437db3050bbad34580d4727b7f8bf2f235a47b614684d9
Contents?: true
Size: 1.18 KB
Versions: 341
Compression:
Stored size: 1.18 KB
Contents
#!/usr/bin/env ruby require 'rbbt-util' require 'rbbt/util/simpleopt' $0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_commands options = SOPT.setup <<EOF Produce a heatmap $ rbbt stat heatmap [options] <filename.tsv> [file.png] -h--help Print this help -w--width* Image Width -h--height* Image Height -s--size* Image Size (Height and Width) EOF if options[:help] if defined? rbbt_usage rbbt_usage else puts SOPT.usage end exit 0 end file, png = ARGV raise "No file" if file.nil? width, height, size, logs, positive = options.values_at :width, :height, :size, :logs, :positive size = 800 if size.nil? width = size if width.nil? height = size if height.nil? logs = false if logs.nil? positive = false if positive.nil? require 'rbbt/util/R' if png R.run <<-EOF data = rbbt.tsv2matrix(rbbt.tsv('#{file}')) rbbt.png_plot('#{png}', 'boxplot(data)', width=#{ width }, height=#{ height }) EOF else TmpFile.with_file(nil, :extension => 'png') do |png| R.run <<-EOF data = rbbt.tsv2matrix(rbbt.tsv('#{file}')) rbbt.png_plot('#{png}', 'boxplot(data)', width=#{ width }, height=#{ height }) EOF `eog #{png}` end end
Version data entries
341 entries across 341 versions & 1 rubygems