bioFAM / MOFA

Multi-Omics Factor Analysis
GNU Lesser General Public License v3.0
235 stars 60 forks source link

variable %in% names(object@Expectations) is not TRUE #10

Closed rosshandler closed 6 years ago

rosshandler commented 6 years ago

Hi,

I have been trying to reproduce the example in your R vigenette, but I am getting an error which should be something very simple to fix when running calculateVarianceExplained(). I just don't see where this error can be. Please could you help me with this issue?

Here is my code (the same as in R vignette essentially):

require(MOFAtools)

data("CLL_data") MOFAobject <- createMOFAobject(CLL_data) ModelOptions <- getDefaultModelOpts(MOFAobject) TrainOptions <- getDefaultTrainOpts() TrainOptions$maxiter <- 5 MOFAobject <- prepareMOFA(MOFAobject, DirOptions = DirOptions, ModelOptions = ModelOptions, TrainOptions = TrainOptions ) r2 <- calculateVarianceExplained(MOFAobject) Error: variable %in% names(object@Expectations) is not TRUE

rargelaguet commented 6 years ago

Hi, you are missing the training model step! MOFAobject <- runMOFA(MOFAobject, DirOptions)

rosshandler commented 6 years ago

Thanks a lot for the quick answer!