Hi everyone, I have visualized some batch effects in my sequencing replicates and I have removed with the limma package as follows.
mat <- limma::removeBatchEffect(mat, vsd$batch)
After that, batch effect has been at least minimized and the PCA looks very good as I expected, however, at this point how can I proceed after this process? Can I use the normalized matrix for deseq? How can I perform the DE with the new matrix? is that possible? My deseq object looks like:
dds <- DESeqDataSetFromMatrix(countData = countData
, colData = colData
, design = ~ tissue + batch)
The DESeq2 vignette says the
limma::removeBatchEffect( )
function is used only for visualization. The Quick start section of the vignette already shows how to control for simple batch effects, the issue is discussed in other sections of the vignette as well.Thanks h.mon, so, basically I just can remove it for visualization but not for the calculation of DE?
You do not remove batch effect to calculate DE genes, you include it as a factor in the linear model by putting it in the design just like you did. It's magically simple.