-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto_resubmit_rev.job
executable file
·60 lines (51 loc) · 1.55 KB
/
auto_resubmit_rev.job
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
#!/bin/bash
#PBS -N approx_raider
#PBS -m abe
#PBS -M "[email protected]"
#PBS -l nodes=1:ppn=8
#PBS -l walltime=${WT}
cd ~/karro/RAIDER_eval/
L=${#seed}
weight=$(grep -o "1" <<< "$seed" | wc -l)
basedata=${data##*/}
fname=${dir}/F${freq}_L${L}_W${weight}_S${seed}
if [ -z $CP ]; then
$CP=false
fi
if [ ${type} == "chrom_sim" ]; then
./RAIDER_eval.py -R --R2 --AR --RS --nuke -r $fname -f ${freq} -s ${seed} --pwt ${WT} --cp ${CP} --stats_only chrom_sim ${data}
else
./RAIDER_eval.py -R --R2 --AR --RS --nuke -r $fname -f ${freq} -s ${seed} --pwt ${WT} --cp ${CP} --stats_only seq_files ${data}
fi
check_fname='reval.dat'
RSAVE_CHECKFILE=${fname}/${check_fname}
log_fname='reval.log'
RSAVE_LOG=${fname}/${log_fname}
echo "Output directory: ${fname}"
echo "Data: ${basedata}"
echo "Seed: ${seed}"
if [ -n $RSAVE_STEP ]; then
RSAVE_STEP=`expr $RSAVE_STEP + 1`
if [ -n "${RSAVE_CHECKFILE}" ]; then
if [ -f $RSAVE_CHECKFILE.old ]; then
mv $RSAVE_CHECKFILE.old $RSAVE_CHECKFILE.$RSAVE_STEP
fi
fi
else
RSAVE_STEP=0
fi
# save the log of this run
cp $RSAVE_LOG $RSAVE_LOG.$RSAVE_STEP
#
# Check if the job is finished and if it is not
# resubmit this file
#
if grep CONTINUE ${RSAVE_LOG}
then
ssh c-0-0 "cd ~/karro/RAIDER_eval/; qsub -v dir=$dir,seed=$seed,freq=$freq,type=$type,RSAVE_STEP=$RSAVE_STEP,WT=$WT,$CP=true auto_resubmit_rev.job; exit"
elif grep FINISHED ${RSAVE_LOG}
then
dir=${fname} ./cleanup.sh
./doSortedAnalysis.R -f ${fname}/stats.txt --formula=~+tpr --auto_out -v
fi
exit 0