Groups the features of one cell type by complete-linkage hierarchical clustering on their correlations:
features end up in the same subgroup only if every pair of them correlates at least thres_corr
(non-significant correlations, p >= 0.05, count as 0). Each subgroup is replaced by the row median of
its members. The result does not depend on the column order.
Arguments
- deconvolution
A matrix with the deconvolution features of one cell type (samples as rows)
- thres_corr
A numeric value with the minimum correlation allowed to group cell deconvolution features
- corr_type
Correlation type whether "spearman" or "pearson".
- file_name
Cell type name, used as prefix of the subgroup names (
<file_name>_Subgroup.<i>)- batch
Optional batch labels, one per sample in the same order as the rows. A factor or character is treated as categorical: correlations become partial correlations controlling for one indicator column per batch. A numeric vector is used as a single linear covariate.
