Giter VIP home page Giter VIP logo

Comments (5)

jjuhyunkim avatar jjuhyunkim commented on August 16, 2024

I got the same error.
These are versions of my models.

mofapy2 = v0.7.0
pandas = 1.5.3
numpy = 1.26.0

from mofapy2.

jjuhyunkim avatar jjuhyunkim commented on August 16, 2024

When I downgraded mofapy2 to 0.6.7, I got different error message below:

IndexError                                Traceback (most recent call last)
Cell In[76], line 1
----> 1 mu.tl.mofa(mdata, n_factors=20, gpu_mode=True)

File ~/mambaforge/envs/multiome/lib/python3.9/site-packages/muon/_core/tools.py:642, in mofa(data, groups_label, use_raw, use_layer, use_var, use_obs, likelihoods, n_factors, scale_views, scale_groups, center_groups, ard_weights, ard_factors, spikeslab_weights, spikeslab_factors, n_iterations, convergence_mode, use_float32, gpu_mode, gpu_device, svi_mode, svi_batch_size, svi_learning_rate, svi_forgetting_rate, svi_start_stochastic, smooth_covariate, smooth_warping, smooth_kwargs, save_parameters, save_data, save_metadata, seed, outfile, expectations, save_interrupted, verbose, quiet, copy)
    639 if use_var:
    640     # Set the weights of features that were not used to zero
    641     data.varm["LFs"] = np.zeros(shape=(data.n_vars, w.shape[1]))
--> 642     data.varm["LFs"][data.var[use_var]] = w
    643 else:
    644     data.varm["LFs"] = w

IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

mofapy2 : v0.6.7
numpy : v1.22.4
pandas : v1.5.3

from mofapy2.

jjuhyunkim avatar jjuhyunkim commented on August 16, 2024

I was able to run through the entire Jupyter notebook named getting_started_python.ipynb, which could be downloaded from the mofapy2 GitHub without any errors. However, the error was triggered by another Jupyter notebook and a sample data file downloaded from the muon-tutorials."

But the Mu data has a new embedding X_mofa.

And the iteration stopped at 13 with the message 'Converged!'. While I believe this number of iterations is too low, can I still use the X_mofa in mdata for downstream analysis in this situation?

from mofapy2.

hongruhusanofi avatar hongruhusanofi commented on August 16, 2024

just tried using the data.frame option following the mofapy2, it worked fine so there should be something wrong wit the MOUN mu.tl.mofa wrapper. @jjuhyunkim maybe we could open another issue under the moun github page

from mofapy2.

jjuhh avatar jjuhh commented on August 16, 2024

Yes, you are right,

I was able to resolve the error by executing the following line of code before running MOFA to integrate my data

mdata.var['highly_variable']=mdata.var['highly_variable'].to_list()

Thank you for your comments

from mofapy2.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.