cellgeni / sceasy

A package to help convert different single-cell data formats to each other
GNU General Public License v3.0
382 stars 57 forks source link

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

Open Flu09 opened 9 months ago

Flu09 commented 9 months ago

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_andload(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)
TamiaChin commented 2 months ago

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