forked from gaoshang1102/setupNewUbuntu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRstudio
157 lines (129 loc) · 4.74 KB
/
Rstudio
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
sudo apt-get update -y
sudo apt install libssl-dev libcurl4-openssl-dev libxml2-dev libudunits2-dev libgdal-dev
sudo apt remove r-base* --purge
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'
sudo apt update
sudo apt install r-base
sudo apt-get install gdebi-core
sudo su # or add sudo before all command below
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.4.1717-amd64.deb # Check the lastest rstudio version
sudo gdebi rstudio-server-1.4.1717-amd64.deb
rm rstudio-server-1.4.1717-amd64.deb
adduser SOMENAME
vi /etc/rstudio/rserver.conf
www-port=80
www-address=ec2-52-204-236-200.compute-1.amazonaws.com # Change the ip to aws instance Public IPv4 DNS
auth-required-user-group=SOMENAME
rstudio-server restart
## Disk mount
fdisk -l
fdisk /dev/XXXXXX
n
p
1
default
default
w
sudo mkfs.ext4 /dev/XXXXXX
sudo mount /dev/XXXXXX /mountpointXXX
sudo vi /etc/fstab
/dev/XXXXXX /mountpointXXX ext4 defaults 0 0
# AWS client
sudo curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
sudo unzip awscliv2.zip
sudo ./aws/install
rm awscliv2.zip
aws s3 cp /tmp/foo/ s3://bucket/ --recursive
sudo add-apt-repository ppa:marutter/rrutter4.0
sudo add-apt-repository ppa:c2d4u.team/c2d4u4.0+
sudo add-apt-repository ppa:cran/v8
sudo apt update
sudo apt-get install libnode-dev
sudo apt install r-cran-rstan
sudo apt-get install libhdf5-dev
sudo apt install libboost-all-dev
# upgrade python3 to python3.8
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt install python3
sudo apt-get install python3.8-dev
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
sudo update-alternatives --config python3
## Select 2 and press enter
python3 -V
sudo apt-get -y install python3-pip
sudo apt-get -y install python-pip
sudo pip install --upgrade setuptools
sudo pip3 install --upgrade setuptools
wget https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh
bash Anaconda-latest-Linux-x86_64.sh
#restart terminal
conda create --name scRNAseq
wget https://github.com/arq5x/bedtools2/releases/download/v2.29.1/bedtools-2.29.1.tar.gz
tar -zxvf bedtools-2.29.1.tar.gz
cd bedtools2/
make
# add /home/ubuntu/bedtools2/bin to PATH in .bashrc with export export PATH=$PATH:/home/ubuntu/bedtools2/bin
source activate scRNAseq
conda install python=3.9
pip3 install scanpy
pip3 install scvelo
pip install jupyterlab
jupyter notebook --generate-config
jupyter notebook password
jupyter-lab --ip 0.0.0.0 --no-browser --allow-root
# install kallisto follow https://pachterlab.github.io/kallisto/source
# build mouse kallisto index https://github.com/linnarsson-lab/loompy/tree/master/kallisto
# In rstudio
install.packages("devtools")
library(devtools)
## Bioconductor
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install()
BiocManager::install(c("GenomicFeatures", "AnnotationDbi"))
BiocManager::install("clusterProfiler")
BiocManager::install("org.Mm.eg.db")
# Seurat
install.packages("Seurat")
# BITFAM
devtools::install_github("jaleesr/BITFAM")
# RNA velocity
install.packages("hdf5r")
BiocManager::install("pcaMethods")
install_github("velocyto-team/velocyto.R")
# scVelo
sudo apt-get install llvm-10 lldb-10 llvm-10-dev libllvm10 llvm-10-runtime
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-6.0 6
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-10 10
sudo update-alternatives --config llvm-config
pip3 install llvmlite
pip3 install packaging numpy
pip3 install -U scvelo
# PAGA
conda install -c anaconda hdf5=1.12.1
sudo pip install scanpy
# Palantir (Can't install)
sudo pip install PhenoGraph
sudo pip install cmake
sudo pip install palantir
# Monocle
BiocManager::install(c('BiocGenerics', 'DelayedArray', 'DelayedMatrixStats',
'limma', 'S4Vectors', 'SingleCellExperiment',
'SummarizedExperiment', 'batchelor', 'Matrix.utils'))
devtools::install_github('cole-trapnell-lab/leidenbase')
devtools::install_github('cole-trapnell-lab/monocle3')
# scArches
sudo pip install --ignore-installed -U scarches
# singler
# Mount S3 bucket to EC2 via s3fs
# https://github.com/s3fs-fuse/s3fs-fuse
sudo apt install s3fs
cat ${HOME}/.passwd-s3fs
echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > ${HOME}/.passwd-s3fs
chmod 600 ${HOME}/.passwd-s3fs
mkdir mount_point
# mount at / file
s3fs scrna-seq-database(bucket name) /path/to/mount_point -o passwd_file=${HOME}/.passwd-s3fs -o umask=0007,uid=1000 (uid is checked in /etc/passwd. 3rd column)