
Generate pseudo-bulked matrices
get_pseudobulked_sc.RdThis is a wrapper function to generate pseudo-bulked counts from a list of cell identifiers. You have the option to return sparse or dense matrices and if you wish to sum raw counts or calculate the mean of the normalised counts.
Arguments
- object
SingleCellsorSingleCellsSubsetclass.- cell_list
Named list.
- return_format
String. One of
c("dense", "sparse").- assay
String. One of
c("raw", "norm").- .verbose
Boolean or integer. Controls verbosity and returns run times.
FALSE-> quiet,TRUEor1L-> normal verbosity,2L-> detailed verbosity.
Value
Pending on your setting in return_format a dense matrix or sparse CSR matrix with aggregated cells x genes.
Examples
# sum raw counts per planted cell type
sc <- demo_single_cells()
obs <- get_sc_obs(sc)
res <- get_pseudobulked_sc(
sc,
cell_list = split(obs$cell_id, obs$cell_grp),
.verbose = FALSE
)
dim(res)
#> [1] 3 50
unlink(sc@dir_data, recursive = TRUE, force = TRUE)