mojaveazure / seurat-disk

Interfaces for HDF5-based Single Cell File Formats
https://mojaveazure.github.io/seurat-disk
GNU General Public License v3.0
155 stars 49 forks source link

Error in SaveH5Seurat() : HDF5-API Errors #168

Open ys910111 opened 1 year ago

ys910111 commented 1 year ago
          Same issue for me too
> SaveH5Seurat(object = pbmc, filename = 'pbmc_tmp.h5seurat', overwrite = T)
Warning: Overwriting previous file pbmc_tmp.h5seurat
Creating h5Seurat file for version 3.1.5.9900
Adding counts for RNA
Adding data for RNA
Adding scale.data for RNA
Adding variable features for RNA
Adding feature-level metadata for RNA
Adding counts for ATAC
Adding data for ATAC
No variable features found for ATAC
Adding feature-level metadata for ATAC
Writing out ranges for ATAC
Writing out motifs for ATAC
Writing out fragments for ATAC
Writing out seqinfo for ATAC
Writing out annotation for ATAC
Writing out bias for ATAC
Writing out positionEnrichment for ATAC
Writing out links for ATAC
Adding counts for peaks
Adding data for peaks
Adding variable features for peaks
Adding feature-level metadata for peaks
Writing out ranges for peaks
Writing out motifs for peaks
Error in attr$write(robj) : HDF5-API Errors:
    error #000: ../../../src/H5A.c in H5Awrite(): line 629: null attribute buffer
        class: HDF5
        major: Invalid arguments to routine
        minor: Bad value

Originally posted by @ys910111 in https://github.com/mojaveazure/seurat-disk/issues/27#issuecomment-1794203232

vishnums007 commented 6 months ago

I had the same issue. One of the attribute in the seurat object seems to be a NULL or not an expected data type. I couldn't figure out which slot/attribute that was but I needed only the counts slot to be converted to anndata. So, I just created a new seurat object with just the counts of old seurat object. zebra_n<-CreateSeuratObject(counts=zebra@assays$RNA@counts, assay = "RNA", meta.data = zebra@meta.data). Now, everything works!!