You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(SingleCellExperiment)
example(SingleCellExperiment)
metadata(sce)$WHEE<-list(list(X=1, Y=2))
library(zellkonverter)
writeH5AD(sce, "foo.h5ad")
## ℹ Using the 'counts' assay as the X matrix## Error in py_call_impl(callable, dots$args, dots$keywords) :## TypeError: Can't implicitly convert non-string objects to strings## ## Above error raised while writing key 'uns/WHEE' of <class 'h5py._hl.files.File'> from /.## ## Above error raised while writing key 'uns/WHEE' of <class 'h5py._hl.files.File'> from /.## ## Detailed traceback:## File "/Users/luna/Library/Caches/org.R-project.R/R/basilisk/1.6.0/zellkonverter/1.4.0/zellkonverterAnnDataEnv/lib/python3.7/site-packages/anndata/_core/anndata.py", line 1911, in write_h5ad## as_dense=as_dense,## File "/Users/luna/Library/Caches/org.R-project.R/R/basilisk/1.6.0/zellkonverter/1.4.0/zellkonverterAnnDataEnv/lib/python3.7/site-packages/anndata/_io/h5ad.py", line 118, in write_h5ad## write_attribute(f, "uns", adata.uns, dataset_kwargs=dataset_kwargs)## File "/Users/luna/Library/Caches/org.R-project.R/R/basilisk/1.6.0/zellkonverter/1.4.0/zellkonverterAnnDataEnv/lib/python3.7/functools.py", line 840, in wrapper## return dispatch(args[0].__class__)(*args, **kw)## File "/Users/luna/Library/Caches/or
Brief investigations indicate that it goes through SCE2AnnData fine but fails in the adata$write_h5ad step. The error goes away if the list is named. I would speculate that an unnamed list in the SCE metadata somehow gets stored inside the AnnData's metadata in the same place as the assay names, leading the Python-side code to believe that they are additional assays, and try to open file handles to save them? Or something. I don't think I wrote that part of the function.
The issue is that AnnData doesn't have a way of encoding lists of non-scalars. It's just not really clear how it fits with the Group or Array model of hdf5 and zarr. Ideas welcome.
Not really sure what's going on here, but:
Brief investigations indicate that it goes through
SCE2AnnData
fine but fails in theadata$write_h5ad
step. The error goes away if the list is named. I would speculate that an unnamed list in the SCE metadata somehow gets stored inside the AnnData's metadata in the same place as the assay names, leading the Python-side code to believe that they are additional assays, and try to open file handles to save them? Or something. I don't think I wrote that part of the function.Session information
The text was updated successfully, but these errors were encountered: