theislab / scvelo

RNA Velocity generalized through dynamical modeling
https://scvelo.org
BSD 3-Clause "New" or "Revised" License
400 stars 103 forks source link

UMAP coordinates not transfering from Seurat #1258

Closed MeganRMonaghan closed 2 weeks ago

MeganRMonaghan commented 2 weeks ago

Hi! I am trying to run scVelo on my dataset to produce some RNA velocity. I have produced a loom file from velocyto with my splice data, and have a Seurat object with my post QC dataset. This object has had analysis performed, including UMAP calculated, which I want to keep and use in my velocity analysis. I produced a loom file using the code:

cells.loom <- as.loom(cells, filename = "~/yard/run_cellranger_count/velocity", verbose = FALSE)

Which gives me my Seurat object. When I put these two in my jupyter notebook, and merge them, the resulting object has no umap coordinates, as when I try and plot my velocity I receive the error KeyError: 'X_umap'.

I saw somewhere someone say I need to run adata.obsm['X_umap'] = adata.obsm['umap_cell_embeddings'] to ensure my UMAP coodinates are in the adata object, but I get this error instead: KeyError: 'umap_cell_embeddings' Any ideas? When I inspect adata I see everything else comes up, just not X_umap.

Apologies- I am very new to python and scVelo, so I may have missed something simple here. Thank you!

WeilerP commented 2 weeks ago

Obviously not a bug in or even related to the scvelo code. You need to check where the UMAP coordinates are stored and rename that slot to "X_umap". Alternatively, just save the UMAP coordinates in a data frame and load them from there.