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

Running PEER regression with MOFA2 #3

Open
MarcElosua opened this issue Jun 27, 2024 · 0 comments
Open

Running PEER regression with MOFA2 #3

MarcElosua opened this issue Jun 27, 2024 · 0 comments

Comments

@MarcElosua
Copy link

Hi @rargelaguet

Thank you so much for developing MOFA2, such an amazing package!

I was trying to use PEER but saw this issue where you commented on how MOFA with 1 view was basically PEER.

I'm trying to re-run a previous analysis that had been run with PEER to regress out the effects of covariates of interest from gene expression data as shown below:

##################
#### Run PEER ####
##################
K <- 10
model = PEER()
PEER_setPhenoMean(model, as.matrix(t(norm_expression)))
PEER_setAdd_mean(model, TRUE)
PEER_setNk(model, K)
PEER_getNk(model)
PEER_setCovariates(model, as.matrix(covariates))
PEER_setNmax_iterations(model, 10000)
PEER_update(model)

# Save residuals
residuals = PEER_getResiduals(model)
colnames(residuals)  <- row.names(norm_expression)
row.names(residuals) <- colnames(norm_expression)
dump <- data.frame(ids = row.names(norm_expression), t(residuals), check.names=FALSE)

Is there a straight forward way to reproduce this with MOFA2?

Thank you very much for your help!

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

1 participant