scv.pp.moment error
See original GitHub issueHello,
First try with this testing release. I cloned the git repo, and installed with pip install . on python 3.6.5 I loaded an annotated dataframe I am using to work on (created/pp with scanpy), then:
>>> scv.pp.moments(adata)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/scvelo/scvelo/preprocessing/moments.py", line 42, in moments
adata.layers['Ms'] = csr_matrix.dot(connectivities, adata.layers['spliced']).toarray()
File "/path/to/local/python/python-dev/lib/python3.6/site-packages/anndata/layers.py", line 41, in __getitem__
return self._layers[key]
KeyError: 'spliced'
Many thanks for your work, Best.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
error from scv.pp.moments(adata) · Issue #16 · theislab/scvelo
Hi, I'm attempting to run a scanpy processed .h5ad file through scvelo but am running into the error pasted below.
Read more >scVelo documentation - Read the Docs
Compute a neighborhood graph of observations. pp.moments(data[, n_neighbors, n_pcs, mode, . . . ]) Computes moments for velocity estimation. 4.3. API.
Read more >RNA velocity analysis with scVelo - Sam Morabito
In this tutorial, I will cover how to use the Python package scVelo to perform RNA velocity analysis in single-cell RNA-seq data (scRNA-seq)....
Read more >scvelo Velocity plots raise KeyError(f"None of [{key}] are in the ...
I had the same issue, converting umaps to numpy array before adding to adata object fixed it for me. s.obsm["X_umap"] = umap.to_numpy().
Read more >Dynamical Modeling — scVelo 0.2.6.dev4+g5725727 ...
Processing consists of gene selection, normalizing by total size, logarithmizing X, and computing moments for velocity estimation. See the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
.X
contains the logarithmized normalized spliced counts used e.g. for computing neighbor graphs and embeddings, while.layers['spliced']
contains the non-logarithmized normalized spliced counts (keeping it comparable to unspliced counts). Indeed, we might be better off just applyingnp.log1p
whenever needed instead of storing another count table. However, since batch correction and other preprocessing procedures should only affect.X
as well, it is probably best to keep it as is.The initially raised plotting issue (seemed to have been lost in the course of conversation) is still on my to-do list.
Hi @VolkerBergen, Sorry for my late answer. I have been able to use the plotting functions, yet I have to use plt.show() as explained. But it is functional, and gives expected results. I have been able to work with loom files after upgrading to the latest scanpy. I’m also building on creating an AnnData according to your recommendations, but it is outside the scope of this OP, I can close it. Thanks for your help.