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 29 30 31 32 33 34 35 36 37
| dfc <- readRDS('clinical.rds') dfc <- cbind(df1[rownames(dfc),1:11],dfc) dfc$group <- df$group results <- formula_rd(nomogram = nom1) dfc$Risk_Points <- points_cal(formula = results$formula,rd=dfc) dfc saveRDS(dfc, 'dfc.rds')
library(circlize) library(ComplexHeatmap) dfc <- dfc[order(dfc$Risk_Points),]
ha <- HeatmapAnnotation(`Risk group` = dfc$group, `Risk Points` = dfc$Risk_Points, DFS.status = dfc$status, DFS.time = dfc$time, T = dfc$T, N = dfc$N, M = dfc$M, logPSA = dfc$PSA, `Gleason Score` = dfc$GS, Age = dfc$Age, col = list( `Risk group` = c("Low Risk" = "#99CCFFAA", 'High Risk' = '#FF6666AA') ),
show_annotation_name = TRUE) mat <- as.matrix(dfc[1:11]) rownames(mat) <- NULL mat <- t(mat) col_fun <- colorRamp2( c(-4, 0, 4), c("#99CCCCAA", "white", "#BC3C29AA") ) options(repr.plot.width=12, repr.plot.height=8) Heatmap(mat, name = 'Relative Expression', top_annotation = ha, column_order = order(dfc$Risk_Points), col=col_fun)
|