From d5a8efe4d822a139b452bd35e2353aaccd84ac4c Mon Sep 17 00:00:00 2001 From: martinahansen Date: Wed, 9 Jan 2013 09:15:41 +0000 Subject: [PATCH] set cutoff to auto in velvet git-svn-id: http://biopieces.googlecode.com/svn/trunk@2064 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/assemble_seq_velvet | 41 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/bp_bin/assemble_seq_velvet b/bp_bin/assemble_seq_velvet index 98c0ba4..90cf759 100755 --- a/bp_bin/assemble_seq_velvet +++ b/bp_bin/assemble_seq_velvet @@ -63,25 +63,23 @@ class Velvet end end - def run_velvetg(cov_cutoffs, exp_cov) + def run_velvetg(cov_cutoff, exp_cov) Dir.glob("#{@directory}/Kmer_*").each do |dir_velveth| files_velveth = Dir.glob("#{dir_velveth}/*") - cov_cutoffs.each do |cov_cutoff| - dir_velvetg = File.join(dir_velveth, "Cov_cutoff_#{cov_cutoff}") + dir_velvetg = File.join(dir_velveth, "Cov_cutoff_#{cov_cutoff}") - Dir.mkdir(dir_velvetg) - FileUtils.cp_r files_velveth, dir_velvetg - - commands = [] - commands << "velvetg" - commands << dir_velvetg - commands << "-cov_cutoff #{cov_cutoff}" - commands << "-exp_cov #{exp_cov}" - commands << "-clean yes" + Dir.mkdir(dir_velvetg) + FileUtils.cp_r files_velveth, dir_velvetg + + commands = [] + commands << "velvetg" + commands << dir_velvetg + commands << "-cov_cutoff #{cov_cutoff}" + commands << "-exp_cov #{exp_cov}" + commands << "-clean yes" - execute(commands) - end + execute(commands) end end @@ -139,16 +137,15 @@ class Velvet end types = 'short,shortPaired,long,longPaired' -cov_cutoffs = "2,4,8,16" casts = [] -casts << {:long=>'directory', :short=>'d', :type=>'dir', :mandatory=>true, :default=>nil, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'type', :short=>'t', :type=>'string', :mandatory=>true, :default=>'short', :allowed=>types, :disallowed=>nil} -casts << {:long=>'kmer_min', :short=>'k', :type=>'uint', :mandatory=>true, :default=>19, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'kmer_max', :short=>'K', :type=>'uint', :mandatory=>true, :default=>31, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'cov_cutoff', :short=>'c', :type=>'list', :mandatory=>true, :default=>cov_cutoffs, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'exp_cov', :short=>'e', :type=>'float', :mandatory=>true, :default=>'auto', :allowed=>nil, :disallowed=>nil} -casts << {:long=>'clean', :short=>'X', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'directory', :short=>'d', :type=>'dir', :mandatory=>true, :default=>nil, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'type', :short=>'t', :type=>'string', :mandatory=>true, :default=>'short', :allowed=>types, :disallowed=>nil} +casts << {:long=>'kmer_min', :short=>'k', :type=>'uint', :mandatory=>true, :default=>19, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'kmer_max', :short=>'K', :type=>'uint', :mandatory=>true, :default=>31, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'cov_cutoff', :short=>'c', :type=>'float', :mandatory=>true, :default=>'auto', :allowed=>nil, :disallowed=>nil} +casts << {:long=>'exp_cov', :short=>'e', :type=>'float', :mandatory=>true, :default=>'auto', :allowed=>nil, :disallowed=>nil} +casts << {:long=>'clean', :short=>'X', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} options = Biopieces.options_parse(ARGV, casts) -- 2.39.2