
Replicate deconvolution subgroups in a new dataset
Source:R/cell_deconvolution.R
replicate_deconvolution_subgroups.RdReconstructs and applies deconvolution subgroup signatures based on a previous decomposition.
Arguments
- deconv_res
A list containing results from the deconvolution process, including:
Deconvolution subgroups composition: the member features of each subgroup, per cell typeDeconvolution matrix: the original deconvolution result used to determine relevant features
- deconvolution_test
A data.frame or matrix of deconvolution results (e.g., from another cohort). If cell groups were aggregated with
aggregate_cell_groups()before computingdeconv_res, aggregate the same groups here first; otherwise their features are missing and are set toNA.
Value
A data.frame with the projected subgroup features proportions: the same features, in the same order, as
the "Deconvolution matrix" of deconv_res. Each subgroup is the median of its member features. Subgroups with
no member in deconvolution_test, and training features missing from it, are set to NA with a warning; a
warning also lists subgroups computed from only part of their members.