Scale relative cell fractions to absolute by providing cell densities
scale_cell_counts.Rd
This function calculates absolute cell densities for a
SpatialExperiment object by scaling a specified column of relative
cell fractions with provided absolute cell densities. The result
is added as a new column in the colData of the SPE
object.
Arguments
- spe
-
An SpatialExperiment object containing spatial transcriptomics data.
- value
-
A string specifying the name of the column in
colData(spe)that contains relative cell fractions/deconvolution results to be scaled. - cell_counts
-
A named vector of absolute cell densities, where names correspond to the rownames in
colData(spe). - resName
-
Optional; a string specifying the name of the new column to be added to
colData(spe)that will contain the absolute cell densities. If NULL, defaults to appending "_absolute" to thevalueparameter.