I converted a seurat obj to a h5ad format successfully and tried to load it into ScVelo as follows:
and got a following error.
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/usr/local/lib/python3.8/site-packages/anndata/_io/utils.py in func_wrapper(elem, *args, **kwargs)
155 try:
--> 156 return func(elem, *args, **kwargs)
157 except Exception as e:
/usr/local/lib/python3.8/site-packages/anndata/_io/h5ad.py in read_dataframe(group)
483 columns = list(group.attrs["column-order"])
--> 484 idx_key = group.attrs["_index"]
485 df = pd.DataFrame(
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
/usr/local/lib/python3.8/site-packages/h5py/_hl/attrs.py in __getitem__(self, name)
55 """
---> 56 attr = h5a.open(self._id, self._e(name))
57
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/h5a.pyx in h5py.h5a.open()
KeyError: "Can't open attribute (can't locate attribute: '_index')"
During handling of the above exception, another exception occurred:
AnnDataReadError Traceback (most recent call last)
<ipython-input-7-f2696a3315c6> in <module>
----> 1 adata=scv.read("/Users/akihikohohji/Desktop/pbmc10k.h5ad")
/usr/local/lib/python3.8/site-packages/scanpy/readwrite.py in read(filename, backed, sheet, ext, delimiter, first_column_names, backup_url, cache, cache_compression, **kwargs)
110 filename = Path(filename) # allow passing strings
111 if is_valid_filename(filename):
--> 112 return _read(
113 filename,
114 backed=backed,
/usr/local/lib/python3.8/site-packages/scanpy/readwrite.py in _read(filename, backed, sheet, ext, delimiter, first_column_names, backup_url, cache, cache_compression, suppress_cache_warning, **kwargs)
711 if ext in {'h5', 'h5ad'}:
712 if sheet is None:
--> 713 return read_h5ad(filename, backed=backed)
714 else:
715 logg.debug(f'reading sheet {sheet} from file {filename}')
/usr/local/lib/python3.8/site-packages/anndata/_io/h5ad.py in read_h5ad(filename, backed, as_sparse, as_sparse_fmt, chunk_size)
426 d[k] = read_attribute(f[k])
427
--> 428 d["raw"] = _read_raw(f, as_sparse, rdasp)
429
430 X_dset = f.get("X", None)
/usr/local/lib/python3.8/site-packages/anndata/_io/h5ad.py in _read_raw(f, as_sparse, rdasp, attrs)
458 for v in ("var", "varm"):
459 if v in attrs and f"raw/{v}" in f:
--> 460 raw[v] = read_attribute(f[f"raw/{v}"])
461 return _read_legacy_raw(f, raw, read_dataframe, read_attribute, attrs=attrs)
462
/usr/local/Cellar/[email protected]/3.8.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/functools.py in wrapper(*args, **kw)
873 '1 positional argument')
874
--> 875 return dispatch(args[0].__class__)(*args, **kw)
876
877 funcname = getattr(func, '__name__', 'singledispatch function')
/usr/local/lib/python3.8/site-packages/anndata/_io/utils.py in func_wrapper(elem, *args, **kwargs)
157 except Exception as e:
158 if isinstance(e, AnnDataReadError):
--> 159 raise e
160 else:
161 parent = _get_parent(elem)
/usr/local/lib/python3.8/site-packages/anndata/_io/utils.py in func_wrapper(elem, *args, **kwargs)
154 def func_wrapper(elem, *args, **kwargs):
155 try:
--> 156 return func(elem, *args, **kwargs)
157 except Exception as e:
158 if isinstance(e, AnnDataReadError):
/usr/local/lib/python3.8/site-packages/anndata/_io/h5ad.py in read_group(group)
536 pass
537 elif encoding_type == "dataframe":
--> 538 return read_dataframe(group)
539 elif encoding_type in {"csr_matrix", "csc_matrix"}:
540 return SparseDataset(group).to_memory()
/usr/local/lib/python3.8/site-packages/anndata/_io/utils.py in func_wrapper(elem, *args, **kwargs)
160 else:
161 parent = _get_parent(elem)
--> 162 raise AnnDataReadError(
163 f"Above error raised while reading key {elem.name!r} of "
164 f"type {type(elem)} from {parent}."
AnnDataReadError: Above error raised while reading key '/raw/var' of type <class 'h5py._hl.group.Group'> from /.
This could be an issue with ScVelo but I'd really appreciate any help on fixing this.
package.version("Seurat")
[1] "4.0.0"
package.version("SeuratDisk")
[1] "0.0.0.9018"
scv.logging.print_versions()
scvelo==0.2.3 scanpy==1.7.0 anndata==0.7.5 loompy==3.0.6 numpy==1.20.1 scipy==1.6.1 matplotlib==3.3.4 sklearn==0.24.1 pandas==1.2.2