STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
180 stars 59 forks source link

annh5ad2rds.R: Error: Missing required datasets 'levels' and 'values' #239

Closed MISAKA-DaYu closed 5 months ago

MISAKA-DaYu commented 5 months ago

/BGFS1/usr/share/packages/R/4.3.1/bin/Rscript annh5ad2rds.R --infile seurat_out.h5ad --outfile seurat_obj.rds

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

filter, lag

The following objects are masked from ‘package:base’:

intersect, setdiff, setequal, union

The legacy packages maptools, rgdal, and rgeos, underpinning the sp package, which was just loaded, will retire in October 2023. Please refer to R-spatial evolution reports for details, especially https://r-spatial.org/r/2023/05/15/evolution4.html. It may be desirable to make the sf package available; package maintainers should consider adding sf to Suggests:. The sp package is now running under evolution status 2 (status 2 uses the sf package in place of rgdal) Attaching SeuratObject Registered S3 method overwritten by 'SeuratDisk': method from
as.sparse.H5Group Seurat Warning: Unknown file type: h5ad Creating h5Seurat file for version 3.1.5.9900 Adding X as data Adding X as counts Adding meta.features from var Adding spatial as cell embeddings for spatial Adding raw_cellname to miscellaneous data Adding raw_counts to miscellaneous data Adding raw_genename to miscellaneous data Adding sn to miscellaneous data [1] "Finished! Converting h5ad to h5seurat file at:" [2] "seuratout.h5seurat"
Validating h5Seurat file Warning: Feature names cannot have underscores ('
'), replacing with dashes ('-') Initializing Spatial with data Adding counts for Spatial Adding feature-level metadata for Spatial Adding reduction spatial Adding cell embeddings for spatial Adding miscellaneous information for spatial Adding command information Adding cell-level metadata Error: Missing required datasets 'levels' and 'values' In addition: Warning message: Cannot add objects with duplicate keys (offending key: spatial), setting key to 'spatialxj' Execution halted

tanliwei-coder commented 5 months ago

This is caused by the compatibility between R script annh5ad2rds.R and higher version AnnData(higher than 0.7.5), you can download the new version R script h5ad2rds.R to solve this error.

MISAKA-DaYu commented 5 months ago

problem solved! thank you very much.