TCGAbiolinks (version 1.2.5)

TCGAanalyze_survival: Creates survival analysis

Description

Creates a survival plot from TCGA patient clinical data using survival library. It uses the fields days_to_death and vital, plus a columns for groups.

Usage

TCGAanalyze_survival(data, clusterCol = NULL, legend = "Legend", labels = NULL, cutoff = 0, main = "Kaplan-Meier Overall Survival Curves", ylab = "Probability of survival", xlab = "Time since diagnosis (days)", filename = "survival.pdf", color = NULL, height = 8, width = 12, dpi = 300, legend.position = "inside", legend.title.position = "top", legend.ncols = 1, add.legend = TRUE, print.value = TRUE, add.points = TRUE)

Arguments

data
TCGA Clinical patient with the information days_to_death
clusterCol
Column with groups to plot. This is a mandatory field, the caption will be based in this column
legend
Legend title of the figure
labels
labels of the plot
cutoff
xlim This parameter will be a limit in the x-axis. That means, that patients with days_to_deth > cutoff will be set to Alive.
main
main title of the plot
ylab
y axis text of the plot
xlab
x axis text of the plot
filename
The name of the pdf file.
color
Define the colors of the lines.
height
Image height
width
Image width
dpi
Figure quality
legend.position
Legend position ("top", "right","left","bottom")
legend.title.position
Legend title position ("top", "right","left","bottom")
legend.ncols
Number of columns of the legend
add.legend
If true, legend is created. Otherwise names will be added to the last point in the lines.
print.value
Print pvalue in the plot? Default: TRUE
add.points
If true, shows each death at the line of survival curves

Value

Survival plot

Examples

Run this code
days_to_death <- floor(runif(200, 1, 1000))
vital_status <- c(rep("Dead",200))
groups <- c(rep(c("G1","G2"),c(100,100)))
df <- data.frame(days_to_death,vital_status,groups)
TCGAanalyze_survival(df,clusterCol="groups")
## Not run: 
# clinical <- TCGAquery_clinic("gbm","clinical_patient")
# TCGAanalyze_survival(clinical,"gender", filename = "surv.pdf", legend="Gender")
# ## End(Not run)

Run the code above in your browser using DataLab