Skip to contents

Cell-to-sample mappings

Usage

cellToSample(object, ...)

# S4 method for SingleCellExperiment
cellToSample(object, return = c("factor", "DFrame"))

Arguments

object

Object.

return

character(1). Return type. Uses match.arg() internally and defaults to the first argument in the character vector.

...

Additional arguments.

Value

  • "factor": Named factor containing the samples as the levels and cell identifiers as the names.

  • "DFrame": S4 data frame containing sampleId column and cell identifiers as the row names.

Details

Sample identifiers must be defined in sampleId column in colData().

Note

Updated 2023-09-26.

Examples

data(SingleCellExperiment_splatter, package = "AcidTest")

## SingleCellExperiment ====
object <- SingleCellExperiment_splatter
c2s <- cellToSample(object)
table(c2s)
#> c2s
#> sample1 sample2 sample3 sample4 
#>      95      96     121      88