Sha256: c4ed7ce9aeb2d4eb1006ec2d965b53dd565b056ddb746642d6b6cb9900fbf7e8

Contents?: true

Size: 901 Bytes

Versions: 24

Compression:

Stored size: 901 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]

      ohai "trimming #{File.dirname(raw_reads)} and saving to #{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

24 entries across 24 versions & 1 rubygems

Version Path
lederhosen-1.0.1 lib/lederhosen/tasks/trim.rb
lederhosen-1.0.0 lib/lederhosen/tasks/trim.rb
lederhosen-0.5.7 lib/lederhosen/tasks/trim.rb
lederhosen-0.5.6 lib/lederhosen/tasks/trim.rb
lederhosen-0.5.5 lib/lederhosen/tasks/trim.rb
lederhosen-0.5.4 lib/lederhosen/tasks/trim.rb
lederhosen-0.5.2 lib/lederhosen/tasks/trim.rb
lederhosen-0.5.1 lib/lederhosen/tasks/trim.rb
lederhosen-0.5.0 lib/lederhosen/tasks/trim.rb
lederhosen-0.4.0 lib/lederhosen/tasks/trim.rb
lederhosen-0.3.9 lib/lederhosen/tasks/trim.rb
lederhosen-0.3.8 lib/lederhosen/tasks/trim.rb
lederhosen-0.3.7 lib/lederhosen/tasks/trim.rb
lederhosen-0.3.6 lib/lederhosen/tasks/trim.rb
lederhosen-0.3.5 lib/lederhosen/tasks/trim.rb
lederhosen-0.3.4 lib/lederhosen/tasks/trim.rb
lederhosen-0.3.3 lib/lederhosen/tasks/trim.rb
lederhosen-0.3.2 lib/lederhosen/tasks/trim.rb
lederhosen-0.3.1 lib/lederhosen/tasks/trim.rb
lederhosen-0.3.0 lib/lederhosen/tasks/trim.rb