mojaveazure / seurat-disk

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

Error when saving h5seurat #27

Closed ccruizm closed 3 years ago

ccruizm commented 3 years ago

Good day,

I am having issues saving a Seurat object with SaveH5Seurat. Do not know what the problem can be.

Creating h5Seurat file for version 3.1.5.9900

Adding counts for RNA

Adding data for RNA

No variable features found for RNA

No feature-level metadata found for RNA

Adding counts for SCT

Adding data for SCT

Adding scale.data for SCT

No variable features found for SCT

No feature-level metadata found for SCT

Adding data for integrated

Adding scale.data for integrated

Adding variable features for integrated

No feature-level metadata found for integrated

Adding cell embeddings for pca

Adding loadings for pca

No projected loadings for pca

Adding standard deviations for pca

No JackStraw data for pca

Adding cell embeddings for umap

No loadings for umap

No projected loadings for umap

No standard deviations for umap

No JackStraw data for umap

Error in guess_dtype(x = x, ...): unknown type
Traceback:

1. 1
2. 2
3. 3
4. 4
5. 5
6. 5
7. 7
8. 7
9. 9
10. ⋯
11. 9
12. 13
13. 13
14. 15
15. 16
16. 17
17. 18
18. 19

Any ideas on how to solve this issue? thanks in advance

dfernandezperez commented 3 years ago

Hey!

I am facing the same problem, could you explain how did you solve it?

Thanks a lot!

ccruizm commented 3 years ago

Unfortunately, I have not been able to solve this issue. I was trying to export the seurat object as h5seurat to convert it to h5ad but decided to follow another path. SInce the update to Seurat v4.0, I have been enountrring several problems trying to directly export either h5ad or loom files.

AAA-3 commented 3 years ago

I had a simillar problem as well:

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
No feature-level metadata found for RNA
Adding cell embeddings for pca
Adding loadings for pca
No projected loadings for pca
Error in attr$write(robj) : HDF5-API Errors:
    error #000: ../../../src/H5A.c in H5Awrite(): line 638: null attribute buffer
        class: HDF5
        major: Invalid arguments to routine
        minor: Bad value
MiTPenguin commented 2 years ago

This is not a solved issue.

rLannes commented 2 years ago

Any work around ?

jiangpuxuan commented 2 years ago

Any work around ?

I have the same issue too, but I found that Convert(".h5Seurat", dest = "h5ad", overwrite = TRUE) can work properly.

BenjaminDEMAILLE commented 1 year ago

Same error :

> SaveH5Seurat(Grout_Leader_data, filename = "Grout_Leader_data.h5Seurat", overwrite = T, verbose = T)
Warning: Overwriting previous file Grout_Leader_data.h5SeuratCreating h5Seurat file for version 3.1.5.9900
Adding counts for RNA
Adding data for RNA
No variable features found for RNA
No feature-level metadata found for RNA
Adding counts for SCT
Adding data for SCT
Adding scale.data for SCT
Adding variable features for SCT
No feature-level metadata found for SCT
Writing out SCTModel.list for SCT
Adding cell embeddings for pca
Adding loadings for pca
No projected loadings for pca
Adding standard deviations for pca
No JackStraw data for pca
Adding cell embeddings for umap
No loadings for umap
No projected loadings for umap
No standard deviations for umap
No JackStraw data for umap
Error in guess_dtype(x = x, ...) : unknown type

last version

ys910111 commented 10 months 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
jlehrer1 commented 7 months ago

Any update on this? I have not yet found a solution

JAMKuttan commented 7 months ago

Just tested Seurat5. Same error for me as well.

SaveH5Seurat(scObj, filename = "scObj.h5Seurat") Creating h5Seurat file for version 3.1.5.9900 Error in guess_dtype(x = x, ...) : unknown type

mingjiang7940 commented 7 months ago

Just tested Seurat5. Same error for me as well.

SaveH5Seurat(scObj, filename = "scObj.h5Seurat") Creating h5Seurat file for version 3.1.5.9900 Error in guess_dtype(x = x, ...) : unknown type

Do you have any solution?

erzakiev commented 6 months ago

Even if you - like me - are trying to export the SCT assay data into the h5Seurat file, make sure that your underlying RNA assay has variable features set:

DefaultAssay(obj) <-  'RNA' # temporarily making 'RNA' active assay
obj <- FindVariableFeatures(obj)
DefaultAssay(obj) <-  'SCT' # returning 'SCT' as the default assay
SaveH5Seurat(obj, 
             filename = "obj.h5Seurat", 
             overwrite = T,
             verbose = T
              )

#> Warning: Overwriting previous file oiseau_to_plot_inset.h5Seurat
#> Creating h5Seurat file for version 3.1.5.9900
#> Adding counts for SCT
#> Adding data for SCT
#> Adding scale.data for SCT
#> Adding variable features for SCT
#> No feature-level metadata found for SCT
#> Writing out SCTModel.list for SCT
Alexis-Varin commented 6 months ago

Hello, I had the same problem with Error in guess_dtype(x = x, ...): unknown type and Seurat 5.

I fixed it by switching my RNA Assay5 class into Assay class with integrated[["RNA"]] <- as(object = integrated[["RNA"]], Class = "Assay")

I was then able to properly save my object with SaveH5Seurat() without any error and convert into h5ad.

Hope this helps

Xiezhouwei2024 commented 6 months ago

integrated[["RNA"]] <- as(object = integrated[["RNA"]], Class = "Assay",is work!!!very thank U