Sha256: 5dcb3073f5d3992b73e2945a0abcc0069b91fdd3de8ffd6f4a55723ce31dc638
Contents?: true
Size: 1016 Bytes
Versions: 7
Compression:
Stored size: 1016 Bytes
Contents
module Lederhosen class CLI ## # PAIRED-END READ WORK-AROUND (JOIN THEM) # desc "join", "join trimmed reads into a single file" method_option :trimmed, :type => :string, :required => true method_option :output, :type => :string, :required => true def join trimmed = Dir[options[:trimmed]] output = options[:output] ohai "joining #{File.dirname(trimmed.first)} saving to #{output}" ohno "no reads in #{trimmed}" if trimmed.length == 0 output = File.open(output, 'w') pbar = ProgressBar.new "joining", trimmed.length trimmed.each do |fasta_file| pbar.inc begin records = Dna.new File.open(fasta_file) rescue ohai "skipping #{fasta_file} (empty?)" next end records.each_slice(2) do |l, r| output.puts ">#{r.name}:#{File.basename(fasta_file, '.fasta')}\n#{r.sequence.reverse+l.sequence}" end end pbar.finish end end end
Version data entries
7 entries across 7 versions & 1 rubygems