-
Notifications
You must be signed in to change notification settings - Fork 0
/
do_harvest.sh
executable file
·73 lines (63 loc) · 2.79 KB
/
do_harvest.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
68
69
70
71
72
73
#!/bin/bash
## 18000 = 5 hours
timeCutoff=$(( 60 * 60 * 4 ))
#timeCutoff=$(( 116770 + 60 ))
n=0
for f in /home/solexa/[0-9][0-9][0-9][0-9][0-9][0-9]_*_[0-9][0-9][0-9][0-9]_*
do
RTAfile="${f}/RTAComplete.txt"
if [ -f "$RTAfile" ]; then
modsecs=$(date --utc --reference=$RTAfile +%s)
nowsecs=$(date +%s)
RTA_time_past=$(($nowsecs-$modsecs))
else
RTA_time_past=$timeCutoff
fi
# echo $f
# echo $RTA_time_past
run=${f##*/}
flowcell=${run/*_/}
if [ $RTA_time_past -lt $timeCutoff ]; then
echo $run
if [[ ! $run =~ "_NS500" ]]; then
# continue
fn=`ls -l /home/analysis/Solexa/sequence/*${flowcell}* | wc -l | cut -f1`
if [ "$fn" == 0 ]; then
#qsub -cwd -pe smp 8 -l arch=lx* -l io=0.1 -N "PRO.${flowcell/000000000-/}" -q lowp.q /home/zhujack/bin/harvest.sh $f
((n++))
echo "To be processed: $run"
mail -r [email protected] -s "New non-NextSeq run to be processed: $run" [email protected],[email protected] <<< ""
fi
else
echo $run
### harvest
cd /home/solexa
tarFile=`ls -l /home/analysis/Solexa/sequence/X_X_${flowcell}* | wc -l`
if [ $tarFile -eq 0 ]; then
# qsub -cwd -pe smp 8 -l arch=lx* -l io=0.05 -N "harvest.pl" -b y perl -I ~/bin ~/bin/harvest.pl $run
perl -I ~/bin ~/bin/harvest.pl $run
mail -r [email protected] -s "Harvest started: $run" [email protected] <<< ""
fi
tarFile=`ls -l /home/analysis/Solexa/sequence/X_X_${flowcell}* | wc -l`
if [ $tarFile -ne 0 ]; then
mail -r [email protected] -s "Harvest done: $run" [email protected] <<< ""
## update solDB_flowCellBasecallLane
echo "Updated flowCellBasecallLane on $(date +%c)" >> /home/zhujack/log/solDB_flowCellBasecallLane_update.log
mysql -h sartre.nci.nih.gov -u zxxxx -pxxxx soldb < /home/zhujack/bin/solDB_flowCellBasecallLane_update.sql >> /home/zhujack/log/solDB_flowCellBasecallLane_update.log 2>&1
cd /home/zhujack/temp
## cron problem
/import/cluster/sge6_2u5/default/common/settings.sh
export SGE_ROOT=/import/cluster/sge6_2u5
/import/cluster/sge6_2u5/bin/lx24-amd64/qsub -cwd -pe smp 24-32 -m e -l arch=lx* -l io=0.01 -N "bcl2fq.${flowcell}" -q [email protected],[email protected],[email protected],[email protected] ~/bin/nextseq_bcl2fqD_new.sh $f
else
mail -r [email protected] -s "Harvest failed: $run" [email protected] <<< ""
fi
((n++))
fi
fi
done
echo "`date`: Total runs to be processed: $n"
# for f in /home/solexa/[0-9][0-9][0-9][0-9][0-9][0-9]_*_[0-9][0-9][0-9][0-9]_*
# do
# echo $f;
# done