Limma package, how to correct by age and sex?
1
3
Entering edit mode
4.9 years ago
ellen2270 ▴ 30

Hello everyone,

I am analyzing microarray data with limma package and I have a couple of doubts as it is the first time I use it. I have 3 conditions which I want to compare. My data looks like this:

Condition   AGE SEX
0   64  Male
0   65  Female
1   67  Male
1   60  Male
2   58  Male
2   65  Female

I want to correct the results by sex and age as there are slightly differences in sex and age between groups. I have came with two different codes to correct by age/sex and I obtain different results. Do you think the code I am using is correct to adjust by age and sex. Which strategy is better?

  1. Introducing sex and age in the model:

     design <- model.matrix(~0+Condition+as.numeric(AGE)+SEX,targets)
     fit <- lmFit(y,design)
     cont.matrix <- makeContrasts(P1="1-0",
     P2=”1-2”,
     P3=”2-0”, levels=design)
    
     fit2  <- contrasts.fit(fit, cont.matrix)
     fit3  <- eBayes(fit2)
     topTable(fit3, coef=1, n=Inf, adjust="BH")
    
  2. Using the function RemoveBatchEffect

     y_correct<-removeBatchEffect(y,batch=(targets$SEX),covariates=(targets$AGE)
     design <- model.matrix(~0+Condition)
     fit <- lmFit(y_correct,design)
     cont.matrix <- makeContrasts(P1="1-0",
     P2=”1-2”,
     P3=”2-0”, levels=design)
    
     fit2  <- contrasts.fit(fit, cont.matrix)
     fit3  <- eBayes(fit2)
     topTable(fit3, coef=1, n=Inf, adjust="BH")
    

Can anyone confirm me which method would be more correct and confirm me that it make sense? Thankyou

microarrays limma batch-effect • 5.5k views
ADD COMMENT
4
Entering edit mode
3.1 years ago
Gordon Smyth ★ 7.0k

The first approach is correct while the second is not. The help page for removeBatchEffect warns against the second approach.

ADD COMMENT
0
Entering edit mode

Following up on ellen2270: If Sex and Age are not considered batch, but rather covariates: How do I then obtain values for scatterplot representation of the expression values after the covariate adjustment? Scatterplots of logCPM do not always show the logFC that are in the topTable if covariates are included in the model. If Sex or Age are not a batch, so I would not like to include them in the removeBatchEffect function.

ADD REPLY
0
Entering edit mode

removeBatchEffect() can adjust for an arbitrary number of covariates as well as batch factors. Please see the documentation ?removeBatchEffect.

ADD REPLY

Login before adding your answer.

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