BAWTO
Prostate Specific Antigen Forest Plot
The BAWTO publication forest-plots describe prostate response rates as a function of biomarker. This vignette domonstrates how those figures are constructed. These figures can be updated in a live fashion as data is added to the relevant sysrev.com projects.
Get the Data
The construction of psatbl
can be viewed at github.com/insilica/bawto. Here, a cached version is loaded for brevity and reproducibility. The below table shows the trials, biomarkers, and treatments that were tracked. The full table also includes patient counts and response rate data used in the next section.
library(tidyverse)
psatbl <- readRDS(url("http://insilica.co.s3.amazonaws.com/bawto/resources/psa_response.rds"))
DT::datatable(psatbl |> select(trial=short_name,biomarker,treatment) |> distinct())
Build the figures
After extracting a resposne rate table (partially displayed above), the meta package provides metaprop
for building proportion analysis and forest
for displaying a forest plot result.
library(meta)
pdf <- psatbl |> rename(event=num_response.x, n=num_patients.x) |> mutate(rate=event/n)
m.gen <- metaprop(event,n, studlab=biomarker, data=pdf, title="PSA Response")
left.labs <- c("short_name","biomarker","biomarker_modifier","treatment")
right.labs <- c("rate","num_patients")
forest(m.gen,
sortvar = pdf$row,
subgroup = T, print.subgroup.labels = T, # Subgroups
xlim=c(0.0,1.0), # X axis limits
col.study = pdf$lcolor,col.square = pdf$lcolor, # colors
col.square.lines = "black",col.label.left = "red", # more colors
comb.fixed = F, comb.random = F, # pooling effects (disabled)
leftlabs = left.labs, leftcols = left.labs, # column labels
rightlabs = right.labs, rightcols = right.labs, # column labels
smlab="PSA Response" # title
)
Unfortunately the meta package generates some difficult to work with figures. Below is a cached png of the manipulated above output.
That's it! To learn more about how the data for this figure was built, visit github.com/insilica/bawto.