import scanpy as sc
adata1 = sc.read_visium("/Volumes/MACPAN/空间转录组数据集/10X_spatial_data/data/V1_Mouse_Brain_Sagittal_Posterior/")
adata2 = sc.read_visium("/Volumes/MACPAN/空间转录组数据集/10X_spatial_data/data/V1_Mouse_Brain_Sagittal_Posterior_Section_2/")
adata1.var_names_make_unique()
adata2.var_names_make_unique()
#print(adata1)
#print(adata2)
aa= adata1.concatenate(adata2)
print(aa)
print("==================")
bb= adata1.concatenate(
adata2,
uns_merge="unique"
)
print(bb)
# batch_categories=library_names
结果如下:
注意一定要设置uns_merge
,因为这里是空间转录组信息的合并,如果不合并的话,对于接下来的画图就出现了问题