Converting single cells to pseudo-bulks.

pseudoBulk(
  sce,
  phenotypes = NULL,
  response = NULL,
  clusterid = NULL,
  assayName = "counts",
  resampSizes = 100,
  proportion = NULL,
  calcMean = FALSE,
  nPool = 15,
  seed = 904800
)

Arguments

sce

SingleCellExpeirment object.

phenotypes

Phenotypes to predict. Can be multiple.

response

Response matrix. Can be continuous.

clusterid

Column name of colData for specifying groups for pseudobulking.

assayName

Assay used for pseudobulking.

resampSizes

How many pseudo-bulk resamples to generate from each cluster.

proportion

Used to determine unequal resampSizes.

calcMean

Logical. Calculate mean of sum of expression for pseudobulking.

nPool

How many cells to use for pseudobulking.

seed

Random seeds. The function sets the seed with withr::local_seed(), so the session's random-number state is restored on exit.

Value

An updated SingleCellExpeirment object with a pseudobulk assay.

Examples

sce <- scuttle::mockSCE(ncells = 200, ngenes = 50)
pb <- pseudoBulk(sce, phenotypes = "Cell_Cycle", resampSizes = 10, nPool = 5)
dim(pb$reference)