Utilty function that factilites cell-to-sample aggregation. By default, this function will sum the counts across cells to sample level.

aggregateCellsToSamples(object, ...)

# S4 method for SingleCellExperiment
aggregateCellsToSamples(
  object,
  fun = c("sum", "mean", "geometricMean", "median")
)

Arguments

object

Object.

fun

character(1). Name of the aggregation function. Uses match.arg() internally.

...

Additional arguments.

Value

SummarizedExperiment. Object with cell-level counts aggregated to sample-level.

Details

Internally aggregateCellsToSamples() automatically obtains the cell-to-sample groupings and then performs aggregation with the aggregateCols() function.

Note

Updated 2019-07-28.

Examples

data(SingleCellExperiment, package = "acidtest") ## SingleCellExperiment ==== object <- SingleCellExperiment x <- aggregateCellsToSamples(object)
#> Aggregating counts using 'sum()'.
#> class: RangedSummarizedExperiment #> dim: 500 2 #> metadata(1): aggregate #> assays(1): counts #> rownames(500): gene001 gene002 ... gene499 gene500 #> rowData names(8): broadClass description ... geneName seqCoordSystem #> colnames(2): sample1 sample2 #> colData names(0):