-
Notifications
You must be signed in to change notification settings - Fork 2
/
create_jobs.sh
67 lines (50 loc) · 1.05 KB
/
create_jobs.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
if [ -z "$1" ]
then
echo "No argument supplied"
exit 1
fi
if [ -z "$2" ]
then
echo "No argument supplied"
exit 1
fi
if [ -z "$3" ]
then
echo "No argument supplied"
exit 1
fi
if [ -z "$4" ]
then
echo "No argument supplied"
exit 1
fi
if [ -z "$5" ]
then
echo "No argument supplied"
exit 1
fi
if [ -z "$6" ]
then
echo "No argument supplied"
exit 1
fi
if [ -z "$7" ]
then
echo "No argument supplied"
exit 1
fi
ACC_FILE=$1 #File containg SRR accession numbers
BLAST_DB=$2 #Blast database
THREADS=$3 #Number of magic blast threads to use
OUT_DIR=$4 #Where to put the results when job in run
JOBS_DIR=$5 #Where to put the jobs
TEMPLATE=$6 #The grid engine submit script template
COMMENT=$7 #Short comment for file name
# clear and create jobs folder
rm -rf $JOBS_DIR/
mkdir $JOBS_DIR/
for i in $( cat $ACC_FILE ); do
cp $TEMPLATE $JOBS_DIR/job_$i.sh
echo "magicblast -db $BLAST_DB -sra $i -no_unaligned -num_threads $THREADS -out $OUT_DIR/$COMMENT.$i.sam" >> $JOBS_DIR/job_$i.sh
done