#!/usr/bin/perl # #########1#########2#########3#########4#########5#########6#########7######## # # qsub_separate_probes.pl # # Program generates a bash script to run with Sun Grid Engine. # # Runs 'separate_all_probes.pl' against all output files # from the previous step in your current directory having names like : # # chr##.xml.#.valid # # Use of Sun Grid Engine allows multiple jobs to be generated # by this program and SGE queues them and executes each as # machine resources are available. # # Command-line Parameters : # # none # # Before running this program you must 'cd' into directory where # your mega_blast output files are located (see README for Build 2). # # syntax : [path]/qsub_separate_probes.pl # #########1#########2#########3#########4#########5#########6#########7######## # # First check that executables directory is defined. # use Env qw(UPROBE_BIN_DIR); if (! (-x "$UPROBE_BIN_DIR/separate_all_probes.pl") ) { my $ErrMsg = "Error : Did not find 'separate_all_probes.pl'\n "; my $ErrMsg = $ErrMsg." Did you forget to define UPROBE_BIN_DIR ? \n"; die $ErrMsg."\n"; } # # open (IN,"ls chr*.xml|") || die "Hey - You dont have any probe xml files for me !"; while () { chop; ($chromosome) = ($_ =~ m/chr(.+).xml/); $file = $_; $stdout = "$file.separate_output"; $jobname = "Split_$chromosome"; $bash_script = "chr".$chromosome."_separate.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 yourEmailId\@your.email.domain \n"; print OUT "# \n"; print OUT "$UPROBE_BIN_DIR/separate_all_probes.pl -chr $chromosome\n"; close OUT; system("qsub $bash_script"); } ############################################################################## # Start Description # Run separate_all_probes.pl once for each chromosome represented in XML input files. # End Description ##############################################################################