CellDEEP.Random: Random Cell Pooling for Seurat Objects

View source: R/01_Collection_of_poolingFunctions.R

CellDEEP.RandomR Documentation

Random Cell Pooling for Seurat Objects

Description

Pools cells into pseudocells by random selection within biological groups. Includes a minimum threshold filter of 25 cells per subgroup to ensure pooling quality.

Usage

CellDEEP.Random(
  dataset,
  n_cells = 10,
  assay_name = "RNA",
  min_cells_per_subgroup = 25,
  readcounts = "mean"
)

Arguments

dataset

A Seurat object.

n_cells

Integer. The number of cells to pool into each pseudocell.

assay_name

Character. The assay to use for counts (default "RNA").

min_cells_per_subgroup

Integer. Minimum cells required in each sample-cluster subgroup to perform pooling (default 25).

readcounts

Character. Method to aggregate counts: "sum" or "mean".

Value

A new Seurat object containing the aggregated pseudocells.

Note

Subgroups (sample-cluster combinations) with fewer than 25 cells are automatically skipped. The function also generates a DimPlot to visualize the random pooling across samples.

Examples


data("sim")
pool_input <- prepare_data(
  sim,
  sample_id = "DonorID",
  group_id = "Status",
  cluster_id = "cluster_id"
)

pooled_random <- CellDEEP.Random(
  pool_input,
  readcounts = "sum",
  n_cells = 3,
  min_cells_per_subgroup = 1,
  assay_name = "RNA"
)
pooled_random


CellDEEP documentation built on March 29, 2026, 5:08 p.m.