Sha256: 9f556d1bade63cbf0bb13f77c77d780f8009f92ca115902c9d6dabda90f856b1

Contents?: true

Size: 825 Bytes

Versions: 12

Compression:

Stored size: 825 Bytes

Contents

##
# QUALITY TRIMMING
#

module Lederhosen
  class CLI

    desc "trim",
         "trim reads based on quality scores"

    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]

      run "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

12 entries across 12 versions & 1 rubygems

Version Path
lederhosen-0.2.9 lib/lederhosen/tasks/trim.rb
lederhosen-0.2.8 lib/lederhosen/tasks/trim.rb
lederhosen-0.2.7 lib/lederhosen/tasks/trim.rb
lederhosen-0.2.6 lib/lederhosen/tasks/trim.rb
lederhosen-0.2.5 lib/lederhosen/tasks/trim.rb
lederhosen-0.2.4 lib/lederhosen/tasks/trim.rb
lederhosen-0.2.3 lib/lederhosen/tasks/trim.rb
lederhosen-0.2.2 lib/lederhosen/tasks/trim.rb
lederhosen-0.2.1 lib/lederhosen/tasks/trim.rb
lederhosen-0.2.0 lib/lederhosen/tasks/trim.rb
lederhosen-0.1.9 lib/lederhosen/tasks/trim.rb
lederhosen-0.1.8 lib/lederhosen/tasks/trim.rb