-
Notifications
You must be signed in to change notification settings - Fork 0
/
go.sh
executable file
·66 lines (46 loc) · 1.54 KB
/
go.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
#!/usr/bin/bash
source /cephfs/covid/software/eagle-owl/scripts/hootstrap.sh
source "$EAGLEOWL_CONF/common.sh"
source "$EAGLEOWL_CONF/status_generator/conf.sh"
eval "$(conda shell.bash hook)"
conda activate $CONDA_STATUS_GEN
set -uo pipefail
rm -rf dat
mkdir dat
rm -rf build
mkdir build
mkdir build/graphs
mkdir build/_includes
DATE=`date -d $ELAN_DATE +'%Y-%m-%d'`
echo $DATE > build/report_date
# Load dat
scp $PAG_TSV dat/pags.tsv
# F1
# To use source override commandArgs, e.g. commandArgs <- function(...) c("dat/pags.tsv", "2021-04-07"); source(...)
Rscript f1-total_genomes/fig1.R dat/pags.tsv $DATE
read TOTAL_PAGS TODAY_PAGS < <(head dat/fig1.dat)
cp dat/fig1b.png build/graphs/fig1b.png
cp dat/fig1c.png build/graphs/fig1c.png
python f1-total_genomes/fig1.py $TOTAL_PAGS
# F2
./make_lamps.sh
Rscript f2-lamps/fig2.R dat/lamps.tsv $DATE
cp dat/fig2.png build/graphs/fig2.png
# S1
wget -O dat/case_counts.ukgov_latest.csv 'https://api.coronavirus.data.gov.uk/v2/data?areaType=overview&metric=cumCasesBySpecimenDate&metric=newCasesBySpecimenDate&format=csv'
ret=$?
if [ $ret -eq 0 ]; then
Rscript s1/fig1.R dat/pags.tsv $DATE s1/annotations.tsv dat/case_counts.ukgov_latest.csv
cp dat/s1.png build/graphs/s1.png
fi
# Build
## Index
sed "s,PLACEHOLDER_DATE,$DATE,g" template > build/index.md
## Sidebar data
cat summary_template | \
sed "s,PLACEHOLDER_GENOMES_TODAY,$TODAY_PAGS,g" | \
sed "s,PLACEHOLDER_GENOMES_TOTAL,$TOTAL_PAGS,g" > \
build/_includes/summary.html
mkdir build/assets
cp -r assets/public/* build/assets
./deploy.sh