Skip to content

Running PEER regression with MOFA2 #3

@MarcElosua

Description

@MarcElosua

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions