Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need help #10

Open
madhu9 opened this issue Mar 6, 2020 · 1 comment
Open

need help #10

madhu9 opened this issue Mar 6, 2020 · 1 comment

Comments

@madhu9
Copy link

madhu9 commented Mar 6, 2020

Hi,
I am exploring the vicar package for batch correction.
I wanted to know, is there is a way to export batch-corrected matrix as output.

Thanks

@dcgerard
Copy link
Owner

Hey @madhu9,

Thanks for your interest in vicar!

vicar will return the estimated confounders (the object Zhat in the returned list). It is generally recommended that you do any analysis jointly with Zhat rather than first subtracting off the effect due to Zhat. This is because if you export a batch-corrected matrix and then proceed with your analysis, then you are effectively assuming that any observed covariates are independent of the unobserved confounders, which can be a bad assumption. This is why vicar does not export such a matrix by default.

As long as you are doing a differential expression analysis and you are only interested in one covariate, then vicar will do this entire analysis for you.

But you can obtain a "batch-corrected" matrix via:

Ynew <- Y - mout$Zhat %*% mout$alphahat

Where Y is the matrix of responses. (Again, I would generally not recommend this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants