
Compute clone-level mean expression from single-cell data
Source:R/stats.R
clone_mean_expression.RdFor each patient, groups cells by clone_id and computes the mean expression of each gene within each clone. This reduces single-cell resolution to subclone resolution, matching the original PERCEPTION pipeline.
Arguments
- expression_matrix
Matrix or data frame. Gene expression matrix with genes as rows and cells as columns.
- cell_clone_map
Data frame with columns
cell_idandclone_id, mapping each cell to its clone. Typically from Seurat clustering.- patient_ids
Character vector. Patient ID for each cell, same length as columns of expression_matrix. If NULL, all cells are assumed from one patient.