forked from SamStudio8/asklepian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
go_genome.sh
executable file
·44 lines (37 loc) · 1.32 KB
/
go_genome.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
#!/usr/bin/bash
source /cephfs/covid/software/eagle-owl/scripts/hootstrap.sh
source "$EAGLEOWL_CONF/common.sh"
source "$EAGLEOWL_CONF/asklepian/conf.sh"
# Activate env
eval "$(conda shell.bash hook)"
conda activate $CONDA_ASKLEPIAN
while read var; do
[ -z "${!var}" ] && { echo 'Global Asklepian variable '$var' is empty or not set. Environment likely uninitialised. Aborting go_genome.'; exit 64; }
done << EOF
AZURE_SAS
AZURE_END
ASKLEPIAN_DIR
WUHAN_FP
EOF
set -euo pipefail
WORKDIR=$1
OUTDIR=$2
TABLE_BASENAME=$3
SECONDS=0
# Make and push genome table
if [ ! -f "$OUTDIR/genome_table2.ok" ]; then
python $ASKLEPIAN_DIR/make_genomes_table_v2.py --fasta $WORKDIR/naive_msa.fasta --meta $WORKDIR/consensus.metrics.tsv --best-ls $WORKDIR/best_refs.paired.ls | gzip --fast > $OUTDIR/${TABLE_BASENAME}.csv.gz
touch $OUTDIR/genome_table2.ok
else
echo "[NOTE] Skipping make_genomes_table (v2)"
fi
python -c "import datetime; print('make-genome', str(datetime.timedelta(seconds=$SECONDS)))"
SECONDS=0
if [ ! -f "$OUTDIR/genome_upload2.ok" ]; then
python $ASKLEPIAN_DIR/upload_azure.py -c genomics -f $OUTDIR/${TABLE_BASENAME}.csv.gz
touch $OUTDIR/genome_upload2.ok
else
echo "[NOTE] Skipping genome upload (v2)"
fi
python -c "import datetime; print('push-genome', str(datetime.timedelta(seconds=$SECONDS)))"
SECONDS=0