This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to run removeBatchEffect function?

Hi,

I have design matrix which looks like this:

> head(design)
           (Intercept) SMTSISCH SMRIN AGE         SV1         SV2         SV3
GTEX-1122O           1     1363  10.0  64  0.01910439 -0.06545069 -0.01824558
GTEX-11EM3           1     1143  10.0  21 -0.04396299  0.01697547 -0.02650350
GTEX-11EMC           1      635  10.0  66  0.09344163 -0.07081073 -0.06936307
GTEX-11EQ9           1     -165  10.0  33 -0.02218303 -0.03554120  0.01874942
GTEX-11I78           1      -86   9.9  51 -0.10036574 -0.03280440 -0.11325196
GTEX-11OC5           1     1171   9.9  62  0.01629396  0.24493439 -0.09722282

Then I run this:

v <- voom(count, design, plot=F)
vfit <- lmFit(v, design)

And I am trying to remove the batch effects via:

> y <- removeBatchEffect(vfit, covariate=design)
Error in getEAWP(object) : data object isn't of a recognized data class

Can someone please tell me in what format my data should be for this function to run?

Thanks Ana

limma removebatcheffect

1 answer

You don't want the fit being passed to the function, you want something that can be processed by the getEAWP function - such as the voom object (v in your case). getEAWP will get the right information from your voom object, but it's expecting an expression matrix as input. Check out the parameter details by running ?removeBatchEffect:

numeric matrix, or any data object that can be processed by getEAWP containing log-expression values for a series of samples. Rows correspond to probes and columns to samples.

Hi,

thanks. I did run it like this:

y <- removeBatchEffect(v, covariate=design)

This gives me a matrix of residuals, correct?

Ana

Log in to answer this question.