2 Datasets & Packages
2.1 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:
2.1.2 10X Genomics Visium Mouse Brain Section (Coronal) dataset
https://support.10xgenomics.com/spatial-gene-expression/datasets/1.1.0/V1_Adult_Mouse_Brain
2.1.3 10X Genomics Visium HD: FFPE Human Colon Cancer
https://www.10xgenomics.com/datasets/visium-hd-cytassist-gene-expression-libraries-of-human-crc
2.1.4 10X Genomics multi-modal dataset
https://www.10xgenomics.com/products/xenium-in-situ/preview-dataset-human-breast
2.1.7 10X Genomics Normal Human Prostate (FFPE)
https://www.10xgenomics.com/datasets/normal-human-prostate-ffpe-1-standard-1-3-0
2.2 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.
2.2.2 terra installation
terra may have some additional steps when installing depending on which system you are on. Please see the terra repo 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
2.2.3 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.
2.2.4 Rtools installation
Before installing Giotto on a windows PC please make sure to install the relevant version of Rtools. If you have a Mac or linux PC, or have already installed Rtools, please ignore this step.
2.2.6 irlba install
Reinstall irlba from source. Avoids the common function 'as_cholmod_sparse' not provided by package 'Matrix'
error. See this issue for more info.
2.2.7 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.
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"))
}
2.2.9 CRAN packages:
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))
2.2.11 Python environments
# 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'
)
)