forked from PoonLab/covizu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
backup-update.sh
39 lines (27 loc) · 1.27 KB
/
backup-update.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
#bash script to backup database, run ChunkyBot & update local flat file
#Copy database
cp data/gsaid.db "data/backup/$(date +"%Y_%m_%d").gsaid.db"
#Run updater script
python3 scripts/ChunkyBot.py -db "data/backup/$(date +"%Y_%m_%d").gsaid.db" >> debug/Chunkybot.log
#Migrate missing entries
python3 scripts/db_utils.py --targetdb "data/backup/$(date +"%Y_%m_%d").gsaid.db" >> debug/Migrate.log
#Delete old database files
cd data/backup
rm -v !("$(date +"%Y_%m_%d").gsaid.db")
# screen for non-human and low-coverage samples -> gisaid-filtered.fa
python3 scripts/filtering.py
# Run pangolin lineage assingment & upload to database
pangolin data/gisaid-filtered.fa -o data --outfile data/gisaid-filtered.pango.csv
python3 scripts/db_utils --lineagecsv data/gisaid-filtered.pango.csv
# calculate TN93 distances
tn93 -t 0.00005 -o data/gisaid.tn93.csv data/gisaid-filtered.fa
# cluster genomes into variants -> variants.csv, variants.fa
python3 scripts/variants.py
# calculate TN93 distances for clusters and output as HyPhy matrix
tn93 -o data/variants.tn93.txt -f hyphy data/variants.fa
# convert HyPhy matrix format to CSV
sed -i 's/[{}]//g' data/variants.tn93.txt
# hierarchical clustering -> data/clusters.json
Rscript scripts/hclust.R
# run FastTree and TreeTime
python3 scripts/treetime.py