par(mar = c(4, 8, 2, 1))#展示在细胞中表达量最高的geneC=sce.all.filt@assays$RNA@countsdim(C)C=Matrix::t(Matrix::t(C)/Matrix::colSums(C)) * 100# 这里的C 这个矩阵,有一点大,可以考虑随抽样C=C[,sample(1:ncol(C),1000)]#对C取1000个sample即cellmost_expressed <- order(apply(C, 1, median), decreasing = T)[50:1]#对C的每一行进行取中位数pdf("TOP50_most_expressed_gene.pdf",width=14)boxplot(as.matrix(Matrix::t(C[most_expressed, ])),cex = 0.1, las = 1,xlab = "% total count per cell",col = (scales::hue_pal())(50)[50:1],horizontal = TRUE)dev.off()
