Question: SVA: Including variable of interest in ComBat model matrix
gravatar for John Townsend
2.6 years ago by
John Townsend20 wrote:

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 ( 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 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?



ADD COMMENTlink modified 2.6 years ago by W. Evan Johnson770 • written 2.6 years ago by John Townsend20
gravatar for W. Evan Johnson
2.6 years ago by
United States
W. Evan Johnson770 wrote:


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. 



ADD COMMENTlink written 2.6 years ago by W. Evan Johnson770

Thanks for the quick reply Evan! That helps a lot

ADD REPLYlink written 2.6 years ago by John Townsend20



ADD REPLYlink modified 16 months ago • written 16 months ago by alerodriguez0
Please log in to add an answer.


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