Error with scanpy.api.pl.highest_expr_genes()
See original GitHub issueI have an error when trying this function for my data:
sc.pl.highest_expr_genes(adata)
results in
filtered out 14139 cells that have less than 1 counts
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-11-1f5b130b9d4e> in <module>()
----> 1 sc.pl.highest_expr_genes(adata)
/usr/local/lib/python3.6/site-packages/scanpy-1.2.2+90.g47c579f-py3.6.egg/scanpy/plotting/qc.py in highest_expr_genes(adata, n_top, save, show, ax, **kwargs)
41
42 # identify the genes with the highest mean
---> 43 dat.var['mean_percent'] = dat.X.mean(axis=0).A1
44
45 top = dat.var.sort_values('mean_percent', ascending=False).index[:n_top]
AttributeError: 'numpy.ndarray' object has no attribute 'A1'
It is not critical, but I wonder why this error happens. I have the most recent version from github. Maybe I’m not transforming my data to a certain format properly? Didn’t find this documented anyway. However, a lot of other analysis that I do via Scanpy works for me, so generally the data is read and processed correctly.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Error with scanpy.api.pl.highest_expr_genes() · Issue #220
I have an error when trying this function for my data: sc.pl.highest_expr_genes(adata) results in filtered out 14139 cells that have less ...
Read more >API — Scanpy 1.9.1 documentation
Basic Preprocessing . For visual quality control, see highest_expr_genes() and filter_genes_dispersion() in scanpy.pl .
Read more >Release notes — Scanpy 1.9.1 documentation - Read the Docs
Fixed bug in scanpy.pl.embedding() functions where an error could be raised when there were missing values and large numbers of categories PR 2187...
Read more >scanpy.pl.highest_expr_genes - Read the Docs
Computes, for each gene, the fraction of counts assigned to that gene within a cell. The n_top genes with the highest mean fraction...
Read more >Scanpy – Single-Cell Analysis in Python — Scanpy 1.9.1 ...
Fixed bug in scanpy.pl.embedding() functions where an error could be raised when there were missing values and large numbers of categories PR 2187...
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 Free
Top 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
Thank you, @LuckyMD!
Works for me now, thank you!