highly_variable_genes AssertionError: Don’t call _normalize_index with non-categorical/string names

See original GitHub issue

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, 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:open
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
maximilianhcommented, Jul 30, 2019

I had the same problem when I loaded sample data from a csv as a data frame and assigned it to adata.obs = df

1reaction
scottgigante-immunaicommented, Sep 9, 2022

Solution here is adata.obs.index = adata.obs.index.astype(str). Should be called by default if this assertionerror is raised.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found