Last updated on September 13, 2026 am
[Python与R转换] Scanpy h5ad与Seurat rds转换工具
SeuratDisk
先转成.h5seurat格式,再转成h5ad
1 2 3 4 5 6 7 8 9
| library(SeuratDisk)
SaveH5Seurat(seu_merged, filename = "F:/Work/scvi_scRNA.h5seurat", overwrite = TRUE)
Convert("F:/Work/scvi_scRNA.h5seurat", dest = "h5ad", overwrite = TRUE)
|
1 2 3 4 5 6 7 8 9
| library(Seurat) library(SeuratDisk)
Convert("F:/Work/scvi_scRNA", dest = "h5seurat", overwrite = TRUE)
seu <- LoadH5Seurat("F:/Work/Age_LN/AegLN/QC_plots/scvi_scRNA.h5seurat", meta.data = FALSE)
|
scBridge
这次在python 尝试了scvi取批次和neighbor,h5ad转换到seurat对象失败了,正好在微信公众号看到了一个很好的开源项目 ,运行流畅,感谢作者
https://github.com/xiaoqqjun/scBridge
1
| remotes::install_github("xiaoqqjun/scBridge")
|
1 2 3 4 5 6 7 8 9 10 11
| library(scBridge) library(reticulate)
use_condaenv("scvi-env", required = TRUE)
seurat_obj <- py2seurat("F:/Work/scvi_scRNA.h5ad")
|
1 2 3 4
| library(scBridge)
seurat2py(seurat_obj, "output.h5ad")
|
