bioFAM / MOFA

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

Error with runMOFA #18

Closed anso-sertier closed 6 years ago

anso-sertier commented 6 years ago

Hello,

I'm currently testing MOFA with the CLL data given in the vignette and I obtained this error :

> MOFAobject <- createMOFAobject(CLL_data)
Creating MOFA object from list of matrices,
 please make sure that samples are columns and features are rows...

> MOFAobject
Untrained MOFA model with the following characteristics:
  Number of views: 4
  View names: Drugs Methylation mRNA Mutations
  Number of features per view: 310 4248 5000 69
  Number of samples: 200

> DataOptions <- getDefaultDataOptions()
> ModelOptions <- getDefaultModelOptions(MOFAobject)
> TrainOptions <- getDefaultTrainOptions()
> TrainOptions$DropFactorThreshold <- 0.02
> MOFAobject <- prepareMOFA(
+   MOFAobject,
+   DataOptions = DataOptions,
+   ModelOptions = ModelOptions,
+   TrainOptions = TrainOptions
+ )
Checking data options...
Checking training options...
Checking model options...

> MOFAobject <- runMOFA(MOFAobject, outfile=tempfile())
Error in mapply(function(from, to) paste(lines[from:to], collapse = "\n"),  :
  zero-length inputs cannot be mixed with those of non-zero length

i've installed the python part and working with R-3.4.1 Do you have any idea of the problem's origin ?

Thanks in advance for your help

Anne-Sophie

rargelaguet commented 6 years ago

Hi Anne-Sophie, it seems to be an error from one of the dependencies, but I can't immediately tell what is the error.

First, make sure you have all packages updated, particularly reticulate. Second, if you have multiple versions of python installed (using for example conda environments), try to set the appropriate one using reticulate::use_python("/xx/yy/python"). If so, we recommend that you use Python 3.X Third, can you test if you can load the trained model we provide? Do the downstream analysis functions work?

Best, Ricard.

anso-sertier commented 6 years ago

Hi Ricard

Thanks a lot for your answer. It seems that the problem comes from python. I'm currently using python 2.7.12. The reticulate library generates random bugs. The mapply error appear when I try to import mofa (import("mofa").

library(reticulate)
use_python("/home/anneso/myroot/bin/python",required = T)

the "py_config()" function does not return the config each time : some times I have

python:         /home/anneso/myroot/bin/python
libpython:      /home/anneso/myroot/lib/libpython2.7.so
pythonhome:     /home/anneso/myroot:/home/anneso/myroot
version:        2.7.12 (default, Oct  6 2016, 12:58:59)  [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)]
numpy:          /home/anneso/myroot/lib/python2.7/site-packages/numpy
numpy_version:  1.14.5

NOTE: Python version was forced by use_python function

and on another R session, the same commands results to a segfault :

 *** caught segfault ***
address 0x7fcb5e6dfd98, cause 'memory not mapped'

Traceback:
 1: .Call(`_reticulate_py_initialize`, python, libpython, pythonhome,     virtualenv_activate, python3, interactive, numpy_load_error)
 2: py_initialize(config$python, config$libpython, config$pythonhome,     config$virtualenv_activate, config$version >= "3.0", interactive(),     numpy_load_error)
 3: initialize_python(required_module, use_environment)
 4: ensure_python_initialized()
 5: py_config()

Thus I'm currently installing Python 3.6 (then rebuild mofa) and I will see if this fixes the bug.

Wait and see.

Best regards,

Anne-Sophie

anso-sertier commented 6 years ago

Hi Ricard,

it works with python 3.6 :-)

Best regards,

Anne-Sophie

rargelaguet commented 6 years ago

Ok, I will add a Python=3.X requirement so that other users don't face the same problem. Thanks for checking!