highly_variable_genes AssertionError: Don’t call _normalize_index with non-categorical/string names
See original GitHub issueHi, I am using anndata 0.6.21 and scanpy 1.4.3 I executed this code:
sc.pp.highly_variable_genes(adata, min_mean=0.0001, max_mean=3, min_disp=0.5)
sc.pl.highly_variable_genes(adata)
adata = adata[:, adata.var['highly_variable']]
and I got this error:
AssertionError: Don’t call _normalize_index with non-categorical/string names
Can you help me?
Thank you.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
highly_variable_genes AssertionError: Don't call ... - GitHub
Hi, I am using anndata 0.6.21 and scanpy 1.4.3 I executed this code: sc.pp.highly_variable_genes(adata, min_mean=0.0001, max_mean=3, ...
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
I had the same problem when I loaded sample data from a csv as a data frame and assigned it to adata.obs = df
Solution here is
adata.obs.index = adata.obs.index.astype(str)
. Should be called by default if this assertionerror is raised.