Helper function to process .tiff files created with the steinbock pipeline into a SingleCellExperiment object. This function is mainly used to read-in data generated from a "spillover slide". Here, each .tiff file contains the measurements of multiple pixels for a single stain across all open channels.

readSCEfromTIFF(x, image_df_path, panel_df_path, verbose = TRUE)

Arguments

x

has to be a path to a folder containing .tiff files.

image_df_path

has to be a path to a images.csv file, generated with the steinbock pipeline.

panel_df_path

has to be a path to a panel.csv file, generated with the steinbock pipeline.

verbose

logical indicating if additional information regarding the spotted and acquired masses should be shown.

Value

returns a SCE object where pixels are stored as columns and acquired channels are stored as rows.

Reading in .tiff files for spillover correction

As described in the original publication, single metal spots are acquired using the Hyperion imaging system. Each acquisition corresponds to one spot. All acquisitions are stored in a single .mcd file and individual acquisitions are stored in single .tiff files after extraction with the steinbock pipeline.

This function aggregates these measurements into a single SingleCellExperiment object:

x is a path: All .tiff files are read in from the specified path. Here, the path should indicate the location of the spillover slide measurement. Additionally, the images.csv and panel.csv files generated with the steinbock pipeline must be passed. The column acquisition_description in images.csv as well as the column channel in panel.csv must contain the spotted metal isotope name in the format (mt)(mass) (e.g. Sm152 for Samarium isotope with the atomic mass 152).

Author

Victor Ibañez (victor.ibanez@uzh.ch)

Examples

# Read files from path
path <- system.file("extdata/spillover_tiff/img", package = "imcRtools")
image_df_path <- system.file("extdata/spillover_tiff/images.csv", package = "imcRtools")
panel_df_path <- system.file("extdata/spillover_tiff/panel.csv", package = "imcRtools")

sce <- readSCEfromTIFF(path, image_df_path, panel_df_path) 
#> Spotted channels:  Dy161, Dy162, Dy163, Dy164
#> Acquired channels:  Dy161, Dy162, Dy163, Dy164
#> Channels spotted but not acquired:  
#> Channels acquired but not spotted:  
sce
#> class: SingleCellExperiment 
#> dim: 4 80000 
#> metadata(0):
#> assays(1): counts
#> rownames(4): Dy161 Dy162 Dy163 Dy164
#> rowData names(2): channel_name marker_name
#> colnames: NULL
#> colData names(4): cell_id sample_id sample_metal sample_mass
#> reducedDimNames(0):
#> mainExpName: NULL
#> altExpNames(0):