-
Notifications
You must be signed in to change notification settings - Fork 15
/
01-Prerequisites.Rmd
188 lines (129 loc) · 5.71 KB
/
01-Prerequisites.Rmd
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# Prerequisites {#env-pre}
For reproducing the tutorials in the modules 4.2 and 5, we need a few R
packages and a Python package. Detailed instructions are below.
## R packages
1. For module 4.2, we need `reticulate` to import the Python package (see
[next section](#python_packages). You can install it within R:
```
# install reticulate for module 4.2
install.packages("reticulate")
```
2. For module 5.1, we need `cardelino`, which is only available at
[GitHub](https://github.com/single-cell-genetics/cardelino), so we need to use
`devtools`:
```
# install devtools for module 5.1
install.packages('devtools')
```
```
# install cardelino for module 5.1
devtools::install_github("single-cell-genetics/cardelino", build_vignettes = FALSE)
```
3. For module 5.2, we need `infercnv`, which requires a standalone
software JAGS. **Please install JAGS manually** for Windows or Mac from this
link **before** install `rjags` R package:
https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/
<br/>
Continue and install `rjags` and `infercnv`:
```
# install rjags for module 5.2
install.packages('rjags')
```
```
# install inferCNV for module 5.2
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("infercnv")
```
## Python packages {#python_packages}
For module 4.2, we need one Python package [scvelo](https://scvelo.readthedocs.io/).
If you haven't used Python before, we recommend installing it by using [Anaconda](https://docs.anaconda.com/anaconda/), which contains Python 3.8 and
various useful tools.
### Installation on Windows {#conda_install_windows}
1. Go to [Anaconda](https://www.anaconda.com/products/individual) webpage; click 'Download' button to download Anaconda for Windows (with Python3.8).
```{r conda_fig1, echo=FALSE, message=FALSE, warning=FALSE, fig.align="center", out.width='65%'}
knitr::include_graphics("./images/conda_download_installer1.png")
```
2. Double click the downloaded file and install Anaconda following the instructions. (Note, this requires about 3G disk space)
3. Open `Anaconda Powershell Prompt` and then create an new conda environment
with name `sgcell` by typing
```
conda create -n sgcell python=3.8
```
4. Still in the terminal, and activate the environment by typing
```
conda activate sgcell
```
5. Install `scVelo` in this conda environment by typing this command in the shell:
```
pip install scvelo==0.2.2
```
```{r conda_fig2, echo=FALSE, message=FALSE, warning=FALSE, fig.align="center", out.width='65%'}
knitr::include_graphics("./images/conda_scvelo.png")
```
You have successfully set up the base environment of conda and installed the `scVelo` tool in this environment.
### Installation on macOS {#conda_install_mac}
In macOS, you could install Anaconda either in graphical mode or command line mode.
**Option 1: installation in Graphical Mode (recommended)**
This mode is very similar to [Installation on Windows](#conda_install_windows).
1. Go to [Anaconda](https://www.anaconda.com/products/individual) webpage; click 'Get Additional Installers' button and then
select the `64-Bit Graphical Installer` for MacOS.
```{r conda_fig3, echo=FALSE, message=FALSE, warning=FALSE, fig.align="center", out.width='65%'}
knitr::include_graphics("./images/conda_download_installer2.png")
```
2. Install Anaconda following the instructions.
3. Open `Terminal` (you can type in `Spotlight Search`) and then create an new
conda environment with name `sgcell` by typing
```
conda create -n sgcell python=3.8
```
4. Still in the terminal, and activate the environment by typing
```
conda activate sgcell
```
5. Install `scVelo` in this conda environment by typing this command in the shell:
```
pip install scvelo==0.2.2
```
**Option 2: installation in Command Line Mode**
This mode is very similar to [Installation on Linux](#conda_install_linux).
1. Open macOS Terminal
2. Download Anaconda installer with `wget https://repo.anaconda.com/archive/Anaconda3-2021.05-MacOSX-x86_64.sh`
3. Install Anaconda with `bash Anaconda3-2021.05-MacOSX-x86_64.sh`; follow the prompts on the installer screens.
<br/>
When you are asked `Do you wish the installer to initialize Anaconda3 by running conda init`, we recommend "yes".
4. Close and then re-open your Shell, to make the changes take effect.
5. Create an new conda environment with name `sgcell` by typing
```
conda create -n sgcell python=3.8
```
6. Still in the terminal, and activate the environment by typing
```
conda activate sgcell
```
7. Install `scVelo` in this conda environment by typing this command in the shell:
```
pip install scvelo==0.2.2
```
### Installation on Linux {#conda_install_linux}
1. Open Linux Shell.
2. Download Anaconda installer with `wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh`
3. Install Anaconda with `bash Anaconda3-2021.05-Linux-x86_64.sh`; follow the prompts on the installer screens.
<br/>
When you are asked `Do you wish the installer to initialize Anaconda3 by running conda init`, we recommend "yes".
4. Close and then re-open your Shell, to make the changes take effect.
5. Create an new conda environment with name `sgcell` by typing
```
conda create -n sgcell python=3.8
```
6. Still in the terminal, and activate the environment by typing
```
conda activate sgcell
```
7. Install `scVelo` in this conda environment by typing this command in the shell:
```
pip install scvelo==0.2.2
```
6. Type `conda list` in Shell.
<br/>
A list of installed packages appears if it has been installed correctly.