View Single Post
Old 06-27-2012, 10:15 AM   #1
milesgr
Member
 
Location: NJ

Join Date: Jun 2010
Posts: 34
Default Qsub bwa pipeline...

This may seem like a relatively easy question, but here goes:

I am trying to create a relatively simple shell script that sits in a parent folder, goes through all subfolders, grabs all files with the extension .fq, and aligns them using BWA aln. The caveat is that I need to use qsub to do this or I will make the admins very unhappy

My initial script was something along the lines of the following:

result=(`find . -name "*.fq" -type f`)

for i1 in ${result[@]}
do

qsub -q queue_name -l nodes=1pn=8 -V test.sh

done

It should be noted that the first portion simply gets the filenames (and paths) and the second calls test.sh, which is shown below (note that the first two variable paths are truncated for forum purposes):

REFERENCE=/refpath
BWA_HOME=/bwapath

result=(`find . -name "*.fq" -type f`)

for i1 in ${result[@]}
do

$BWA_HOME/bwa aln -t 8 $REFERENCE $i1 > $i1".sai"

done

I am simply trying to get BWA to run using the $1i filename and $i1.sai as the output name. The reason I ran the for loop here and in the initial script is because there seems to be a problem holding on to $i1. If I run the bottom script as a standalone script, BWA begins running on the first file. The key is I'm not certain how to get it to run qsub X times (where X is the number of .fq files), each time is with a different file/output. Any help would be greatly appreciated. Thanks!
milesgr is offline   Reply With Quote