build_surv_for_mut: use curatedTCGAData to produce survival time structure and...

View source: R/build_surv.R

build_surv_for_mutR Documentation

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

Description

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

Usage

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")
has_TTN = apply(br$mutdata, 2, function(x) any(x == "TTN", na.rm=TRUE))
fi = survival::survfit(br$surv ~ has_TTN)
plot(fi, lwd=2, col=c("blue", "orange"), xlab = "t = Years from diagnosis", ylab="S(t) = Prob(survive beyond t)")  # KM-plot
legend(.1, .3, lwd=2, col=c("blue", "orange"), lty=1, legend=c("TTN wild-type", "TTN-mutant"), bty="n")
title("TCGA BRCA survival")

vjcitn/YESCDS documentation built on Oct. 30, 2024, 1:18 p.m.