Sha256: a02f8a1e130b1ecb9d5d77f97208b027208bfdd69f50a627dc0f7e1d77738b9a

Contents?: true

Size: 1.44 KB

Versions: 21

Compression:

Stored size: 1.44 KB

Contents

##
# FINALLY, CLUSTER!
#

module Lederhosen
  class CLI

    desc "cluster",
         "cluster a fasta file using UCLUST"

    method_option :input,       :type => :string,  :required => true
    method_option :output,      :type => :string,  :required => true
    method_option :identity,    :type => :numeric, :required => true
    method_option :stepwords,   :type => :numeric, :default  => 8
    method_option :wordlen,     :type => :numeric, :default  => 8
    method_option :maxaccepts,  :type => :numeric, :default  => 1
    method_option :maxrejects,  :type => :numeric, :default  => 8
    method_option :lib,         :type => :string

    def cluster
      identity   = options[:identity]
      output     = options[:output]
      input      = options[:input]
      stepwords  = options[:stepwords]
      maxaccepts = options[:maxaccepts]
      maxrejects = options[:maxrejects]
      wordlen    = options[:wordlen]
      lib        = options[:lib]

      ohai "clustering #{input}, saving to #{output}"

      options.each_pair do |key, value|
        ohai "#{key} = #{value}"
      end

      cmd = [
        'uclust',
        "--input #{input}",
        "--uc #{output}",
        "--id #{identity}",
        "--stepwords #{stepwords}",
        "--maxaccepts #{maxaccepts}",
        "--maxrejects #{maxrejects}",
        "--w #{wordlen}"
      ]

      cmd << "--lib #{lib}" unless lib.nil?

      cmd = cmd.join(' ')

      @shell.mute { run cmd }
    end

  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
lederhosen-0.5.6 lib/lederhosen/tasks/cluster.rb
lederhosen-0.5.5 lib/lederhosen/tasks/cluster.rb
lederhosen-0.5.4 lib/lederhosen/tasks/cluster.rb
lederhosen-0.5.2 lib/lederhosen/tasks/cluster.rb
lederhosen-0.5.1 lib/lederhosen/tasks/cluster.rb
lederhosen-0.5.0 lib/lederhosen/tasks/cluster.rb
lederhosen-0.4.0 lib/lederhosen/tasks/cluster.rb
lederhosen-0.3.9 lib/lederhosen/tasks/cluster.rb
lederhosen-0.3.8 lib/lederhosen/tasks/cluster.rb
lederhosen-0.3.7 lib/lederhosen/tasks/cluster.rb
lederhosen-0.3.6 lib/lederhosen/tasks/cluster.rb
lederhosen-0.3.5 lib/lederhosen/tasks/cluster.rb
lederhosen-0.3.4 lib/lederhosen/tasks/cluster.rb
lederhosen-0.3.3 lib/lederhosen/tasks/cluster.rb
lederhosen-0.3.2 lib/lederhosen/tasks/cluster.rb
lederhosen-0.3.1 lib/lederhosen/tasks/cluster.rb
lederhosen-0.3.0 lib/lederhosen/tasks/cluster.rb
lederhosen-0.2.13 lib/lederhosen/tasks/cluster.rb
lederhosen-0.2.12 lib/lederhosen/tasks/cluster.rb
lederhosen-0.2.11 lib/lederhosen/tasks/cluster.rb