MOFA2
MOFA2 copied to clipboard
AttributeError: Module 'scipy' has no attribute 'shape'
Hi, I tgot following error after calling python from Reticulate, please help
mofa1 <- run_mofa(mofa) Connecting to the mofapy2 python package using reticulate (use_basilisk = FALSE)... Please make sure to manually specify the right python binary when loading R with reticulate::use_python(..., force=TRUE) or the right conda environment with reticulate::use_condaenv(..., force=TRUE) If you prefer to let us automatically install a conda environment with 'mofapy2' installed using the 'basilisk' package, please use the argument 'use_basilisk = TRUE'
#########################################################
### __ __ ____ ______ ###
### | \/ |/ __ \| ____/\ _ ###
### | \ / | | | | |__ / \ _| |_ ###
### | |\/| | | | | __/ /\ \_ _| ###
### | | | | |__| | | / ____ \|_| ###
### |_| |_|\____/|_|/_/ \_\ ###
### ###
#########################################################
use_float32 set to True: replacing float64 arrays by float32 arrays to speed up computations...
Successfully loaded view='Microbial_pathways' group='single_group' with N=16 samples and D=363 features... Successfully loaded view='Microbial_Taxonomy' group='single_group' with N=16 samples and D=195 features... Successfully loaded view='RNA' group='single_group' with N=16 samples and D=14324 features...
Warning: 6860 features(s) in view 2 have zero variance, consider removing them before training the model...
Model options:
- Automatic Relevance Determination prior on the factors: False
- Automatic Relevance Determination prior on the weights: True
- Spike-and-slab prior on the factors: False
- Spike-and-slab prior on the weights: False Likelihoods:
- View 0 (Microbial_pathways): gaussian
- View 1 (Microbial_Taxonomy): gaussian
- View 2 (RNA): gaussian
Error in py_call_impl(callable, call_args$unnamed, call_args$named) :
AttributeError: Module 'scipy' has no attribute 'shape'
Run reticulate::py_last_error()
for details.
In addition: Warning message:
In run_mofa(mofa) :
No output filename provided. Using /var/folders/3q/l3mk74214gb7n96bld12vg8h0000gn/T//RtmpQOMa72/mofa_20240326-142718.hdf5 to store the trained model.
Change s.shape
to np.shape
in the mofapy2/core/distributions/basic_distributions.py
file and s.outer
to np.outer
in the mofapy2/core/BayesNet.py
files.
Thanks, it worked like magic, i have new error, please help
plot_weights_fn(mofa1, factor=1, view="Microbial_Taxonomy", nfeatures=8) Error in plot_weights_fn(mofa1, factor = 1, view = "Microbial_Taxonomy", : could not find function "plot_weights_fn"
packageVersion("MOFA2") [1] ‘1.13.0’
can you give me the source where you get the code from?
I am trying to follow this
https://raw.githack.com/bioFAM/MOFA2_tutorials/master/R_tutorials/microbiome_vignette.html
I tried to do so but i faced the same error😂 push it as a new issue may someone knows help
The links you published are outdated. I guess, the function plot_weights_fn
is now called plot_weights
. I opened #148. There you will find the link to the latest reference manual. For latest tutorials, see Bioconductor page.
I opened #157 for outdated links to tutorials.