Downsample the cells in a ScPhyloExpressionSet and return the expression matrix as a dense matrix.
Usage
downsample_expression(phyex_set, downsample = 10)
Arguments
- phyex_set
A ScPhyloExpressionSet object
- downsample
Integer, number of cells to keep per identity (default: 10)
Value
A dense expression matrix (genes x downsampled cells)
Details
This function randomly downsamples the cells in the Seurat object of a ScPhyloExpressionSet
and returns the resulting expression matrix as a regular R matrix (not sparse).
Useful for quick plotting or prototyping with large single-cell datasets.
Examples
# Downsample to 20 cells per identity and get the matrix
# mat <- downsample_expression(sc_phyex_set, downsample = 20)