阿特曼不打小怪兽头像
FFPE中的rds和h5ad聚类标签互相添加封面图

FFPE中的rds和h5ad聚类标签互相添加

百创智造FFPE空间转录组上游分析,我们再聚类的时候选择了三种方法:Seurat聚类,Kmeans聚类,Graph-based聚类。其中seurat聚类得到的数据类型是RDS格式,存放在BSTViewer_project/cluster/level/seurat/L*/object.RDS,kmean和Graph-based聚类得到到数据类型是h5ad格式,存放在BSTViewer_project/cluster/level/kmeans_graph/L*/L*_clustered.h5ad

目前这两个数据(rds,h5ad)都是只存放了各自的聚类,那如果我们想RDS中能添加上kmean和Graph-based聚类标签,或者h5ad中添加上seurat聚类标签,该如何去操作呢?这里我们提供了两个脚本供大家使用。

将kmeans 和graph的聚类标签加到rds脚本 : add_cluster_csv_to_seurat.r  

nohup Rscript add_cluster_csv_to_seurat.r  \
--out out \ 
--h5ad_cluster_path ./BSTViewer_project/cluster/level/kmeans_graph/L7 \ 
--rds ./BSTViewer_project/cluster/level/seurat/L7/object.RDS \ 
--prefix L7

将seurat聚类加到h5ad :seurat_cluster_to_h5ad.py 

python seurat_cluster_to_h5ad.py \ 
--out outdir \ 
--h5ad ./BSTViewer_project/cluster/level/kmeans_graph/L18/L18_clustered.h5ad \ 
--spatial_snn_path ./BSTViewer_project/cluster/level/seurat/L18 \ 
--prefix L18

至此,rds和h5ad中都含有这三种方发的聚类标签了(Spatial_snn是seurat聚类标签):

graph_r0.5    graph_r0.8    graph_r1.0    graph_r1.2    graph_r1.5    kmeans_K4    kmeans_K6    ...    kmeans_K12    kmeans_K14    kmeans_K16    kmeans_K18    kmeans_K20    Spatial_snn_res0.8    Spatial_snn_res1.5    Spatial_snn_res0.5    Spatial_snn_res1    Spatial_snn_res1.2

脚本下载方式:

通过网盘分享的文件:FFPE中的rds和h5ad聚类标签互相添加
链接: https://pan.baidu.com/s/1Mq_MtTa19XPYGX7nwZE0Og?pwd=eurr 提取码: eurr 
 

转载自 CSDN-专业IT技术社区

原文链接:https://blog.csdn.net/m0_74235168/article/details/168135713

文章来源转载

评论

评论列表

微信小程序
QQ小程序

关于作者

点赞数:0
关注数:0
粉丝:0
文章:0
关注标签:0
加入于:--