Closed zznx closed 1 year ago
Is adata.var.index.name
an integer? If so, changing it to a string as suggested by the error message should solve your problem.
Thank you anyway, but my problem is still unsolved. How to solve it @ivirshup
OSError: Unable to create link (name already exists)
Above error raised while writing key 'full_name' of <class 'h5py._hl.group.Group'> from /.
Above error raised while writing key 'raw/var' of <class 'h5py._hl.files.File'> from /.
I met the same error
This issue has been automatically marked as stale because it has not had recent activity. Please add a comment if you want to keep the issue open. Thank you for your contributions!
if a name of the index to the var table is an int. Setting the name to a string fixes this.
Reading this again, makes me think issue has been resolved. We don't support integer column names.
Maybe check the data strcture will help. For example, I had an error while writing adata.obsm['spatial'], I changed the dtype of the array. Another error occurs while writing adata.obs['array_row'], then I changed the data into int. So I guess data structure and data type are very important while wirting h5ad.
Of course we support int dtypes. But we would need a minimum reproducible example: https://matthewrocklin.com/minimal-bug-reports
I also keep having issues with saving anndata objects after modifying them with scanpy (filtering genes) and adding some cols to .obs
@axol0tl, please open a full bug report with an example and traceback:
ah, I realized that if there are any str values in anndata.obs -> it will not save h5ad. sorry, my bad. saved the info into a csv and dropped those cols, deleted anndata.raw, and was able to save anndata
I get a write error:
Above error raised while writing key 0 of <class 'h5py._hl.group.Group'> from /.
if a name of the index to the var table is an int. Setting the name to a string fixes this.Originally posted by @jeffhsu3 in https://github.com/theislab/anndata/issues/52#issuecomment-585151866