insilica.co/BAWTO
HRD Review - Hazard Treemap
The hazard treemap provides a method for visualizing what parts of a set of biomarkers are responsible for aggregate reported hazards. For example, in the PROfound prostate cancer trial, hazard ratios are reproted for patients receiving olaparib relative to other therapies. Two biomarker based populationes are described and hazards ratios are reported for each. A treemap helps to visualize those cohorts and subpopulations.
Get the Data
Here, the data is loaded from a cache, but you can see how the whole table is constructed at github.com/insilica/bawto. The tree
variable is just a table listing biomarkers, outcomes, and other values plotly::plot_ly
needs.
library(plotly)
tree <- readRDS(url("http://insilica.co.s3.amazonaws.com/bawto/resources/hazard-tree.rds"))
tree |> select(biomarker,outcome) |> head(3)
## # A tibble: 3 × 2
## biomarker outcome
## <chr> <dbl>
## 1 <b>HRD_PROfound</b> 0.79 (0.61-1.03) 0.79
## 2 <b>BRCA2 | BRCA1 | ATM</b> 0.69 (0.5-0.97) 0.69
## 3 @BRCA2 0.59
Make a treemap
The plotly treemap visualization plotly.com/python/treemaps/ is used with the above data.
plotly::plot_ly(tree, type = "treemap", text = ~text, labels = ~biomarker,
values = ~patients,
textinfo = "label+value+percent parent+percent root",
texttemplate = "<b>%{label}</b><br>%{text}",
parents = ~parent,
marker = list(colors = ~color),
branchvalues = "total")