require 'fasta'
casts = []
-casts << {:long=>'name', :short=>'n', :type=>'string', :mandatory=>true, :default=>nil, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'directory', :short=>'d', :type=>'dir', :mandatory=>true, :default=>nil, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'scaffold', :short=>'s', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'k_value_min', :short=>'k', :type=>'uint', :mandatory=>false, :default=>25, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'k_value_max', :short=>'K', :type=>'uint', :mandatory=>false, :default=>50, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'count_min', :short=>'c', :type=>'uint', :mandatory=>false, :default=>2, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'cover', :short=>'C', :type=>'uint', :mandatory=>false, :default=>0, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'pairs_min', :short=>'p', :type=>'uint', :mandatory=>false, :default=>5, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'prefix_len', :short=>'P', :type=>'uint', :mandatory=>false, :default=>3, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'clean', :short=>'x', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'name', :short=>'n', :type=>'string', :mandatory=>true, :default=>nil, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'directory', :short=>'d', :type=>'dir', :mandatory=>true, :default=>nil, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'scaffold', :short=>'s', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'kmer_min', :short=>'k', :type=>'uint', :mandatory=>false, :default=>25, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'kmer_max', :short=>'K', :type=>'uint', :mandatory=>false, :default=>50, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'count_min', :short=>'c', :type=>'uint', :mandatory=>false, :default=>2, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'cover', :short=>'C', :type=>'uint', :mandatory=>false, :default=>0, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'pairs_min', :short=>'p', :type=>'uint', :mandatory=>false, :default=>5, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'prefix_len', :short=>'P', :type=>'uint', :mandatory=>false, :default=>3, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'clean', :short=>'x', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
bp = Biopieces.new
Dir.mkdir(options[:directory]) unless Dir.exists?(options[:directory])
-file_fasta = [options[:directory], options[:name] ].join(File::SEPARATOR) + ".fna"
+file_fasta = [options[:directory], options[:name]].join(File::SEPARATOR) + ".fna"
Fasta.open(file_fasta, mode="w") do |fasta_io|
bp.each_record do |record|
end
unless File.size(file_fasta) == 0
- output = [options[:directory], options[:name] ].join(File::SEPARATOR)
+ output = [options[:directory], options[:name]].join(File::SEPARATOR)
commands = []
commands << "nice -n 19"
commands << "--read #{file_fasta}"
commands << "--output #{output}"
commands << "--scaffold" if options[:scaffold]
- commands << "--mink #{options[:k_value_min]}"
- commands << "--maxk #{options[:k_value_max]}"
+ commands << "--mink #{options[:kmer_min]}"
+ commands << "--maxk #{options[:kmer_max]}"
commands << "--minCount #{options[:count_min]}"
commands << "--cover #{options[:cover]}"
commands << "--minPairs #{options[:pairs_min]}"