1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| immune[['tmp']] <- paste(as.character(immune[['immune_type_2']][[1]]), as.character(immune[['group']][[1]]))
M_c <- subset(immune, cell_type == 'Myeloid') M_c <- sc.metabolism.Seurat(obj = M_c, method = "VISION", imputation = F, ncores = 12, metabolism.type = "KEGG")
sM_h <- read.csv('selected_pathway_high.CSV', header = F) sM_m <- read.csv('selected_pathway_medium.CSV', header = F) sM_l <- read.csv('selected_pathway_low.CSV', header = F)
P7_h <- f_matrix_heatmap(f_matrix_groupMean(M_c@assays$METABOLISM$score[unlist(sM_h),], M_c[['tmp']]), levels = unlist(sM_h)) + theme(axis.text.x=element_blank()) P7_m <- f_matrix_heatmap(f_matrix_groupMean(M_c@assays$METABOLISM$score[unlist(sM_m),], M_c[['tmp']]), levels = unlist(sM_m)) + theme(axis.text.x=element_blank()) P7_l <- f_matrix_heatmap(f_matrix_groupMean(M_c@assays$METABOLISM$score[unlist(sM_l),], M_c[['tmp']]), levels = unlist(sM_l))
require(patchwork) require(dplyr) P7 <- (P7_h / P7_m / P7_l) + plot_layout(nrow = 3, heights = c(nrow(sM_h), nrow(sM_m), nrow(sM_l) + 3))
ggsave(P7, filename = 'HSPC vs CRPC_M.pdf', dpi = 1200, width = 12, height = 10, device = 'pdf', limitsize = FALSE)
|