- def run(comp = nil, type = nil, max_hit = nil, max_mis = nil, verbose = nil)
- args = []
- args << "scan_for_matches"
- args << "-c" if comp
- args << "-p" if type == 'protein'
- args << "-n #{max_mis}" if max_mis
- args << "-m #{max_hit}" if max_hit
- args << @pat_file
- args << "< #{@in_file}"
- args << "> #{@out_file}"
- command = args.join(" ")
- $stderr.puts command if verbose
- system(command)
- raise "Command failed: #{command}" unless $?.success?
+ def run(options)
+ @patterns.each_with_index do |pattern, i|
+ args = []
+ args << "scan_for_matches"
+ args << "-c" if options[:comp]
+ args << "-p" if options[:seq_type] == :protein
+ args << "-o 1" if options[:overlap]
+ args << "-n #{options[:max_misses]}" if options[:max_misses]
+ args << "-m #{options[:max_hits]}" if options[:max_hits]
+ args << File.join(@tmp_dir, "#{i}.pat")
+ args << "< #{@in_file}"
+ args << "> " + File.join(@tmp_dir, "#{i}.out")
+ command = args.join(" ")
+ $stderr.puts command if options[:verbose]
+ system(command)
+ raise "Command failed: #{command}" unless $?.success?
+ end