CreateSlide: Create a new slide object

createSlideR Documentation

Create a new slide object

Description

This function takes input of the count matrix (from read10xRaw or read10xRawH5) and slide information (from read10xSlide or manually specified data frame) and outputs a SummarizedExperiment object as our slide object for downstream decontamination and visualization.

Usage

createSlide(count_mat, slide_info, gene_cutoff = 0.1, verbose = TRUE)

Arguments

count_mat

(matrix of num) The raw gene-by-barcode count matrix. Can be either standard matrix format or sparse matrix format.

slide_info

(list or data.frame) A list of slide information from read10xSlide(), or a data frame only containing spot information like barcode, tissue, imagerow, imagecol, etc.

gene_cutoff

(num) Filter out genes with average expressions among tissue spots below or equal to this cutoff. Default: 0.1

verbose

(logical) Whether print progress information. Default: TRUE

Value

A SummarizedExperiment object containing gene expression and spot metadata.

Examples


data(mbrain_raw)
spatial_dir <- system.file(file.path("extdata",
                                     "V1_Adult_Mouse_Brain_spatial"),
                           package = "SpotClean")
mbrain_slide_info <- read10xSlide(tissue_csv_file=file.path(spatial_dir,
                                       "tissue_positions_list.csv"),
             tissue_img_file = file.path(spatial_dir,
                                       "tissue_lowres_image.png"),
             scale_factor_file = file.path(spatial_dir,
                                       "scalefactors_json.json"))

mbrain_obj <- createSlide(mbrain_raw,
                          mbrain_slide_info)
mbrain_obj

zijianni/SpotClean documentation built on June 12, 2024, 1:58 a.m.