Closed orange-3711 closed 4 months ago
Hi @orange-3711 . In the documentation of the function:
design
A design matrix relating to treatment conditions to be preserved, can be generated usingstats::model.matrix
function with all biological factors included.
So, say you're using model.matrix(~0 + bio_var1 + bio_var2, data = colData(spe))
in the geomxBatchCorrection
function with the method = "limma"
and batch = colData(spe)$batch
. And you're happy with the normalization output by verified in PCA & RLE.
Then, your should use the raw count in your DGElist when doing DE, and your design would be model.matrix(~0 + bio_var1 + bio_var2 + batch, data = colData(spe))
So, besides the addition of the batch variable, other covariates should be consistent.
Hi @ningbioinfo ! Do the variables used to
model.matrix
for differential gene analysis need to be consistent with the variables of interest in batch effect removal? I used inconsistent variables and the results were not very good. I hope you can answer my questions, thank you.