Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error when saving h5seurat #27

Closed
ccruizm opened this issue Oct 30, 2020 · 14 comments
Closed

Error when saving h5seurat #27

ccruizm opened this issue Oct 30, 2020 · 14 comments

Comments

@ccruizm
Copy link

ccruizm commented Oct 30, 2020

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

@ccruizm ccruizm closed this as completed Oct 30, 2020
@dfernandezperez
Copy link

Hey!

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

Thanks a lot!

@ccruizm
Copy link
Author

ccruizm commented May 17, 2021

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
Copy link

AAA-3 commented Sep 3, 2021

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
Copy link

This is not a solved issue.

@rLannes
Copy link

rLannes commented Apr 10, 2022

Any work around ?

@jiangpuxuan
Copy link

Any work around ?

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

@BenjaminDEMAILLE
Copy link

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
Copy link

ys910111 commented Nov 6, 2023

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
Copy link

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

@JAMKuttan
Copy link

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
Copy link

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
Copy link

erzakiev commented Mar 13, 2024

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
Copy link

Alexis-Varin commented Mar 18, 2024

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
Copy link

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests