From c9c5f7a6a67960bad7836c30293bc3d5389c6c0b Mon Sep 17 00:00:00 2001 From: martinahansen Date: Thu, 23 Sep 2010 11:46:43 +0000 Subject: [PATCH] cleanup of uclust_seq git-svn-id: http://biopieces.googlecode.com/svn/trunk@1102 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/uclust_seq | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/bp_bin/uclust_seq b/bp_bin/uclust_seq index 36e40ad..01dc8da 100755 --- a/bp_bin/uclust_seq +++ b/bp_bin/uclust_seq @@ -56,7 +56,6 @@ class Uclust # 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 @@ -66,7 +65,6 @@ class Uclust # 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 @@ -75,7 +73,6 @@ class Uclust 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 @@ -85,23 +82,10 @@ class Uclust # 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 @@ -131,6 +115,20 @@ class Uclust 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" @@ -140,7 +138,6 @@ casts << {:long=>'no_sort', :short=>'n', :type=>'flag', :mandatory=>false, :d 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 -- 2.39.2