]> git.donarmstrong.com Git - biopieces.git/commitdiff
added --comp switch to uclust_seq
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 18 Nov 2010 12:29:12 +0000 (12:29 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 18 Nov 2010 12:29:12 +0000 (12:29 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1165 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/uclust_seq

index 01dc8da0b0860583433826aaf102cd3a43fa1ddc..0d194c4e7d6b2fc25984c8dbc8a85b43faede327 100755 (executable)
@@ -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}