GabrielHoffman / dreamlet

Perform differential expression analysis on multi-sample single cell datasets using linear mixed models
https://gabrielhoffman.github.io/dreamlet
20 stars 4 forks source link

Metadata columns dropped during aggregation #28

Open jindalk opened 2 days ago

jindalk commented 2 days ago

Hi, I'm curious to know how dreamlet decides which metadata columns to drop during the data aggregation step. I added a new factor column that I intend to use in the DE formula, but it keeps getting dropped during the aggregation step.

Thanks, Kunal

GabrielHoffman commented 1 day ago

See https://diseaseneurogenomics.github.io/dreamlet/articles/cell_covs.html

But in more detail...

colData(sce) stores information about each cell stored in sce. aggregateToPseudoBulk() sums the expression values across cells from the same donor and cell type, and summarizes the information in colData(sce) for use in downstream analysis. A variable in colData(sce) is handled according to

1) if the variable is continuous, the mean per donor/cell type is stored in metadata(pb)$aggr_means 2) if the variable is discrete and constant within each donor/cell type, it is stored in colData(pb) 3) if it is discrete, and variants within each donor/cell type, it is dropped