-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvisualize.sh
executable file
·67 lines (56 loc) · 1.47 KB
/
visualize.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
#!/bin/bash
#
# Visualize KnockoffGWAS discoveries on a toy dataset
#
# Authors: Matteo Sesia
# Date: 04/24/2019
#########
# Setup #
#########
# Print header
printf "KnockoffGWASView v0.1 (24 Apr 2019) \n"
printf "https://bitbucket.org/msesia/knockoffgwas \n"
printf "(C) 2019 Matteo Sesia, Eugene Katsevich GNU General Public License v3 \n\n"
# Setup spinner for long jobs
source "misc/spinner.sh"
# Log file
LOG_FILE="knockoffgwasview.log"
rm -f $LOG_FILE
touch $LOG_FILE
echo "Log file: "$LOG_FILE
######################
# Check dependencies #
######################
printf "\nSetup\n"
# System dependencies
check_dependency () {
CMD=$1
if [ ! -x "$(command -v $CMD)" ]; then
echo "Error: command $CMD not available"
exit
fi
}
DEPENDENCY_LIST=("R")
start_spinner " - Checking system dependencies..."
for DEPENDENCY in "${DEPENDENCY_LIST[@]}"; do
check_dependency $DEPENDENCY &>> "../"$LOG_FILE
done
stop_spinner $?
# R libraries
start_spinner " - Checking R library dependencies..."
Rscript --vanilla "visualization/check_packages.R" &>> "../"$LOG_FILE
stop_spinner $?
# Variant annotations
start_spinner " - Checking variant annotations..."
cd misc
./download_annotations.sh
cd ..
stop_spinner $?
#########################
# Visualize discoveries #
#########################
# Enter the directory where the scripts are stored
cd visualization
printf "\nStarting Shiny app...\n"
R -e "shiny::runApp('app.R', launch.browser=T)" &>> "../"$LOG_FILE
printf "Exiting.\n"