build_surv_for_mut | R Documentation |
use curatedTCGAData to produce survival time structure and mutation matrix for a TCGA tumor type
build_surv_for_mut(project = "BRCA", min.numevents = 10)
project |
character(1), defaults to "BRCA" |
min.numevents |
numeric(1), defaults to 10; fail if there are fewer than this number of events overall |
a list with components surv, coldata, and mutdata
observations lacking positive follow up time are silently omitted
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.