forked from drieslab/giotto_workshop_2024
-
Notifications
You must be signed in to change notification settings - Fork 0
/
00_datasets.Rmd
224 lines (162 loc) · 5.81 KB
/
00_datasets.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# Datasets & Packages
## Datasets to download
Here we provide links to the original datasets that were used for this workshop.
Some of the datasets were modified (e.g. downsampled or subsetted) for the purpose of this workshop.
You can download them from their original source or download all of them - including
intermediate files - from the following Zenodo repository:
### Zenodo repository
https://zenodo.org/communities/gw2024/
### 10X Genomics Visium Mouse Brain Section (Coronal) dataset
https://support.10xgenomics.com/spatial-gene-expression/datasets/1.1.0/V1_Adult_Mouse_Brain
### 10X Genomics Visium HD: FFPE Human Colon Cancer
https://www.10xgenomics.com/datasets/visium-hd-cytassist-gene-expression-libraries-of-human-crc
### 10X Genomics multi-modal dataset
https://www.10xgenomics.com/products/xenium-in-situ/preview-dataset-human-breast
### 10X Genomics multi-omics Visium CytAssist Human Tonsil dataset
https://www.10xgenomics.com/resources/datasets/gene-protein-expression-library-of-human-tonsil-cytassist-ffpe-2-standard
### 10X Genomics Human Prostate Cancer Adenocarcinoma with Invasive Carcinoma (FFPE)
https://www.10xgenomics.com/datasets/human-prostate-cancer-adenocarcinoma-with-invasive-carcinoma-ffpe-1-standard-1-3-0
### 10X Genomics Normal Human Prostate (FFPE)
https://www.10xgenomics.com/datasets/normal-human-prostate-ffpe-1-standard-1-3-0
### Xenium
https://www.10xgenomics.com/datasets/preview-data-ffpe-human-lung-cancer-with-xenium-multimodal-cell-segmentation-1-standard
### MERFISH cortex dataset
https://doi.brainimagelibrary.org/doi/10.35077/g.21
### Lunaphore IF dataset
https://zenodo.org/records/13175721
## Needed packages
To run all the tutorials from this Giotto Suite workshop you will need to install
additional R and Python packages. Here we provide detailed instructions and discuss
some common difficulties with installing these packages. The easiest way would be
to copy each code snippet into your R/Rstudio Console using fresh a R session.
### CRAN dependencies:
```{r, eval=FALSE}
cran_dependencies <-
c("BiocManager",
"devtools",
"pak")
install.packages(cran_dependencies, Ncpus = 4)
```
### *terra* installation
*terra* may have some additional steps when installing depending on which system you are on. Please see the *terra* [repo](https://github.com/rspatial/terra) for specifics. Installations of the CRAN release on Windows and Mac are expected to be simple, only requiring the code below.
For Linux, there are several prerequisite installs:
```
GDAL (>= 2.2.3), GEOS (>= 3.4.0), PROJ (>= 4.9.3), sqlite3
```
On our AlmaLinux 8 HPC, the following versions have been working well:
- gdal/3.6.4
- geos/3.11.1
- proj/9.2.0
- sqlite3/3.37.2
```{r, eval=FALSE}
install.packages("terra")
```
### *Matrix* installation
!! FOR R VERSIONS LOWER THAN 4.4.0 !!
*Giotto* requires *Matrix* 1.6-2 or greater, but when installing *Giotto* with *pak* on an *R* version lower than 4.4.0, the installation can fail asking for R 4.5 which doesn't exist yet. We can solve this by installing the 1.6-5 version directly by un-commenting and running the line below.
```{r, eval=FALSE}
# devtools::install_version("Matrix", version = "1.6-5")
```
### *Rtools* installation
Before installing Giotto on a windows PC please make sure to install the relevant version of [Rtools](https://cran.r-project.org/bin/windows/Rtools/). If you have a Mac or linux PC, or have already installed Rtools, please ignore this step.
### *Giotto* installation
```{r, eval=FALSE}
pak::pak("drieslab/Giotto")
pak::pak("drieslab/GiottoData")
```
### *irlba* install
Reinstall *irlba* from source. Avoids the common `function 'as_cholmod_sparse' not provided by package 'Matrix'` error. See this [issue](https://github.com/bwlewis/irlba/issues/70) for more info.
```{r, eval=FALSE}
install.packages("irlba", type = "source")
```
### *arrow* install
*arrow* is a suggested package that we use here to open `parquet` files. The parquet files that 10X provides use zstd compression which the default *arrow* installation may not provide.
```{r, eval=FALSE}
has_arrow <- requireNamespace("arrow", quietly = TRUE)
zstd <- TRUE
if (has_arrow) {
zstd <- arrow::arrow_info()$capabilities[["zstd"]]
}
if (!has_arrow || !zstd) {
Sys.setenv(ARROW_WITH_ZSTD = "ON")
install.packages("assertthat", "bit64")
install.packages("arrow", repos = c("https://apache.r-universe.dev"))
}
```
### Bioconductor dependencies:
```{r, eval=FALSE}
bioc_dependencies <- c(
"scran",
"ComplexHeatmap",
"SpatialExperiment",
"ggspavis",
"scater",
"nnSVG"
)
```
### CRAN packages:
```{r, eval=FALSE}
needed_packages_cran <- c(
"dplyr",
"gstat",
"hdf5r",
"miniUI",
"shiny",
"xml2",
"future",
"future.apply",
"exactextractr",
"tidyr",
"viridis",
"quadprog",
"Rfast",
"pheatmap",
"patchwork",
"Seurat",
"harmony",
"scatterpie",
"R.utils",
"qs"
)
pak::pkg_install(c(bioc_dependencies,
needed_packages_cran))
```
### Packages from GitHub
```{r, eval=FALSE}
github_packages <- c(
"satijalab/seurat-data"
)
pak::pkg_install(github_packages)
```
### Python environments
```{r, eval=FALSE}
# default giotto environment
Giotto::installGiottoEnvironment()
reticulate::py_install(
pip = TRUE,
envname = 'giotto_env',
packages = c(
"scanpy"
)
)
# install another environment with py 3.8 for cellpose
reticulate::conda_create(envname = "giotto_cellpose",
python_version = 3.8)
#.re.restartR()
reticulate::use_condaenv('giotto_cellpose')
reticulate::py_install(
pip = TRUE,
envname = 'giotto_cellpose',
packages = c(
"pandas",
"networkx",
"python-igraph",
"leidenalg",
"scikit-learn",
"cellpose",
"smfishhmrf",
'tifffile',
'scikit-image'
)
)
```