Question: How to proceed after removing batch effect with limma?
0
gravatar for slapiiv
11 days ago by
slapiiv40
slapiiv40 wrote:

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)
ADD COMMENTlink modified 11 days ago by Pietro70 • written 11 days ago by slapiiv40
1

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 )
ADD REPLYlink modified 11 days ago • written 11 days ago by h.mon26k

Thanks h.mon, so, basically I just can remove it for visualization but not for the calculation of DE?

ADD REPLYlink modified 11 days ago • written 11 days ago by slapiiv40

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.

ADD REPLYlink modified 11 days ago • written 11 days ago by swbarnes26.0k
1
gravatar for Pietro
11 days ago by
Pietro70
Italy
Pietro70 wrote:

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))
ADD COMMENTlink modified 11 days ago • written 11 days ago by Pietro70

Thanks Pietro, I have found the answer:

dds <- DESeq(dds, test="LRT", reduced=~batch)
ADD REPLYlink written 11 days ago by slapiiv40

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.".

ADD REPLYlink modified 11 days ago • written 11 days ago by Pietro70
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2077 users visited in the last hour