downsample: Downsample ScPhyloExpressionSet

View source: R/phyloset_sc.R

downsampleR Documentation

Downsample ScPhyloExpressionSet

Description

Create a downsampled copy of a ScPhyloExpressionSet object with fewer cells per identity.

Usage

downsample(phyex_set, downsample = 10)

Arguments

phyex_set

A ScPhyloExpressionSet object

downsample

Integer, number of cells to keep per identity (default: 10)

Details

This function creates a new ScPhyloExpressionSet with a subset of cells, maintaining the same proportional representation across identities. The sampling is stratified by the current selected_idents grouping. All metadata and reductions are filtered to match the selected cells.

Value

A new ScPhyloExpressionSet object with downsampled cells

Examples

# Downsample to 20 cells per identity
small_set <- downsample(example_phyex_set_sc, downsample = 20)

# Change grouping and downsample
example_phyex_set_sc@selected_idents <- "day"
treatment_set <- downsample(example_phyex_set_sc, downsample = 15)

myTAI documentation built on Nov. 20, 2026, 5:08 p.m.