-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
77 lines (60 loc) · 2.43 KB
/
install.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
75
76
77
#!/bin/bash
#### Preparation
# Make sure the data is available at this path with appropriate permission
# before rglyvis is installed
DATAPATH='/the/path/to/your/data/GTEx_V6-public.h5'
# Where to put the packages
program_dir=$HOME"/Programs"
mkdir -p $program_dir
####[Optional] Ubuntu upgrade
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:opencpu/opencpu-1.6
sudo apt-get update
#### [Optional] Install an up-to-date R version that is accessible to opencpu
sudo add-apt-repository -y "deb [arch=amd64] https://cran.cnr.berkeley.edu/bin/linux/ubuntu xenial/"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo apt-get update
sudo apt-get install -y r-base
#### Install OpenCPU by package manager
sudo apt-get install opencpu
#### Start opencpu
sudo service opencpu start
#### [Optional] Test if OpenCPU is up and running
curl http://localhost/ocpu/info
#### Install Redis server
cd $program_dir
# wget http://download.redis.io/releases/redis-3.2.8.tar.gz
wget http://download.redis.io/releases/redis-5.0.4.tar.gz
tar -xzf redis-5.0.4.tar.gz
cd redis-5.0.4/
make
sudo make install
redis-server &
disown
#### [Optional] Developer tools
cd
sudo Rscript -e "install.packages(c('futile.logger','testthat', 'roxygen2'), repos='https://cran.cnr.berkeley.edu/',Ncpus=2)"
sudo Rscript -e "devtools::install_version('devtools', version='1.11.1', repos='https://cran.cnr.berkeley.edu/',Ncpus=2,quiet=TRUE)"
sudo apt-get install git
#### Install bioconductor dependencies
sudo Rscript -e 'source("https://bioconductor.org/biocLite.R");biocLite("rhdf5");'
#### Install rvislib
cd $program_dir
git clone https://github.com/anexVis/rvislib.git
cd rvislib
sudo Rscript -e "devtools::install('.')"
#### Install ranexvis
cd $program_dir
git clone https://github.com/anexVis/ranexvis.git
##### Replace the data path
Rscript -e `printf 'load("data/sysdata.rda");dbpath=list(gtex="%s");save(list=ls(),file="data/sysdata.rda")' $DATAPATH`
sudo Rscript -e "devtools::install('.', quick=TRUE, force_deps=FALSE, upgrade_dependencies=FALSE)"
##### Add ranexvis to list of preload packages in /etc/opencpu/server.conf
sudo sed -i '/preload/ c\ "preload": ["ranexvis", "ggplot2"]' /etc/opencpu/server.conf
sudo service opencpu restart
#### Install web-app to /var/www/html
cd $program_dir
git clone https://github.com/anexVis/anexvis-app.git
sudo mv anexvis-app /var/www/html/