作者,Evil Genius
今天废话不多说,针对bin模式Stereo-seq、HD和visium,完成解卷积 + 细胞层次聚类
我们直接上封装好的代码
#! usr/bin/R
####20241202
library(argparse)
library(Seurat)
library(ggplot2)
library(patchwork)
library(dplyr)
library(spacexr)
library(ISCHIA)
library(robustbase)
library(data.table)
library(ggplot2)
library(Seurat)
library(dplyr)
library(factoextra)
library(cluster)
library(showtext)
library(gridExtra)
library(pdftools)
library(pheatmap)
# 创建解析器
parser <- ArgumentParser(description = "RCTD and CC analysis")
# 添加参数
parser$add_argument("-s", "--scrna", required = TRUE, help = "scrna rds file")
parser$add_argument("-p", "--spatial", required = TRUE, help = "spatial rds file")
parser$add_argument("-o", "--output", required = TRUE, help = "Output directory for saving results")
parser$add_argument("-m", "--mode", choices = c("doublet", "full","multi"), required = TRUE, help = "RCTD mode")
parser$add_argument("-n", "--name", required = TRUE, help = "sample name")
# 解析命令行参数
args <- parser$parse_args()
scrna = args$scrna
spatial = args$spatial
outdir = args$outdir
mode = args$mode
sample = args$name