TCGAanalyze_survival: Creates survival analysis

Description Usage Arguments Value Examples

View source: R/methylation.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
TCGAanalyze_survival(
  data,
  clusterCol = NULL,
  legend = "Legend",
  labels = NULL,
  risk.table = TRUE,
  xlim = NULL,
  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,
  pvalue = TRUE,
  conf.int = 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

risk.table

show or not the risk table

xlim

x axis limits e.g. xlim = c(0, 1000). Present narrower X axis, but not affect survival estimates.

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/Pallete for lines.

height

Image height

width

Image width

dpi

Figure quality

pvalue

show p-value of log-rank test

conf.int

show confidence intervals for point estimates of survival curves.

...

Further arguments passed to ggsurvplot.

Value

Survival plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 # clin <- GDCquery_clinic("TCGA-BRCA","clinical")
 clin <- data.frame(
      vital_status = c("alive","alive","alive","dead","alive",
                       "alive","dead","alive","dead","alive"),
      days_to_death = c(NA,NA,NA,172,NA,NA,3472,NA,786,NA),
      days_to_last_follow_up = c(3011,965,718,NA,1914,423,NA,5,656,1417),
      gender = c(rep("male",5),rep("female",5))
 )
TCGAanalyze_survival(clin, clusterCol="gender")
TCGAanalyze_survival(clin, clusterCol="gender", xlim = 1000)
TCGAanalyze_survival(clin,
                     clusterCol="gender",
                     risk.table = FALSE,
                     conf.int = FALSE,
                     color = c("pink","blue"))
TCGAanalyze_survival(clin,
                     clusterCol="gender",
                     risk.table = FALSE,
                     xlim = c(100,1000),
                     conf.int = FALSE,
                     color = c("Dark2"))

daniel615212950/TCGAbiolinks documentation built on Dec. 19, 2021, 8:06 p.m.