sce_to_scmet: Convert from SingleCellExperiment to scmet object

View source: R/utils.R

sce_to_scmetR Documentation

Convert from SingleCellExperiment to scmet object

Description

Helper function that converts SCE objects to scmet objects that can be used as input to the scmet function. The structure of the SCE object to store single cell methylation data is the following. We create two sparse assays, met storing methylated CpGs and total storing total number of CpGs. Rows correspond to features and columns to cells, similar to scRNA-seq convention.To distinguish between a feature (in a cell) having zero methylated CpGs vs not having CpG coverage at all (missing value), we check if the corresponding entry in total is zero as well. The rownames and colnames slots should store the feature and cell names, respectively. Covariates X that might explain variability in mean (methylation) should be stored in ⁠metadata(rowData(sce)X⁠.

Usage

sce_to_scmet(sce)

Arguments

sce

SummarizedExperiment object

Value

A named list containing the matrix Y (methylation data in format required by the scmet function) and the covariates X.

Author(s)

C.A.Kapourani C.A.Kapourani@ed.ac.uk

See Also

scmet, scmet_differential, scmet_hvf_lvf

Examples

# Extract
sce <- scmet_to_sce(Y = scmet_dt$Y, X = scmet_dt$X)

df <- sce_to_scmet(sce)


andreaskapou/scMET documentation built on Feb. 1, 2024, 10:46 a.m.