@outfile = outfile
@options = options
@command = []
+
+ raise UsearchError, %{Empty input file -> "#{@infile}"} if File.size(@infile) == 0
end
# Method that calls Usearch sorting for sorting a FASTA file
def usearch
@command << "usearch --query #{@infile} --db #{@options[:database]} --userout #{@outfile}"
@command << "--userfields target+tloz+thiz+query+bits+strand"
- @command << "--id #{@options[:identity]}" if @options.has_key? :identity
- @command << "--evalue #{@options[:e_val]}" if @options.has_key? :e_val
+ @command << "--id #{@options[:identity]}" if @options[:identity]
+ @command << "--evalue #{@options[:e_val]}" if @options[:e_val]
@command << "--rev"
execute
end
+ # Method to execute uchime chimera detection.
+ def uchime
+ @command << "usearch --uchime #{@infile} --db #{@options[:database]} --uchimeout #{@outfile}"
+
+ execute
+ end
+
# Method to execute ustar alignment.
def ustar
command = %Q{grep "^[SH]" #{@outfile} > #{@outfile}.sub}