From ccc6966d6d049e81eb5a18b11376895149862703 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Thu, 18 Nov 2010 12:29:12 +0000 Subject: [PATCH] added --comp switch to uclust_seq git-svn-id: http://biopieces.googlecode.com/svn/trunk@1165 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/uclust_seq | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bp_bin/uclust_seq b/bp_bin/uclust_seq index 01dc8da..0d194c4 100755 --- a/bp_bin/uclust_seq +++ b/bp_bin/uclust_seq @@ -40,6 +40,8 @@ class Uclust @outfile = outfile @options = options @command = [] + + @command << "--rev" if @options[:comp] end # Method that calls Uclusts sorting for sorting a FASTA file @@ -54,8 +56,8 @@ class Uclust def ublast # 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]}" + @options[:e_val] = 10 unless @options[:e_val] + @command << "uclust --ublast #{@infile} --db #{@options[:database]} --blast6out #{@outfile} --evalue #{@options[:e_val]}" execute end @@ -94,7 +96,7 @@ class Uclust File.open(@outfile, mode="r") do |ios| ios.each_line do |line| if line !~ /^#/ - fields = line.split("\t") + fields = line.chomp.split("\t") record[:REC_TYPE] = "UCLUST" record[:TYPE] = fields[0] @@ -137,6 +139,7 @@ casts = [] casts << {:long=>'no_sort', :short=>'n', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} 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=>'comp', :short=>'c', :type=>'flag', :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=>'e_val', :short=>'e', :type=>'float', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} -- 2.39.2