Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error plotting velocity graph #863

Closed
bapoorva opened this issue Apr 14, 2022 · 1 comment
Closed

Error plotting velocity graph #863

bapoorva opened this issue Apr 14, 2022 · 1 comment
Labels
duplicate Duplicated issue

Comments

@bapoorva
Copy link

Hi,

I'm running scVelo and when I tried to plot the velocity graph, I'm getting this error-

 scv.pl.velocity_embedding_stream(adata, basis="umap", color="seurat_clusters")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/appl/python-3.8/lib/python3.8/site-packages/scvelo/plotting/velocity_embedding_stream.py", line 252, in velocity_embedding_stream
    ax = scatter(
  File "/appl/python-3.8/lib/python3.8/site-packages/scvelo/plotting/scatter.py", line 308, in scatter
    default_color_map(adata, color) if color_map is None else color_map
  File "/appl/python-3.8/lib/python3.8/site-packages/scvelo/plotting/utils.py", line 345, in default_color_map
    if isinstance(c, str) and c in adata.obs.keys() and not is_categorical(adata, c):
  File "/appl/python-3.8/lib/python3.8/site-packages/scvelo/plotting/utils.py", line 55, in is_categorical
    strings_to_categoricals(data)
  File "/appl/python-3.8/lib/python3.8/site-packages/scvelo/tools/utils.py", line 301, in strings_to_categoricals
    df_keys = [key for key in df.columns if is_valid_dtype(df[key])]
  File "/appl/python-3.8/lib/python3.8/site-packages/scvelo/tools/utils.py", line 301, in <listcomp>
    df_keys = [key for key in df.columns if is_valid_dtype(df[key])]
  File "/appl/python-3.8/lib/python3.8/site-packages/scvelo/tools/utils.py", line 297, in is_valid_dtype
    is_string_dtype(values) or is_integer_dtype(values) or is_bool_dtype(values)
  File "/appl/python-3.8/lib/python3.8/site-packages/pandas/core/dtypes/common.py", line 1322, in is_bool_dtype
    arr_or_dtype = arr_or_dtype.categories
  File "/appl/python-3.8/lib/python3.8/site-packages/pandas/core/generic.py", line 5583, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'categories'

Not sure how to fix it. Also, how do i save plots command line?

Thanks

@WeilerP
Copy link
Member

WeilerP commented Apr 14, 2022

Seems like a duplicate of #811.

@WeilerP WeilerP closed this as completed Apr 14, 2022
@WeilerP WeilerP added the duplicate Duplicated issue label Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Duplicated issue
Projects
None yet
Development

No branches or pull requests

2 participants