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
| sig_met <- subset(res, status != "Not Significant") res_data <- subset(data.hg38, subset = (rownames(data.hg38) %in% rownames(sig_met))) library(circlize) library(ComplexHeatmap) group <- group[substr(colnames(data.hg38), 1, 12), ]
ha <- HeatmapAnnotation(`Risk group` = group$group, `Risk Score` = group$Risk_Score, col = list( `Risk group` = c("Low Risk" = "#99CCFFAA", 'High Risk' = '#FF6666AA') ),
show_annotation_name = TRUE) heatmap <- Heatmap( assay(res_data), name = "DNA methylation", col = matlab::jet.colors(200), show_row_names = FALSE, cluster_rows = TRUE, cluster_columns = FALSE, show_column_names = FALSE, bottom_annotation = ha, column_title = "DNA Methylation", column_order = order(group$Risk_Score) ) pdf("./prad_meth_heatmap.pdf",width = 6, height = 4);{ draw(heatmap, annotation_legend_side = "bottom") };dev.off()
|