]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/assemble_seq_idba
added assemble_seq_velvet draft biopiece
[biopieces.git] / bp_bin / assemble_seq_idba
index f3a29afe7178eb6099b281b32b4f7e4a32aa4593..c1d72a23f778a5aa7d4c54f1642ad0fccba2f294 100755 (executable)
@@ -32,16 +32,16 @@ require 'biopieces'
 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
 
@@ -49,7 +49,7 @@ options = bp.parse(ARGV, casts)
 
 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|
@@ -58,7 +58,7 @@ Fasta.open(file_fasta, mode="w") do |fasta_io|
 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"
@@ -66,8 +66,8 @@ unless File.size(file_fasta) == 0
   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]}"