bioFAM / MOFA

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

Issue with runMOFA(object) #55

Closed vd4mmind closed 4 years ago

vd4mmind commented 4 years ago

Hi,

I am having a similar issue as reported in https://github.com/bioFAM/MOFA/issues/50

However, I am running it via the R Studio server. Error" Error in value[[3L]](cond) : mofapy package not found. Make sure that Reticulate is pointing to the right Python binary. Please read the instructions here: https://github.com/bioFAM/MOFA#installation My pyconfig() shows version as python3.6 numpy_version: 1.18.1

Below is my sessioninfo()

sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] reticulate_1.14             biomaRt_2.42.0              MOFAdata_1.2.0              MOFA_1.2.0                 
 [5] MultiAssayExperiment_1.12.6 SummarizedExperiment_1.16.1 DelayedArray_0.12.2         BiocParallel_1.20.1        
 [9] matrixStats_0.55.0          Biobase_2.46.0              GenomicRanges_1.38.0        GenomeInfoDb_1.22.0        
[13] IRanges_2.20.2              S4Vectors_0.24.2            BiocGenerics_0.32.0         forcats_0.4.0              
[17] stringr_1.4.0               dplyr_0.8.3                 purrr_0.3.3                 readr_1.3.1                
[21] tidyr_1.0.0                 tibble_2.1.3                ggplot2_3.2.1               tidyverse_1.3.0            
[25] gdata_2.18.0               

loaded via a namespace (and not attached):
 [1] ggbeeswarm_0.6.0       colorspace_1.4-1       XVector_0.26.0         fs_1.3.1               rstudioapi_0.10       
 [6] farver_2.0.3           ggrepel_0.8.1          bit64_0.9-7            AnnotationDbi_1.48.0   fansi_0.4.1           
[11] lubridate_1.7.4        xml2_1.2.2             codetools_0.2-16       doParallel_1.0.15      zeallot_0.1.0         
[16] jsonlite_1.6           packrat_0.5.0          broom_0.5.3            dbplyr_1.4.2           pheatmap_1.0.12       
[21] BiocManager_1.30.10    compiler_3.6.0         httr_1.4.1             backports_1.1.5        assertthat_0.2.1      
[26] Matrix_1.2-18          lazyeval_0.2.2         cli_2.0.1              prettyunits_1.1.0      tools_3.6.0           
[31] gtable_0.3.0           glue_1.3.1             GenomeInfoDbData_1.2.2 reshape2_1.4.3         rappdirs_0.3.1        
[36] Rcpp_1.0.3             cellranger_1.1.0       vctrs_0.2.1            nlme_3.1-143           iterators_1.0.12      
[41] rvest_0.3.5            lifecycle_0.1.0        gtools_3.8.1           XML_3.99-0.1           zlibbioc_1.32.0       
[46] scales_1.1.0           hms_0.5.3              rhdf5_2.30.1           RColorBrewer_1.1-2     curl_4.3              
[51] memoise_1.1.0          stringi_1.4.5          RSQLite_2.2.0          corrplot_0.84          foreach_1.4.8         
[56] rlang_0.4.2            pkgconfig_2.0.3        bitops_1.0-6           lattice_0.20-38        Rhdf5lib_1.8.0        
[61] cowplot_1.0.0          bit_1.1-15.1           tidyselect_0.2.5       plyr_1.8.5             magrittr_1.5          
[66] R6_2.4.1               generics_0.0.2         DBI_1.1.0              pillar_1.4.3           haven_2.2.0           
[71] withr_2.1.2            RCurl_1.95-4.13        modelr_0.1.5           crayon_1.3.4           BiocFileCache_1.10.2  
[76] progress_1.2.2         grid_3.6.0             readxl_1.3.1           blob_1.2.1             reprex_0.3.0          
[81] digest_0.6.23          openssl_1.4.1          munsell_0.5.0          beeswarm_0.2.3         vipor_0.4.5           
[86] askpass_1.1  

Any idea how to get a workaround? I tried to source the runMOFA9() separately as well but it did not work.

Kind regards,

VD

vd4mmind commented 4 years ago

Here is my solution after working out a few trial and error.

I was able to install mofapy , MOFAv1 and MOFAv2 in my R Studio session server. However, there are multiple python binaries in the server and I also have installed quite a few. Hence, I had to get back to a few people for solutions. @rargelaguet and dfermin inputs were very beneficial. However, our local our server manager who remotely monitors asked me to use the correct path of pip under my miniconda and install mofapy. Voila, this did the trick.

Leaving a detailed description below for others if they meet the same issue.

Command used: /home/vvda/.local/share/r-miniconda/envs/mofa_env/bin/pip install mofapy --user Installed the mofapy in correct conda environment: /home/vvda/.local/share/r-miniconda/envs/mofa_env/lib/python3.8/site-packages/mofapy

Restarted the R Studio Session in the server

library(reticulate)
use_python("/home/vvda/.local/share/r-miniconda/envs/mofa_env/bin/python3", required = TRUE)
py_config()
library(MOFA)
library(MOFAdata)
py_config()
python:         /home/vvda/.local/share/r-miniconda/envs/mofa_env/bin/python3
libpython:      /home/vvda/.local/share/r-miniconda/envs/mofa_env/lib/libpython3.8.so
pythonhome:     /home/vvda/.local/share/r-miniconda/envs/mofa_env:/home/vvda/.local/share/r-miniconda/envs/mofa_env
version:        3.8.2 (default, Mar 26 2020, 15:53:00)  [GCC 7.3.0]
numpy:          /home/vvda/.local/share/r-miniconda/envs/mofa_env/lib/python3.8/site-packages/numpy
numpy_version:  1.18.2

NOTE: Python version was forced by use_python function

Thanks, everyone for helping me diagnose these past 2 days.

Kind regards, VD