-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathphyloSI-RakaiAgeGender-run_phyloflows-hpc.sh
executable file
·74 lines (54 loc) · 2.12 KB
/
phyloSI-RakaiAgeGender-run_phyloflows-hpc.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
74
#!/bin/sh
STAN_MODEL="gp_230602"
JOBNAME="central"
INDIR="/rds/general/user/mm3218/home/git/phyloSI-RakaiAgeGender"
OUTDIR="/rds/general/user/mm3218/home/projects/2021/phyloSI-RakaiAgeGender"
mkdir $OUTDIR
cat > $OUTDIR/bash_$STAN_MODEL-$JOBNAME.pbs <<EOF
#!/bin/sh
#PBS -l walltime=72:00:00
#PBS -l select=1:ncpus=10:ompthreads=1:mem=240gb
#PBS -j oe
module load anaconda3/personal
source activate phyloSI-RakaiAgeGender
JOB_TEMP=\${EPHEMERAL}/\${PBS_JOBID}
mkdir -p \$JOB_TEMP
cd \$JOB_TEMP
PWD=\$(pwd)
INDIR=$INDIR
OUTDIR=$OUTDIR
STAN_MODEL=$STAN_MODEL
JOBNAME=$JOBNAME
# main directory
CWD=\$PWD/\$STAN_MODEL-\$JOBNAME
mkdir \$CWD
mkdir \$CWD/figures
Rscript \$INDIR/src/transmission_flows/run_stan.R -indir \$INDIR -outdir \$CWD -stan_model \$STAN_MODEL -jobname \$JOBNAME
cp -R --no-preserve=mode,ownership \$PWD/* \$OUTDIR
cd \$OUTDIR
qsub bash_$STAN_MODEL-$JOBNAME-postprocessing.pbs
EOF
cat > $OUTDIR/bash_$STAN_MODEL-$JOBNAME-postprocessing.pbs <<EOF
#!/bin/sh
#PBS -l walltime=24:00:00
#PBS -l select=1:ncpus=10:ompthreads=1:mem=480gb
#PBS -j oe
module load anaconda3/personal
source activate phyloSI-RakaiAgeGender
INDIR=$INDIR
OUTDIR=$OUTDIR
STAN_MODEL=$STAN_MODEL
JOBNAME=$JOBNAME
# main directory
CWD=\$OUTDIR/\$STAN_MODEL-\$JOBNAME
# directories for figure and table
mkdir \$CWD/figures
mkdir \$CWD/tables
Rscript \$INDIR/src/transmission_flows/postprocessing_assess_mixing.R -indir \$INDIR -outdir \$CWD -stan_model \$STAN_MODEL -jobname \$JOBNAME
Rscript \$INDIR/src/transmission_flows/postprocessing_figures.R -indir \$INDIR -outdir \$CWD -stan_model \$STAN_MODEL -jobname \$JOBNAME
Rscript \$INDIR/src/transmission_flows/postprocessing_figure_time_trends_sources.R -indir \$INDIR -outdir \$CWD -stan_model \$STAN_MODEL -jobname \$JOBNAME
Rscript \$INDIR/src/transmission_flows/postprocessing_figure_contribution_sexual_contact.R -indir \$INDIR -outdir \$CWD -stan_model \$STAN_MODEL -jobname \$JOBNAME
Rscript \$INDIR/src/transmission_flows/postprocessing_figure_counterfactual.R -indir \$INDIR -outdir \$CWD -stan_model \$STAN_MODEL -jobname \$JOBNAME
EOF
cd $OUTDIR
qsub bash_$STAN_MODEL-$JOBNAME.pbs