Subset Single Cell Experiment
subsetSCE.Rd
Subset a SingleCellExperiment to reduce the number of cells
Usage
subsetSCE(
sce,
cell_type_col = "celltype_major",
scenario = "even",
ncells = 1000,
notEnough = "asis",
seed = 12345
)
Arguments
- sce
SingleCellExperiment with cell type annotation
- cell_type_col
name of colData column containing cell type information
- scenario
which fraction of each celltype should be present in the subsampled dataset?
- ncells
number of cells in total, defaults to 1000
- notEnough
what to do if not enough cells are available c("remove", "asis")
- seed
set a seed, enables reproducibility of subsetting step
Examples
data("single_cell_data_1")
sce <- subsetSCE(
single_cell_data_1,
cell_type_col = "celltype_major",
scenario = "even",
ncells = 100
)
#> ── spacedeconv ─────────────────────────────────────────────────────────────────
#> ℹ testing parameter
#> ℹ Set seed to 12345
#> ℹ testing parameter
#> ✔ parameter OK [28ms]
#>
#> ℹ extracting up to 100 cells
#> ✔ extracting up to 100 cells [133ms]
#>
#> ℹ extracted 96 cells
#> ✔ extracted 96 cells [22ms]
#>