Sha256: 34fdb0a7baebb0fd8e23ba4272af3a55210fd5ca84104370aefe06603a78d062

Contents?: true

Size: 849 Bytes

Versions: 6

Compression:

Stored size: 849 Bytes

Contents

##
# QUALITY TRIMMING
#

module Lederhosen
  class CLI

    desc "trim Illumina QSEQ files",
         "--reads_dir=reads/* --out_dir=trimmed.fasta"

    method_option :reads_dir, :type => :string, :required => true
    method_option :out_dir,   :type => :string, :required => true

    def trim

      raw_reads = options[:reads_dir]
      out_dir = options[:out_dir]

      `mkdir -p #{out_dir}`

      raw_reads = Helpers.get_grouped_qseq_files raw_reads
      ohai "found #{raw_reads.length} pairs of reads"

      pbar = ProgressBar.new "trimming", raw_reads.length

      raw_reads.each do |a|
        pbar.inc
        out = File.join(out_dir, "#{File.basename(a[0])}.fasta")
        # TODO get total and trimmed
        total, trimmed = Helpers.trim_pairs a[1][0], a[1][1], out, :min_length => 70
      end

      pbar.finish
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lederhosen-0.1.2 lib/lederhosen/tasks/trim.rb
lederhosen-0.1.1 lib/lederhosen/tasks/trim.rb
lederhosen-0.1.0 lib/lederhosen/tasks/trim.rb
lederhosen-0.0.11 lib/lederhosen/tasks/trim.rb
lederhosen-0.0.10 lib/lederhosen/tasks/trim.rb
lederhosen-0.0.9 lib/lederhosen/tasks/trim.rb