#用来根据不同的细胞来源重新画TSNE图
cell_source <-colnames(immune_nobatch)
cell_type <- strsplit(cell_source,split = '_')
ct <-rep(c('N'), times = length(cell_source))
for( i in 1:length(cell_source)){
ct[i] = cell_type[[i]][1]
}
newident <- factor(ct)
Idents(immune_nobatch) <- newident
pdf(file = paste0(outdir,"DimPlot_source.pdf"),width = 9.4,height = 7)
DimPlot(immune_nobatch,cols =c("#999999","#FF0099", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7","#990000","#9900cc","#66FF66","#663300","#0000FF","#CC0033","#FF0000","#333333") )
dev.off()