# uclust --ublast query_seqs.fasta --db database.fasta --blast6out filename --evalue E
@options[:e_val] = 10 if @options[:e_val].is_nil?
@command << "uclust --ublast #{@infile} --db #{@options[:database]} --uc #{@outfile} --evalue #{@options[:e_val]}"
- @command << "--gapopen *I" if @options.has_key? :no_gaps
execute
end
# uclust --query query.fasta --db db.fasta --uc results.uc --id 0.90 [--evalue E]
@command << "uclust --query #{@infile} --db #{@options[:database]} --uc #{@outfile} --id #{@options[:identity]}"
@command << "--evalue #{@options[:e_val]}" if @options.has_key? :e_val
- @command << "--gapopen *I" if @options.has_key? :no_gaps
execute
end
def uclust
# uclust --input seqs_sorted.fasta --uc results.uc --id 0.90
@command << "uclust --input #{@infile} --uc #{@outfile} --id #{@options[:identity]}"
- @command << "--gapopen *I" if @options.has_key? :no_gaps
execute
end
# uclust --input seqs_sorted.fasta --lib db.fasta --uc results.uc --id 0.90
@command << "uclust --input #{@infile} --lib #{@options[:database]} --uc #{@outfile} --id #{@options[:identity]}"
@command << "--lib #{@options[:database]}" if @options.has_key? :database
- @command << "--gapopen *I" if @options.has_key? :no_gaps
execute
end
- # Method to execute a command using a system() call.
- # The command is composed of bits from the @command variable.
- def execute
- @command.unshift "nice -n 19"
- @command << "> /dev/null 2>&1" unless @options[:verbose]
- command = @command.join(" ")
- system(command)
- raise "Command failed: #{command}" unless $?.success?
-
- @command = []
- end
-
# Method to parse a Uclust .uc file and for each line of data
# yield a Biopiece record.
def each
self # conventionally
end
+
+ private
+
+ # Method to execute a command using a system() call.
+ # The command is composed of bits from the @command variable.
+ def execute
+ @command.unshift "nice -n 19"
+ @command << "> /dev/null 2>&1" unless @options[:verbose]
+ command = @command.join(" ")
+ system(command)
+ raise "Command failed: #{command}" unless $?.success?
+
+ @command = []
+ end
end
ok_methods = "ublast,usearch,uclust,usearch_uclust"
casts << {:long=>'method', :short=>'m', :type=>'string', :mandatory=>true, :default=>"uclust", :allowed=>ok_methods, :disallowed=>nil}
casts << {:long=>'database', :short=>'d', :type=>'file!', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
casts << {:long=>'identity', :short=>'i', :type=>'float', :mandatory=>true, :default=>0.9, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'no_gaps', :short=>'g', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
casts << {:long=>'e_val', :short=>'e', :type=>'float', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
bp = Biopieces.new