1. 先在R中将seurat对象转存为loom格式
library(Seurat)
library(loomR)
# 读入seurat对象seurat.obj
sdata.loom <- as.loom(x = seurat.obj, filename = "./B265-multiclone.loom", verbose = FALSE)
sdata.loom$close_all()
2. 在python中将loom文件转存为h5ad格式
import scanpy as sc
results_file = './B265-multiclone.loom'
adatas = sc.read_loom(results_file, sparse=True, cleanup=False, dtype='float32')
adatas.write('./B265-multiclone_seurat2scanpy.h5ad')
loom转h5ad还是需要挺长时间的。