How to run removeBatchEffect function?
1
1
Entering edit mode
5.5 years ago
anamaria ▴ 220

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 • 2.2k views
ADD COMMENT
3
Entering edit mode
5.5 years ago

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.

ADD COMMENT
0
Entering edit mode

Hi,

thanks. I did run it like this:

y <- removeBatchEffect(v, covariate=design)

This gives me a matrix of residuals, correct?

Ana

ADD REPLY
0
Entering edit mode

yep, that's correct.

ADD REPLY

Login before adding your answer.

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