Skip to contents

Plot p-values of survival difference between groups based on multiple cutoffs

Usage

plotSurvivalPvaluesByCutoff(
  clinical,
  data,
  censoring,
  event,
  timeStart,
  timeStop = NULL,
  followup = "days_to_last_followup",
  significance = 0.05,
  cutoffs = seq(0, 0.99, 0.01)
)

Arguments

clinical

Data frame: clinical data

data

Numeric: elements of interest to test against the cutoff

censoring

Character: censor using left, right, interval or interval2

event

Character: name of column containing time of the event of interest

timeStart

Character: name of column containing starting time of the interval or follow up time

timeStop

Character: name of column containing ending time of the interval (only relevant for interval censoring)

followup

Character: name of column containing follow up time

significance

Numeric: significance threshold

cutoffs

Numeric: cutoffs to test

Value

p-value plot

Examples

clinical <- read.table(text = "2549   NA ii  female
                                840   NA i   female
                                 NA 1204 iv    male
                                 NA  383 iv  female
                               1293   NA iii   male")
names(clinical) <- c("patient.days_to_last_followup",
                     "patient.days_to_death",
                     "patient.stage_event.pathologic_stage",
                     "patient.gender")
clinical <- do.call(rbind, rep(list(clinical), 5))
rownames(clinical) <- paste("Subject", seq(nrow(clinical)))

# Calculate PSI for skipped exon (SE) and mutually exclusive (MXE) events
annot <- readFile("ex_splicing_annotation.RDS")
junctionQuant <- readFile("ex_junctionQuant.RDS")

psi <- quantifySplicing(annot, junctionQuant, eventType=c("SE", "MXE"))
#> Using 3 of 3 events (100%) whose junctions are present in junction quantification data...
#>   |                                        |   0% 
  |========                                |  20% 
  |================                        |  40% 
  |========================                |  60% 
  |================================        |  80% 
  |========================================| 100% 

#> Using 3 of 3 events (100%) whose junctions are present in junction quantification data...
#>   |                                        |   0% 
  |========                                |  20% 
  |================                        |  40% 
  |========================                |  60% 
  |================================        |  80% 
  |========================================| 100% 


# Match between subjects and samples
match <- c("Cancer 1"="Subject 3",
           "Cancer 2"="Subject 17",
           "Cancer 3"="Subject 21")

eventData <- assignValuePerSubject(psi[3, ], match)

event      <- "days_to_death"
timeStart  <- "days_to_death"
plotSurvivalPvaluesByCutoff(clinical, eventData, censoring="right",
                            event=event, timeStart=timeStart)