class RunPhyloPipeline
- LAUNCH_ANALYSIS = true
+ LAUNCH_ANALYSIS = false
HOME = "/home/czmasek/"
FORESTER_RUBY = "#{HOME}SOFTWARE/FORESTER/DEV/forester/forester/ruby/evoruby/exe/"
PFAM = "#{HOME}DATA/PFAM/PFAM270X/"
input_files = Dir.entries(".").select { |f| !File.directory?( f ) && f.downcase.end_with?( ".fasta" ) }
+ input_files.sort!
+
puts "Input files:"
input_files.each do | input |
puts input
unless File.exist? input
error "expected to already exist: " + input
end
- puts "a. identifier normalization already done:" + input
+ puts "a. identifier normalization already done: " + input
end
else
error "illegal name: " + input
end
puts
-
- dsx_output = "#{hmm_name}/#{hmm_name}__#{hmm_name}__ee#{e_value_exp.to_s}_#{length}"
- unless File.exist? d2f_output
+ dsx_output_base = "#{hmm_name}__#{hmm_name}__ee#{e_value_exp.to_s}_#{length}"
+ dsx_output = hmm_name +"/" + dsx_output_base
+ unless File.exist? dsx_output + ".fasta"
puts "e. dsx:"
cmd = "#{DSX} -d -e=1e-#{e_value_exp.to_s} -l=#{length} #{hmm_name} #{hmmscan_output} #{input} #{dsx_output}"
run_command( cmd )
else
- puts "e. dsx output already exists: " + dsx_output
+ puts "e. dsx output already exists: " + dsx_output + ".fasta"
end
puts
Dir.mkdir( msa_100_dir )
end
- FileUtils.cp "#{dsx_output}.fasta", "#{msa_dir}/#{dsx_output}"
- FileUtils.cp "#{dsx_output}.fasta", "#{msa_100_dir}/#{dsx_output}"
+ run_1 = false
+ run_100 = false
+
+ unless File.exist? "#{msa_dir}/#{dsx_output_base}"
+ run_1 = true
+ FileUtils.cp "#{dsx_output}.fasta", "#{msa_dir}/#{dsx_output_base}"
+ end
+
+ unless File.exist? "#{msa_100_dir}/#{dsx_output_base}"
+ run_100 = true
+ FileUtils.cp "#{dsx_output}.fasta", "#{msa_100_dir}/#{dsx_output_base}"
+ end
if File.exist?( TEMPLATE_FILE )
- FileUtils.cp TEMPLATE_FILE, msa_dir
- FileUtils.cp TEMPLATE_FILE, msa_100_dir
+ if run_1
+ FileUtils.cp TEMPLATE_FILE, msa_dir
+ end
+ if run_100
+ FileUtils.cp TEMPLATE_FILE, msa_100_dir
+ end
- if LAUNCH_ANALYSIS
+ if LAUNCH_ANALYSIS && ( run_1 || run_100 )
puts "f. analysis:"
- Dir.chdir msa_dir
- run_command "#{PF} -b=1 -s"
- Dir.chdir "../.."
- Dir.chdir msa_100_dir
- run_command "#{PF} -b=100 -s"
- Dir.chdir "../.."
+ if run_1
+ Dir.chdir msa_dir
+ run_command "#{PF} -b=1 -s"
+ Dir.chdir "../.."
+ end
+ if run_100
+ Dir.chdir msa_100_dir
+ run_command "#{PF} -b=100 -s"
+ Dir.chdir "../.."
+ end
puts
end
end