Question: Running ComBat Without a Batch Argument to Correct for Continuous, Numeric Covariates
0
gravatar for JMallory
18 months ago by
JMallory0
JMallory0 wrote:

Is there a way to use ComBat to return a data matrix adjusted by only numeric covariates? As implemented in SVA, ComBat allows for adjustment of data by numeric covariates, but only if a batch effect (i.e., a factor variable) is also provided. What if I just want to "clean" a data matrix of several continuous, numeric nuisance variables (e.g., surrogate variables as identified by SVA)? Specification of the nuisance variables in a linear model is not possible, as I am attempting to apply k-means clustering to the data. 

sva combat • 483 views
ADD COMMENTlink modified 18 months ago by W. Evan Johnson800 • written 18 months ago by JMallory0
Answer: Running ComBat Without a Batch Argument to Correct for Continuous, Numeric Covar
1
gravatar for Peter Langfelder
18 months ago by
United States
Peter Langfelder1.8k wrote:

To my knowledge, there's no way to use ComBat to adjust for continuous variables. The WGCNA package (over on CRAN) has an implementation of Empirical Bayes-moderated linear model regression (function empiricalBayesLM) that works with either continuous or categorical variables but unlike ComBat, it does not do anything with the variances. If you are a ComBat user, do note that there are some differences between the arguments to ComBat and to empiricalBayesLM, especially the row and column interpretation of the input and output data.

ADD COMMENTlink modified 18 months ago • written 18 months ago by Peter Langfelder1.8k

Peter, I have used WGCNA in the past, but was unaware of this function. As per its description in the documentation, it does exactly what I have been trying to get at for the past few weeks. Criminally underappreciated bit of code. Thank you.  

ADD REPLYlink written 18 months ago by JMallory0
1

It is a relatively new function, and it was not widely (in fact, at all) advertised.

ADD REPLYlink written 18 months ago by Peter Langfelder1.8k
Answer: Running ComBat Without a Batch Argument to Correct for Continuous, Numeric Covar
0
gravatar for Gordon Smyth
18 months ago by
Gordon Smyth37k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth37k wrote:

As already noted, you can't do that in ComBat. An alternative is removeBatchEffect() in the limma package, which will remove effects for one or more continuous variables.

ADD COMMENTlink modified 18 months ago • written 18 months ago by Gordon Smyth37k
Answer: Running ComBat Without a Batch Argument to Correct for Continuous, Numeric Covar
0
gravatar for W. Evan Johnson
18 months ago by
United States
W. Evan Johnson800 wrote:

Yes, Gordon and others are correct. ComBat can handle continuous covariates, but cannot handle continuous batch variables. ComBat assumes you are giving a discrete batch variable as input, and sets up indicator variables for each level of the given batch variable. So if you gave a continuous vector, it would make indicator variables for each level in your vector.

However, if needed, the ComBat code could easily be hacked to do what you want--i.e. just skip the indicator variable setup step. Send me a personal message if you would like some help on this. 

Evan 

ADD COMMENTlink written 18 months ago by W. Evan Johnson800
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 16.09
Traffic: 318 users visited in the last hour