forked from drieslab/giotto_workshop_2024
-
Notifications
You must be signed in to change notification settings - Fork 0
/
00_needed_packages.Rmd
163 lines (127 loc) · 3.61 KB
/
00_needed_packages.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
## Needed packages
### 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")
```
### *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)
reticulate::py_install(
pip = TRUE,
envname = 'giotto_cellpose',
packages = c(
"pandas",
"networkx",
"python-igraph",
"leidenalg",
"scikit-learn",
"cellpose",
"smfishhmrf",
"git+https://github.com/wwang-chcn/bento-tools.git@giotto_install"
)
)
```