#!/usr/bin/perl # # Program to generate a command file for use # with the shell or Sun Grid Engine. In this case # we want to Blast all of the Fasta files (extension # of .fa ) in the current directory. Since we are # going to let SGE/qsub handle it we can submit them # all it once and let them queue up until all are done. # This could be used to kick off the blast of thousands # of files # open (IN,"ls chr*.xml|") || die "Hey - You dont have any MegaBlast output files for me !"; while () { chop; ($chromosome) = ($_ =~ m/chr(.+).xml/); $file = $_; $stdout = "$file.seperate_output"; $jobname = "Split_$chromosome"; $bash_script = "chr".$chromosome."_seperate.bash"; print "Creating $bash_script\n"; open(OUT,"> $bash_script"); print OUT "#!/bin/bash \n"; print OUT "#\$ -N $jobname \n"; print OUT "#\$ -S /bin/bash \n"; print OUT "#\$ -o $stdout \n"; print OUT "#\$ -cwd \n"; print OUT "#\$ -m e \n"; print OUT "#\$ -M bcarlson\@genetics.emory.edu \n"; print OUT "# \n"; print OUT "/home/bcarlson/bin/seperate_all_probes.pl -chr $chromosome\n"; close OUT; system("qsub $bash_script"); }