#!/usr/bin/perl # #########1#########2#########3#########4#########5#########6#########7######## # qsub_generate_probes.pl # # Program generates a bash script to run with Sun Grid Engine. # # Designs probes using multi_soop.pl # # 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 : # # (1) executables directory - where 'multi_soop.pl' is located # e.g. /home/yourId/sample/bin # # # Before running this program you must 'cd' into directory where # your .maf file and .cfg file are located (see README for Build 2). # This directory will also contain all other data files produced # during later steps of probe generation process. # # syntax : qsub_generate_probes.pl /yourExecutablesDirectory # #########1#########2#########3#########4#########5#########6#########7######## if (@ARGV != 1) { die "usage: $0 executableDirectory \n"; } my $exeDir=$ARGV[0]; # open (IN,"ls *.maf |") || die "Hey - You dont have any MAF files for me !"; while () { chop; print "Creating file for $_ \n"; ($chromosome) = ($_ =~ m/chr(.+).maf/); $maf_file = $_; $probefile = "chr".$chromosome.".xml"; $stdout = "chr".$chromosome.".out"; my $jobname ="Job_Chromosome_".$chromosome; my $outname= "chr".$chromosome. ".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 be \n"; # print OUT "#\$ -M yourEmailId\@your.email.domain \n"; print OUT "# \n"; # # print OUT "$exeDir/multi_soop.pl $maf_file -scoring_file score.cfg -species human -probefile $probefile -verbose\n"; close OUT; system("qsub $outname"); } ############################################################################## # Start Description # Run multi_soop.pl once for each input file in current directory. # End Description ##############################################################################