Skip to contents

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

Usage

aggregateCellsToSamples(x, ...)

# S4 method for SingleCellExperiment
aggregateCellsToSamples(x)

Arguments

x

Object.

...

Additional arguments.

Value

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

Details

Internally this function automatically obtains the cell-to-sample groupings and then performs a sum aggregation with the aggregate() function.

Note

Updated 2021-09-13.

Examples

data(SingleCellExperiment_lanesplit, package = "AcidTest")

## SingleCellExperiment ====
x <- SingleCellExperiment_lanesplit
x <- aggregateCellsToSamples(x)
print(x)
#> class: RangedSummarizedExperiment 
#> dim: 100 8 
#> metadata(2): aggregate aggregateCols
#> assays(1): counts
#> rownames(100): gene001 gene002 ... gene099 gene100
#> rowData names(10): broadClass description ... ncbiGeneId seqCoordSystem
#> colnames(8): sample_1_L001 sample_1_L002 ... sample_2_L003
#>   sample_2_L004
#> colData names(0):