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

Problem to use mofaOBJECT #62

Open
geraldocantelli opened this issue Dec 3, 2020 · 2 comments
Open

Problem to use mofaOBJECT #62

geraldocantelli opened this issue Dec 3, 2020 · 2 comments

Comments

@geraldocantelli
Copy link

geraldocantelli commented Dec 3, 2020

Good afternoon,
I am trying to use MOFA with my own data but when I create a MOFA object and try to set the environment to run MOFA I get the following error;

$scaleViews
[1] FALSE

$removeIncompleteSamples
[1] FALSE

Error in data[!is.na(data)]%%1 :
argument non-numéric to binary operator
Calls: getDefaultModelOptions -> .inferLikelihoods
interrupts

My code is:
library(MultiAssayExperiment)
library(MOFA)
library(MOFAdata)
library(reticulate)

Using a specific python binary

use_python("/usr/local/bin/python")

transcriptome <- read.table ("/home/geraldo/eclipse-workspace/wsapp/WebContent/apprMOFA/transcriptome.csv", sep = "\t", header = FALSE)

dfT <- data.frame(transcriptome)

metabolome <- read.table ("/home/geraldo/eclipse-workspace/wsapp/WebContent/apprMOFA/metabolome.csv", sep = "\t", header = FALSE)

dfM <- data.frame(metabolome)

allLists <- list ("transcriptoma" = dfT,"metaboloma" = dfM)

#data("CLL_data")

MOFAobject <- createMOFAobject(allLists)

DataOptions <- getDefaultDataOptions()

DataOptions

ModelOptions <- getDefaultModelOptions(MOFAobject)

TrainOptions <- getDefaultTrainOptions()

TrainOptions

MOFAobject <- prepareMOFA(
MOFAobject,
DataOptions = DataOptions,
ModelOptions = ModelOptions,
TrainOptions = TrainOptions
)

outfile = file.path(getwd(),"model.hdf5")

MOFAobject.trained <- runMOFA(MOFAobject, outfile)

Could someone say how to set inferLikelihoods correctly or what can I do in order to code run, please?

The file data: metabolome.csv
metaboloma spontL1 sp80
metaboloma A 10.0 1.0
metaboloma B 5.0 5.0
metaboloma C 1.0 10.0
metaboloma A 10.0 1.0
metaboloma B 5.0 5.0
metaboloma C 1.0 10.0
metaboloma A 10.0 1.0
metaboloma B 5.0 5.0
metaboloma C 1.0 10.0
metaboloma A 10.0 1.0
metaboloma B 5.0 5.0
metaboloma C 1.0 10.0

And transcriptome.csv is the same with the word "transcriptoma".

Best regards,
Geraldo

@rargelaguet
Copy link
Contributor

Hi Geraldo,
is the data normalised in any way? the input data should be continuous, not discrete.

P.S. Please switch to MOFA2 (https://biofam.github.io/MOFA2/), which is also available via bioconductor (http://bioconductor.org/packages/release/bioc/html/MOFA2.html). MOFA v1 is depreciated

@geraldocantelli
Copy link
Author

Thank you very much for the answer.
So I was testing with wrong values, I am going to use continuous data now and I will update to MOFA2.
Best regards,
Geraldo

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