This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to proceed after removing batch effect with limma?

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)
rna-seq deseq2 batch-effect limma

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.

dds <- DESeqDataSetFromMatrix( countData = countData,
                               colData = colData,
                              design = ~ batch + tissue )

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.

1 answer

Dear slapiv,

Some RNA-Seq guru might help here, but I think that, including batch in the design formula as you did, is fine and nothing else is required. (from DESeq2 vignette, Quick start section, ~ batch + tissue).

Usually what I do is to remove the batch effect from the normalized matrix for downstream purposes, like

vsd_nobatch <- removeBatchEffect(assay(vsd), batch = factor(sample_matrix$Batch))

Thanks Pietro, I have found the answer:

dds <- DESeq(dds, test="LRT", reduced=~batch)

Be careful because the Likelihood ratio test is just a different test from the default Wald test. The LRT is not something specifically related to the batch effect.

From DESeq2 vignette

"The LRT is therefore useful for testing multiple terms at once, for example testing 3 or more levels of a factor at once, or all interactions between two variables.".

Log in to answer this question.