Sha256: 736e2a14c4b894e7bda5ea1f896dee0c5af02a04bd1be6e7df7ca99620388630
Contents?: true
Size: 1.22 KB
Versions: 4
Compression:
Stored size: 1.22 KB
Contents
## # MAKE TABLES # SEP = ',' module Lederhosen class CLI desc "otu_tables generates otu tables", "--clusters=clusters.uc --output=otu_prefix" method_option :clusters, :type => :string, :required => true method_option :output, :type => :string, :required => true def otu_table input = options[:clusters] output = options[:output] joined_reads = options[:joined] # Load cluster table! clstr_info = Helpers.load_uc_file input clstr_counts = clstr_info[:clstr_counts] # clstr_counts[:clstr][sample.to_i] = reads clstrnr_to_seed = clstr_info[:clstrnr_to_seed] samples = clstr_info[:samples] # print OTU abundancy matrix File.open("#{output}.csv", 'w') do |h| samples = samples.sort clusters = clstr_counts.keys # print header head = samples.join(SEP) h.puts "-" + SEP + head # start printing clusters clusters.each do |cluster| h.print "cluster-#{cluster}" samples.each do |sample| h.print "#{SEP}#{clstr_counts[cluster][sample]}" end h.print "\n" end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems