supercell_2_sce: Super-cells to SingleCellExperiment object

View source: R/supercell_2_sce.R

supercell_2_sceR Documentation

Super-cells to SingleCellExperiment object

Description

This function transforms super-cell gene expression and super-cell partition into SingleCellExperiment object

Usage

supercell_2_sce(
  SC.GE,
  SC,
  fields = c(),
  var.genes = NULL,
  do.preproc = TRUE,
  is.log.normalized = TRUE,
  do.center = TRUE,
  do.scale = TRUE,
  ncomponents = 50
)

Arguments

SC.GE

gene expression matrix with genes as rows and cells as columns

SC

super-cell (output of SCimplify function)

fields

which fields of SC to use as cell metadata

var.genes

set of genes used as a set of variable features of SingleCellExperiment (by default is the set of genes used to generate super-cells)

do.preproc

whether to do prepocessing, including data normalization, scaling, HVG, PCA, nearest neighbors, TRUE by default, change to FALSE to speed up conversion

is.log.normalized

whether SC.GE is log-normalized counts. If yes, then SingleCellExperiment field assay name = 'logcounts' else assay name = 'counts'

do.center

whether to center gene expression matrix to compute PCA

do.scale

whether to scale gene expression matrix to compute PCA

ncomponents

number of principal components to compute

Value

SingleCellExperiment object

Examples


data(cell_lines)
SC           <- SCimplify(cell_lines$GE, gamma = 20)
SC$ident     <- supercell_assign(clusters = cell_lines$meta, supercell_membership = SC$membership)
SC.GE        <- supercell_GE(cell_lines$GE, SC$membership)
sce          <- supercell_2_sce(SC.GE = SC.GE, SC = SC, fields = c("ident"))


SuperCell documentation built on Oct. 25, 2024, 5:07 p.m.