Git Product home page Git Product logo

Comments (4)

Xiaojieqiu avatar Xiaojieqiu commented on August 12, 2024 1

I think my recent commit should fix this issue. now dynamo automatically checks your layer inform and avoids normalizing data that are not conventional. so you will only added X_unspliced, X_spliced in layers after receipe_monocle, this also fixes the issue in tl.moments. Feel free to pull those latest changes and install the newest version to try it out. Please let me know how it goes.

p.s. running something like the following without worrying about those unconventional layers anymore:

dyn.pp.recipe_monocle(adata)
dyn.tl.moments(adata)
dyn.tl.dynamics(adata)
dyn.tl.reduceDimension(adata)
dyn.tl.cell_velocities(adata)
dyn.vf.VectorField(adata, basis='umap')
dyn.vf.topography(adata, basis='umap')
dyn.pl.streamline_plot(adata, basis='umap')

from dynamo-release.

Xiaojieqiu avatar Xiaojieqiu commented on August 12, 2024

Hey @ccruizm thanks for your interest in dynamo! My immediate thought regarding this error is that you got a few non-standard layers (especially those norm_data, scale_data layers). To filter this possibility, could you please first deleting 'norm_data', 'scale_data', 'ambiguous', 'matrix', layers? you can do that by:

del adata.layers['norm_data'], adata.layers['scale_data'], adata.layers['matrix'], adata.layers['norm_data']

and then run

dyn.pp.recipe_monocle(adata)
dyn.tl.dynamics(adata)
dyn.tl.reduceDimension(adata)
dyn.tl.cell_velocities(adata)
dyn.vf.VectorField(adata, basis='umap')
dyn.vf.topography(adata, basis='umap')
......

We still need to figure out the exact issue and would like to use your other norm or scaled layer inform. So in order to reproduce your error, if you can share me with a small sample of your dataset (like 100 cells), I can do some more careful investigations to have an ideal solution. (I probably can also fake an anndata object like yours too)

btw, for keys in .obsm, the anndata convention is to have a X_ at beginning. So you may need to name those keys as 'X_mnn_cell_embeddings', 'X_pca_cell_embeddings', 'X_umap_cell_embeddings' instead of 'mnn_cell_embeddings', 'pca_cell_embeddings', 'umap_cell_embeddings'.

from dynamo-release.

Xiaojieqiu avatar Xiaojieqiu commented on August 12, 2024

I just tested and found that the issue is indeed because of the existence of 'norm_data', 'scale_data' layers. Since dyn.tl.moments assumes either conventional scRNA-seq data (only_splicing) with unspliced, spliced layers or labeling data with either new, total (only_labeling) or uu, ul, su, sl layers (uu, ul, su, sl (splicing_and_labeling) corresponds to unspliced unlabelled, unspliced labeled, spliced unlabeled and spliced labeled), so it cannot find those layers which leads to the indexing error above:

--> 150             layer_y_group = np.where([layer2 in x for x in
    151                                       [only_splicing, only_labeling, splicing_and_labeling]])[0][0]```

One quick solution  (better than the above one) now is to set `layers = ['X_spliced', 'X_unspliced']` when you run moments. Something like the following: 

dyn.pp.recipe_monocle(adata)
dyn.tl.moments(adata, layers=['X_unspliced', 'X_spliced'])
dyn.tl.dynamics(adata)
dyn.tl.reduceDimension(adata)
dyn.tl.cell_velocities(adata)
dyn.vf.VectorField(adata, basis='umap')
dyn.vf.topography(adata, basis='umap')
dyn.pl.streamline_plot(adata, basis='umap')
......

from dynamo-release.

ccruizm avatar ccruizm commented on August 12, 2024

Thanks so such for the quick reply and fixing the issue! Now it works smoothly!

from dynamo-release.

Related Issues (20)

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.