Question: what is the meaning of covariates in ComBat
0
gravatar for LJ
3.8 years ago by
LJ210
LJ210 wrote:

Can anyone tell me what the difference between the following code1 and code2 is?

code1:

 pheno<-read.table(file="pdata.txt",header=T,row.names=1)
    head(d)
         subgroups batch
    sample1   1     1
    sample2   1     1
    sample3   1     1
    sample4   4     1
    sample5   1     1
    sample6   4     1
    batch<-pheno$batch
    subgroups<-pheno$subgroups
modcombat1<-model.matrix(~1, data=pheno)
combat_mydata<-ComBat(dat=mydata, batch=batch, mod=modcombat1, par.prior=TRUE, prior.plots=FALSE)

code2:

 pheno<-read.table(file="pdata.txt",header=T,row.names=1)
        head(d)
             subgroups batch
        sample1   1     1
        sample2   1     1
        sample3   1     1
        sample4   4     1
        sample5   1     1
        sample6   4     1
        batch<-pheno$batch
        subgroups<-pheno$subgroups
    modcombat2<-model.matrix(~subgroups, data=pheno)
    combat_mydata<-ComBat(dat=mydata, batch=batch, mod=modcombat2, par.prior=TRUE, prior.plots=FALSE)

To put it simply,what is the difference in mod with or without the covariate level? What is the purpose of including covariates in the mode? And which one should i choose for only batch effects removal but biological variation from the subgroups retained? Many thanks.

combat R • 2.6k views
ADD COMMENTlink modified 3.8 years ago • written 3.8 years ago by LJ210

Can you share your data matrix and genotype information ? I would like to run my code on your data.

ADD REPLYlink modified 3.8 years ago • written 3.8 years ago by Ar930

Could you please share your code ?

ADD REPLYlink written 2.0 years ago by ding_wu_bin0
0
gravatar for LJ
3.8 years ago by
LJ210
LJ210 wrote:

nobody has an answer?

ADD COMMENTlink written 3.8 years ago by LJ210
1

I'm not an expert on ComBat, but neither code seems to make any sense. You only have one batch in both cases, so there is no batch effect to correct for. Using ComBat does not make any sense.

Now, I'm less sure about the correct code if you had put more than one batch. I think only the first code is correct. You would consider any differences between the subgroups to be due to biological differences, so there would be no need to adjust for them? Anyway, this is how I use ComBat to remove batch effect (obviously I have more than just one batch, as in this example). Someone smarter and more knowledgeable than me will probably come up with a better answer.

ADD REPLYlink written 3.8 years ago by ablanchetcohen1.2k
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 2.3.0
Traffic: 994 users visited in the last hour