1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| library(Seurat) library(dplyr) library(patchwork)
root_path = "~/zlliu/R_data/21.07.15.IntegrateData"
output_path = "~/CSOmap/data/zlliu_IntegrateData_region" if (!file.exists(output_path)){dir.create(output_path)}
setwd(output_path) getwd()
sn = readRDS(file.path(root_path, 'hBLA_scRNAs.rds'))
scRNA <- merge(sn$BA213, y=c(sn$BA04, sn$BA06, sn$BA09, sn$BA21, sn$BA22, sn$BA37, sn$BA39, sn$BA40, sn$BA41, sn$BA42, sn$BA44, sn$BA45))
scRNA[["Region"]] <- Idents(scRNA)
labels <- scRNA[["Region"]] labels$cells <- gsub("-", "." ,rownames(labels)) labels$labels <- as.character(labels$Region) rownames(labels) <- NULL labels = labels[,c("cells", "labels")] write.table(labels, "label.txt", row.names = F, sep = "\t", quote = F)
|