Method for batch correction
2
0
Entering edit mode
AST ▴ 60
@ast-8648
Last seen 2.6 years ago
INDIA

Hi,

I have been using Combat to correct the batch effect in 450k data (~10 batches). Recently, I read an old reply from Dr. Peter Langfelder where he mentioned that  "ComBat should NOT be used before running association testing (lmFit); association testing should be run with batch as a covariate on original data."

I have read the paper from Combat authors where they mentioned that Combat performs better than SVD when sample size is small and comparably similar for large sample size.

Now, my question is since my sample size is large and I am using limma for calculating differential methylation, should I be adjusting batch directly in limma as a covariate (or use removeBatchEffect(), not sure about this, as this will again be like removing batch separately) 

batch <- pheno$batch
BSC <- pheno$BSC_batch
group <- factor(targets$status,levels=c("Control","Case"))
design <- model.matrix(~targets$Age+batch+BSC+group)
fit <- lmFit(Mval, design)

or should I continue with Combat for removing batch and limma for adjusting other biological covariates?

MvalC <- ComBat(Mval, batch=batch, mod=NULL, par.prior = TRUE, prior.plots = FALSE)
modcombat <- model.matrix(~target$Age, data=pheno)
MvalC1 <- ComBat(MvalC, batch=BSC, mod=NULL, par.prior = TRUE, prior.plots = FALSE)
design <- model.matrix(~targets$Age+group)
fit <- lmFit(MvalC1, design)

(I corrected for Chip batch and BSC batch separately, as they were confounded and limma was showing error.)

combat sva limma • 4.5k views
ADD COMMENT
2
Entering edit mode

You've answered your own question with Peter's quote (for anyone who's interested, the original is at C: Limma, blocking batch effect). That you have large sample sizes and are doing differential methylation does not change the correctness of his advice.

ADD REPLY
1
Entering edit mode

The only part I didn't understand (as he also didn't elaborate it) in that comment is: how does it make difference, if I remove batch first, then adjust for covariates while doing differential analysis?

Also, I have seen many people used limma function removeBatchEffect() to remove batch prior to any differential analysis. I guess that will also not be a correct approach

ADD REPLY
3
Entering edit mode

It's got to do with the true number of residual d.f. and the uncertainty of the model parameters. I believe I gave you a more complete answer at C: Adjustment of covariates in 450k data using Limma, but to sum up; batch removal is not perfect. Like any statistical procedure, it is subject to errors (e.g., from imprecise estimation of the batch effect), and if you don't model those errors during the DE analysis, then your analysis will not be correct. Blocking on the batch effect in the linear model will account for those errors and is the right approach; removing the batch effect before modelling is not.

ADD REPLY
0
Entering edit mode

Thanks Aaron, I was also doubting that it has to do with the residual D.f. Thanks once again for clarifying.

ADD REPLY
3
Entering edit mode
@w-evan-johnson-5447
Last seen 6 months ago
United States

My recommendation is to try using ComBat and then also including a batch covariate in your model. This accounts for any residual df problems (mentioned above) and allows you to use the extra benefits of ComBat that are not available by just using a blocking factor (i.e. adjusting for differences in batch variance). 

To elaborate further: if there are no variance differences between the batches, adding a blocking factor is just fine--there will be no difference in using ComBat or a blocking factor. However, this is not common--in most cases the batch effect impacts both the means and variances across batches. The greater the differences in variance between batches, the greater benefit you will see from using ComBat+Limma(plus batch covariate) versus Limma (plus batch) alone.  

 

ADD COMMENT
0
Entering edit mode

Thank you Evan. Will try to follow your suggestion to see if there are any significant differences in my results.

ADD REPLY
1
Entering edit mode
@vegard-nygaard-6284
Last seen 4.8 years ago
Norway


My colleagues and I spent considerable time looking into problems with attempting to remove the batch effect, which resulted in the article:
http://biostatistics.oxfordjournals.org/content/17/1/29

I do not disagree with the other answers from Evan and Aaron. I will explain using somewhat different words why you should avoid your second alternative.

ComBat, removeBatchEffect and similar methods can not truly remove the batch effect, nor can they create a batch effect free data set. For that to happen, the true batch effect must be known, which rarely is the case. Instead, as in your example, it is estimated from the data and it is this estimated batch effect that is removed from the data. Thus the difference between the true batch effect and the estimate, i.e. the estimation error, will be present in your adjusted data. This estimation error is in itself a batch effect. So this procedure swaps one batch effect with another, one problem with another quite similar problem. It can be hard to tell to which degree the second batch effect is detrimental, but be aware that it will be there even if you start out with no true batch effect.

So your second analysis alternative is problematic because when you use ComBat you ensure your data has a batch effect (the estimation error). When this batch effect is ignored in your subsequent limma analysis, unreliable p-values may be the result (depending on other circumstances like experiment design)

Your first alternative is more a safe textbook-like way of doing it.

 

ADD COMMENT
0
Entering edit mode

Thank you Vegard. The article surely is very helpful in this regard.

ADD REPLY
0
Entering edit mode

Sorry for the delayed response. I just want to point out that the second alternative DID NOT advocate using ComBat + LIMMA without a batch covariate, which does, as their paper describes, lead to exaggerated significance in studies with unbalanced experimental design.

It DOES advocate using ComBat followed by LIMMA with a batch covariate. Therefore the conditions, results, and concerns of the aforementioned paper do not apply here. The approach suggested above is a perfectly reasonable solution and in many cases outperforms the one step alternative while retaining the appropriate and expected statistical test behaviors. 

ADD REPLY
0
Entering edit mode

Hi Evan, piggy backing of this thread since I have the same issue.  So I wanted to be clear what you are suggesting.  If I have an experiment (Drug vs. control) and did this experiment on 3 separate cell lines and mainly care about the effect of drug.  Can I run combat to correct for cell line and then use the output of the matrix in my model correcting for cell line.  For example. 

1. correct for batch (cell line)
2. design <-  model.matrix(~0+ key$group + key$cell  )
3.  lmFit( corrrected.matrix , design)

would this work? 
Thanks in advance. 

Ahdee

ADD REPLY

Login before adding your answer.

Traffic: 755 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6