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

failure to convert attributeError: 'dict' object has no attribute 'dtype' #85

Open
Flu09 opened this issue Feb 6, 2024 · 1 comment

Comments

@Flu09
Copy link

Flu09 commented Feb 6, 2024

sceasy::convertFormat(h5ad_file, from="anndata", to="seurat", outFile='neurons.rds')
Loading required namespace: Seurat
/home/sherine/R/x86_64-pc-linux-gnu-library/4.3/reticulate/python/rpytools/loader.py:117: FutureWarning: pandas.core.index is deprecated and will be removed in a future version. The public classes are available in the top-level namespace.
return find_and_load(name, import)

Error in py_call_impl(callable, call_args$unnamed, call_args$named) :
AttributeError: 'dict' object has no attribute 'dtype'
Run reticulate::py_last_error() for details.

reticulate::py_last_error()

── Python Exception Message ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Traceback (most recent call last):
File "/home/sherine/anaconda3/envs/sceasy_env/lib/python3.11/site-packages/anndata/readwrite/read.py", line 447, in read_h5ad
constructor_args = _read_args_from_h5ad(filename=filename, chunk_size=chunk_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sherine/anaconda3/envs/sceasy_env/lib/python3.11/site-packages/anndata/readwrite/read.py", line 502, in _read_args_from_h5ad
return AnnData._args_from_dict(d)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sherine/anaconda3/envs/sceasy_env/lib/python3.11/site-packages/anndata/core/anndata.py", line 2157, in _args_from_dict
if key in d_true_keys[true_key].dtype.names:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'dtype'

── R Traceback ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

  1. └─sceasy::convertFormat(...)
  2. └─sceasy (local) func(obj, outFile = outFile, main_layer = main_layer, ...)
  3. └─anndata$read_h5ad(inFile)
    
@Flu09 Flu09 changed the title failure to convert ttributeError: 'dict' object has no attribute 'dtype' failure to convert attributeError: 'dict' object has no attribute 'dtype' Feb 6, 2024
@TamiaChin
Copy link

This is an issue concerning anndata package.
conda install "anndata>=0.7" -c conda-forge
It should fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants