| IMMUcan_2022_CancerExample | R Documentation | 
Obtain the IMMUcan_2022_CancerExample dataset, which consists of three data objects: single cell data, multichannel images and cell segmentation masks. Data were obtained by imaging mass cytometry (IMC) of sections of 4 patients with different tumor indications.
IMMUcan_2022_CancerExample(
  data_type = c("sce", "spe", "images", "masks"),
  version = "latest",
  metadata = FALSE,
  on_disk = FALSE,
  h5FilesPath = NULL,
  force = FALSE
)
data_type | 
 type of object to load, 'images' for multichannel images or
'masks' for cell segmentation masks. Single cell data are retrieved using 
either 'sce' for the   | 
version | 
 dataset version. By default, the latest version is returned.  | 
metadata | 
 if FALSE (default), the data object selected in
  | 
on_disk | 
 logical indicating if images in form of 
HDF5Array objects (as .h5 files) should be stored on disk 
rather than in memory. This setting is valid when downloading   | 
h5FilesPath | 
 path to where the .h5 files for on disk representation 
are stored. This path needs to be defined when   | 
force | 
 logical indicating if images should be overwritten when files with the same name already exist on disk.  | 
This is an Imaging Mass Cytometry (IMC) dataset used in the IMC data analysis book
images contains 14 multichannel images, each
containing 50 channels, in the form of a CytoImageList class
object. 
masks contains the cell segmentation masks associated
with the images, in the form of a CytoImageList class object.
sce contains the single cell data extracted from the 
multichannel images using the cell segmentation masks, as well as the 
associated metadata, in the form of a SingleCellExperiment 
object. Single cell data can also be retrieved as a 
SpatialExperiment object. This represents a total of 46,825 
cells x 40 channels. 
All data are downloaded from ExperimentHub and cached for local re-use.
Mapping between the three data objects is performed via variables located in
their metadata columns: mcols() for the CytoImageList
objects and ColData() for the SingleCellExperiment
object. Mapping at the image level can be performed with the 
sample_id or image_name variables. Mapping between cell 
segmentation masks and single cell data is performed with the 
cell_number variable, the values of which correspond to the 
intensity values of the masks object. For practical examples, please 
refer to the "Accessing IMC datasets" vignette.
This imaging mass cytometry dataset serves as an example to demonstrate downstream analysis tools including spatial data analysis. The data was generated as part of the Integrated iMMUnoprofiling of large adaptive CANcer patient cohorts (IMMUcan) project (immucan.eu) using the Hyperion imaging system.
Relevant entries to the colData slot are as follows:
sample_id image name.
cell_number cell identifier.
width_px width of the image.
height_px height of the image.
patient_id patient identifier. 
ROI region of interest identifier.
indication cancer type.
cell_labels labels of manually labelled cells.
cell_type cell type as defined by classification.
spatial_community identifiers of each spatial tumor or 
non-tumor community
cn_celltypes cellular neighborhoods as defined by 
clustering cells based on the frequency of neighboring cell types.
cn_expression cellular neighborhoods as defined by 
clustering cells based on the mean expression of neighboring cells
lisa_clusters cellular neighborhoods as detected by the 
lisaClust package.
spatial_context spatial contexts defined in 
cn_celltype.
spatial_context_filtered filtered spatial context 
identifiers.
patch_id identifier of the spatial tumor patch.
cell_x spatial x coordinate.
cell_y spatial y coordinate.
The marker-associated metadata, including antibody information and metal 
tags are stored in the rowData of the 
SingleCellExperiment object. 
The assay slot of the SingleCellExperiment object
contains two assays: 
counts: mean ion counts per cell
exprs: arsinh-transformed counts per cell, with cofactor 1. 
The colPair slot of the SingleCellExperiment object
contains the following spatial object graphs:
neighborhood steinbock generated graph.
knn_interaction_graph 20-nearest neighbor graph.
expansion_interaction_graph expansion graph using a threshold
of 20.
delaunay_interaction_graph interaction graph constructed by 
delaunay triangulation.
knn_spatialcontext_graph 40-nearest neighbor graph.
File sizes:
`images`: size in memory = 1.5 Gb,  size on disk = 786 Mb.
`masks`: size in memory = 19 Mb,  size on disk = 1.2 Mb. 
`sce`: size in memory = 182 Mb, size on disk = 82 Mb. 
`spe`: size in memory = 183 Mb, size on disk = 81 Mb.
When storing images on disk, these need to be first fully read into memory before writing them to disk. This means the process of downloading the data is slower than directly keeping them in memory. However, downstream analysis will lose its memory overhead when storing images on disk.
A SingleCellExperiment object with single cell data, a CytoImageList object containing multichannel images, or a CytoImageList object containing cell segmentation masks.
Nils Eling
# Load single cell data
sce <- IMMUcan_2022_CancerExample(data_type = "sce")
print(sce)
# Display metadata
IMMUcan_2022_CancerExample(data_type = "sce", metadata = TRUE)
# Load masks on disk
library(HDF5Array)
masks <- IMMUcan_2022_CancerExample(data_type = "masks", on_disk = TRUE,
h5FilesPath = getHDF5DumpDir())
print(head(masks))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.