#!/usr/bin/perl # Description: # # Program to generate a command file for use # with the shell or Sun Grid Engine. In this case # it is invoking find_bad_mega_fasta.pl, which # is used to get the megablast output for all probes # in a fasta formatted file file, except the probes that core dump megablast. # 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. # # Usage: open (IN,"ls chr*.xml.* |") || die "Hey - You dont have any Bad fractional files for me !"; while () { chop; print "Creating file for $_ \n"; ($chromosome, $fractional) = ($_ =~ m/chr(.+).xml.(.+)/); $file = $_; $base_name = "find_".$chromosome."_".$fractional; $stdout = "$base_name.out"; my $jobname = $base_name; my $outname= "$base_name.bash"; open(OUT,"> $outname"); 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/find_bad_mega_fasta.pl -f $file \n"; close OUT; system("qsub $outname"); }