PreparePlotData
PreparePlotData.RdPrepares a tidy data frame of pathway activity scores per cell for
downstream plotting with PlotPathway() or CalculatePercentage().
Accepts either a plain metadata data frame or a Seurat object.
Arguments
- x
A metadata data frame (rows = cells, columns = metadata fields) or a Seurat object. Must contain the column specified by
group.- score
A named numeric vector of per-cell scores from
ComputeCellData(). Names must be cell IDs matching rownames ofx.- group
A character string giving the column name in
xmetadata to use for grouping (e.g."genotype","Age").- Seurat.object
Logical; set
TRUEifxis a Seurat object. DefaultFALSE.
Value
A data frame with one row per cell and three columns:
- normalized
Normalized pathway activity score in [0, 1]\ from
ComputeCellData().- scale
Z-scored pathway activity across all cells.
The grouping variable, named after the
groupargument.