BAWTO

Simple Trial Outcome Queries

library(tidyverse)
sr.tbls <- rsr::get_answers(81395) |> rsr::list_answers(concordance=T,collapse=T)
ae.tbl  <- rsr::get_answers(70431) |> pluck("Adverse Events") # Adverse Events table
names(sr.tbls)
## [1] "basic"                      "biomarker"                 
## [3] "relative outcomes"          "Single Outcomes Ratio"     
## [5] "single_population_outcomes"

Results

Unstudied genes

review.bm <- sr.tbls$biomarker |> pull(biomarker.name) |> unlist(recursive = T) |> unique()
review.bm
##  [1] "BRCA1"      "BRCA2"      "ATM"        "FANCA"      "PALB2"     
##  [6] "BRIP1"      "HDAC2"      "ATR"        "CHEK2"      "MLH1"      
## [11] "MRE11A"     "NBN"        "RAD51C"     "BARD1"      "CDK12"     
## [16] "CHEK1"      "FANCL"      "PPP2R2A"    "RAD51B"     "RAD51D"    
## [21] "RAD54L"     "ETS fusion" "AR"         "TP53"       "PTEN"      
## [26] "FOXA1"      "ZBTB16"     "NCOR1"      "NCOR2"      "PIK3CA"    
## [31] "PIK3CB"     "PIK3R1"     "AKT1"       "APC"        "CTNNB1"    
## [36] "RNF43"      "RSPO2"      "RB1"        "CHD1"       "SPOP"      
## [41] "ZFHX3"      "RAD51"      "MLH3"       "ERCC3"      "MRE11"     
## [46] "MDM2"       "CDKN2A"     "DKN1B"      "MYC"        "CCND1"     
## [51] "MSH2"       "MSH6"       "FOXP1"      "KMT2C"      "KMT2D"     
## [56] "KDM6A"      "NKX3-1"     "ARID1A"     "ATRX"       "FANCF"     
## [61] "FANCG"      "FANCM"      "RAD50"      "WRN"
library(msigdbr)

gs <- msigdbr(species="Homo sapiens") |> filter(gs_name %in% c(
  "KEGG_HOMOLOGOUS_RECOMBINATION",
  "WP_HOMOLOGOUS_RECOMBINATION",
  "REACTOME_HDR_THROUGH_HOMOLOGOUS_RECOMBINATION_HRR"
))

# How many HRR genes?
HRRgenes  <- length(unique(gs$ensembl_gene))

# How many HRR genes unmeasured in our trials? 
newgenes <- gs |> filter(!(human_gene_symbol %in% review.bm)) |> 
  group_by(entrez_gene,human_gene_symbol) |> count()

Queryable data

Get the data

trial <- mutate(sr.tbls$basic,trial=unlist(short_name,recursive=T)) |> select(aid,trial)
spo   <- sr.tbls$single_population_outcomes |> inner_join(trial,by="aid") |> modify(unlist) # single population outcomes
DT::datatable(spo)

Longest reported median overall survival time

What was the longest reported median overall survival time in each trial?

spo |> filter(outcome_type=="OS") |> 
  mutate(outcome_value = as.numeric(outcome_value)) |>
  group_by(trial) |> top_n(1,outcome_value) |> ungroup() |>
  select(outcome_value,outcome_range,int_biomarker,bm_positive,int_bm_mod,trial) |> 
  arrange(desc(outcome_value))
## Warning in mask$eval_all_mutate(quo): NAs introduced by coercion
## # A tibble: 7 × 6
##   outcome_value outcome_range int_biomarker         bm_positive int_bm_mod trial
##           <dbl> <chr>         <chr>                 <chr>       <chr>      <chr>
## 1          32.3 28.4-NR       none                  "NA"        none       Chin…
## 2          24.8 17.4-NC       BRCA2                 ""          qualifyin… PROf…
## 3          22.7 17.4-29.4     none specified        "NA"        NA         Saad…
## 4          19.1 NR            BRCA1,BRCA2           "positive"  qualifyin… PROf…
## 5          18.4 NA            BRCA1,BRCA2           "qualifyin… altered    Frie…
## 6          17.7 9.9-22.2      BRCA1,BRCA2           "positive"  altered    TOPA…
## 7          13.8 NR            BRCA2,ATM,FANCA,CHEK… "positive"  altered    TOPA…

Which PARP-i had the lowest and highest rate of grade 3+ anemia?

The adverse event counts table is loaded from cache below and is derived from ae.tbl which is imported from sysrev.com/p/70431 above. To see how the table is derived see github.com/insilica/bawto

AE.countDF <- readRDS(url("http://insilica.co.s3.amazonaws.com/bawto/resources/adverse_events.rds"))
AE.countDF |> filter(event=="anemia") |> filter(treatment_class=="PARPi",grade=="grade 3+") |> arrange(rate)
## # A tibble: 10 × 16
##    rg_name     order treatment_class grade event patients affected    rate   tot
##    <chr>       <dbl> <chr>           <fct> <chr>    <dbl>    <dbl>   <dbl> <dbl>
##  1 chinnaiyan      2 PARPi           grad… anem…       79        2  0.0253 5.51 
##  2 TRITON2-1      12 PARPi           grad… anem…       78       12  0.154  4.04 
##  3 TOPARP-B        8 PARPi           grad… anem…       49       10  0.204  0.469
##  4 saad            1 PARPi           grad… anem…       71       15  0.211  5.21 
##  5 PROfound-1      6 PARPi           grad… anem…      256       55  0.215  4.45 
##  6 PROfound-2      7 PARPi           grad… anem…      256       58  0.227  4.66 
##  7 TRITON2-2      13 PARPi           grad… anem…      115       29  0.252  4.51 
##  8 TOPARP-A-3…     9 PARPi           grad… anem…       49       15  0.306  6.51 
##  9 TOPARP-A-4…    10 PARPi           grad… anem…       49       18  0.367  7.88 
## 10 moran           0 PARPi           grad… anem…       NA       NA NA      0.679
## # … with 7 more variables: tot_rate <dbl>, event_tot <int>, med_rate <dbl>,
## #   mean_rate <dbl>, has_treatment <lgl>, ev.studies <int>, rate_bucket <fct>