if I convert a singlecellexperiment object with anndata2ri, obs columns which should be int32 have a weird dtype in pandas. this breaks writing the adata to disk with the fillowing h5py error:
TypeError: Object dtype dtype('O') has no native HDF5 equivalent
Above error raised while writing key 'nFeature_RNA' of <class 'h5py._hl.group.Group'> from /.
Above error raised while writing key 'nFeature_RNA' of <class 'h5py._hl.group.Group'> from /.
Above error raised while writing key 'obs' of <class 'h5py._hl.files.File'> from /.
this fixes the error:
>>> adata.obs["nFeature_RNA"].dtype
Int32Dtype()
>>> adata.obs["nFeature_RNA"] = adata.obs["nFeature_RNA"].astype(np.int32)
>>> adata.obs["nFeature_RNA"].dtype
dtype('int32')
no more error when writing the adata to disk after this
if I convert a singlecellexperiment object with anndata2ri, obs columns which should be int32 have a weird dtype in pandas. this breaks writing the adata to disk with the fillowing h5py error:
this fixes the error:
no more error when writing the adata to disk after this