SVA: Including variable of interest in ComBat model matrix
1
2
Entering edit mode
@john-townsend-10170
Last seen 8.6 years ago

Hi there,

I'm trying to remove batch effects from some high-throughput data using the ComBat function in the sva package. It's not clear in the current tutorial guide (https://bioconductor.org/packages/release/bioc/vignettes/sva/inst/doc/sva.pdf) whether the variable of interest should be included or not in the model matrix.

In Section 7 it currently reads "Just as with sva, we then need to create a model matrix for the adjustment variables, including the variable of interest." However, the code given to set up the model matrix is:

> modcombat = model.matrix(~1, data=pheno)

It should be something like this if the variable of interest is to be included:

> modcombat = model.matrix(~as.factor(cancer), data=pheno)

So can anyone clarify which one it is? I know there were some similar questions raised around a year and a half ago (see https://support.bioconductor.org/p/63007/) after the ComBat developers started recommending not to include the any variables. So I'm wondering why the tutorial has been updated again to now say include the variables without updating the code to set up the model matrix. Is the old issue with including the variables fixed?

Cheers,

John

combat sva SVA sva ComBat batch effect • 3.4k views
ADD COMMENT
5
Entering edit mode
@w-evan-johnson-5447
Last seen 5 months ago
United States

John, 

Sorry for the confusion. Yes, the variable of interest should be included. We will update the example to reflect this. 

Also, note: if you are doing differential expression (e.g. using LIMMA), you should also include a 'batch' variable in the model even when using the batch adjusted data. 

Thanks!

Evan

ADD COMMENT
0
Entering edit mode

Thanks for the quick reply Evan! That helps a lot

ADD REPLY
0
Entering edit mode

 

 

ADD REPLY

Login before adding your answer.

Traffic: 748 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