use curatedTCGAData to produce survival time structure and mutation matrix for a TCGA tumor type

build_surv_for_mut(project = "BRCA", min.numevents = 10)

Arguments

project

character(1), defaults to "BRCA"

min.numevents

numeric(1), defaults to 10; fail if there are fewer than this number of events overall

Value

a list with components surv, coldata, and mutdata

Note

observations lacking positive follow up time are silently omitted

Examples

requireNamespace("survival")
br = build_surv_for_mut("BRCA")
#> snapshotDate(): 2023-04-24
#> Working on: BRCA_Mutation-20160128
#> see ?curatedTCGAData and browseVignettes('curatedTCGAData') for documentation
#> loading from cache
#> require("RaggedExperiment")
#> Working on: BRCA_colData-20160128
#> see ?curatedTCGAData and browseVignettes('curatedTCGAData') for documentation
#> loading from cache
#> Working on: BRCA_metadata-20160128
#> see ?curatedTCGAData and browseVignettes('curatedTCGAData') for documentation
#> loading from cache
#> Working on: BRCA_sampleMap-20160128
#> see ?curatedTCGAData and browseVignettes('curatedTCGAData') for documentation
#> loading from cache
#> harmonizing input:
#>   removing 14592 sampleMap rows not in names(experiments)
#>   removing 121 colData rownames not in sampleMap 'primary'
#> Error in TCGAprimaryTumors(proj): could not find function "TCGAprimaryTumors"
br
#> Error in eval(expr, envir, enclos): object 'br' not found
has_TTN = apply(br$mutdata, 2, function(x) any(x == "TTN", na.rm=TRUE))
#> Error in eval(expr, envir, enclos): object 'br' not found
fi = survival::survfit(br$surv ~ has_TTN)
#> Error in eval(predvars, data, env): object 'br' not found
plot(fi, lwd=2, col=c("blue", "orange"), xlab = "t = Years from diagnosis", ylab="S(t) = Prob(survive beyond t)")  # KM-plot
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'fi' not found
legend(.1, .3, lwd=2, col=c("blue", "orange"), lty=1, legend=c("TTN wild-type", "TTN-mutant"), bty="n")
#> Error in (function (s, units = "user", cex = NULL, font = NULL, vfont = NULL,     ...) {    if (!is.null(vfont))         vfont <- c(typeface = pmatch(vfont[1L], Hershey$typeface),             fontindex = pmatch(vfont[2L], Hershey$fontindex))    .External.graphics(C_strWidth, as.graphicsAnnot(s), pmatch(units,         c("user", "figure", "inches")), cex, font, vfont, ...)})(dots[[1L]][[1L]], cex = dots[[2L]][[1L]], font = dots[[3L]][[1L]],     units = "user"): plot.new has not been called yet
title("TCGA BRCA survival")
#> Error in title("TCGA BRCA survival"): plot.new has not been called yet