I have an experiment where I perform pseudobulk differential expression using limma-voom. In particular, I obtain expression profiles of cell types A and B from two subtypes of tumor samples X and Y. However, some of the tumor samples come from the same patient. I want to compare the difference between X and Y while adjusting for cell type and controlling for the fact that there are pairs of cell types coming from each sample and some samples come from the same patient. I am wondering what the best approach would be? So far, I use the model
~ cell_type + subtype
and use duplicateCorrelation with block = patient (treating patient as a random effect). However, I feel like this ignores the hierarchical nature of the paired cell types per sample, and some samples matched to the same patient. Is there any way to use duplicateCorrelation to capture this hierarchical design?