forked from ISUgenomics/common_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJobR_BLAST.sh
executable file
·42 lines (41 loc) · 905 Bytes
/
JobR_BLAST.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Script to generate PBS sub files reading a command file
# 01/26/2015
# Arun Seetharam <[email protected]>
LINES="$1"
INFILE="$2"
function readlines () {
local N="$1"
local line
local rc="1"
for i in $(seq 1 $N); do
read line
if [ $? -eq 0 ]; then
echo $line
rc="0"
else
break
fi
done
return $rc
}
num=1
while chunk=$(readlines ${LINES}); do
cat <<JOBHEAD > ${INFILE%%.*}_${num}.sub
#!/bin/bash
#PBS -l nodes=1:ppn=16
#PBS -l walltime=96:00:00
#PBS -N ${INFILE%%.*}_${num}
#PBS -o \${PBS_JOBNAME}.o\${PBS_JOBID} -e \${PBS_JOBNAME}.e\${PBS_JOBID}
#PBS -m ae -M [email protected]
cd \$PBS_O_WORKDIR
ulimit -s unlimited
chmod g+rw \${PBS_JOBNAME}.[eo]\${PBS_JOBID}
module use /shared/software/GIF/modules/
module load parallel
module load gatk
JOBHEAD
echo ${chunk} >> ${INFILE%%.*}_${num}.sub
echo -e "qstat -f \"\$PBS_JOBID\" | head" >> ${INFILE%%.*}_${num}.sub
((num++))
done<"${INFILE}"