How to set mod0 in sva analysis
1
0
Entering edit mode
hank9cao • 0
@hank9cao-11753
Last seen 3.0 years ago
Germany

Dear all,

I was using sva to detect the hidden batch effects and remove them using linear regression. I felt confused to set mod and mod0 matrix properly in our application, any form of guidance was appreciated.

Setting 1

Suppose I have the covariates i.e. age and gender. According to the tutorial [1], it seems I have to set mod and mod0 matrix as:

mod = model.matrix(~Diagnosis+age+gender, data=metaExp)
mod0 = model.matrix(~age+gender+1, data=metaExp)
#Then the sva algorithm was performed:
SVAsol = sva(dat=t(X), mod=mod, mod0=mod0, n.sv=10)

However, in this way, I found the hidden variables were still significantly correlated to age and gender, where I suppose there should be no correlations.

Setting 2

Alternatively, one of my colleagues suggest to set mod0 matrix as

mod0 = model.matrix(~+1, data=metaExp)

In this way, I do found no correlations between the hidden variables and the known covariates.

Could anyone let me know the appropriate setting of mod and mod0 matrix? Also, could you comment on the difference and influence of these two settings?

1, https://bioconductor.org/packages/release/bioc/vignettes/sva/inst/doc/sva.pdf

Regards, Hank

sva • 1.7k views
ADD COMMENT
0
Entering edit mode
Robert Castelo ★ 3.4k
@rcastelo
Last seen 5 days ago
Barcelona/Universitat Pompeu Fabra

I'd say setting 1 but you should remove the term +1 in the call that creates mod0. You can also check out the answer by Jeff Leek, the author of SVA, to a nearly identical question here posted some years ago.

cheers,

robert.

ADD COMMENT

Login before adding your answer.

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