R 常用代码段
Posted shanyr
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了R 常用代码段相关的知识,希望对你有一定的参考价值。
#用来根据不同的细胞来源重新画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()
以上是关于R 常用代码段的主要内容,如果未能解决你的问题,请参考以下文章