tnsPlotKM-methods: Kaplan-Meier plots for TNS class objects

Description Usage Arguments Value Examples

Description

Makes a 2 or 3 panel plot for survival analysis. The first panel shows the differential Enrichment score (dES) for all samples, ranked by dES in their sections. The second (optional) panel shows the status of other attributes which may be present in the survival data frame for all samples. The third panel shows a Kaplan-Meier plot computed for the given survival data, with a curve for each section.

Usage

1
2
3
4
5
6
## S4 method for signature 'TNS'
tnsPlotKM(tns, regs = NULL, attribs = NULL,
  fname = "survplot", fpath = ".", xlab = "Months",
  ylab = "Survival probability", colorPalette = "bluered",
  plotpdf = FALSE, plotbatch = FALSE, width = 6.3, height = 3.6,
  panelWidths = c(3, 2, 4))

Arguments

tns

A TNS object, which must have passed GSEA2 analysis.

regs

An optional string vector specifying regulons to make the plot.

attribs

A numeric vector. Contains the columns of the survival data.frame which will be plotted for the second panel.

fname

A string. The name of the file in which the plot will be saved

fpath

A string. The path to the directory where the plot will be saved

xlab

A string. The label for the x axis on the third panel. This should be the measure of time shown in the survival data frame after the last check-up.

ylab

A string. The label for the y axis on the third panel

colorPalette

A string, which can be 'red', 'blue', 'redblue', or 'bluered'. Alternatively, it can be colors or hex values.

plotpdf

A logical value. If TRUE, the plot is saved as a pdf file. If false, it is plotted in the plotting area.

plotbatch

A logical value. If TRUE, plots for all regulons are saved in the same file. If FALSE, each plot for each regulon is saved in a different file.

width

A numeric value. Represents the width of the plot.

height

A numeric value. Represents the height of the plot.

panelWidths

A numeric vector of length=3 specifying the relative width of the internal panels.

Value

A plot, showing a graphical analysis for the 'tnsKM' function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# load survival data
data(survival.data)

# load TNI-object
data(stni, package = "RTN")

stns <- tni2tnsPreprocess(stni, survivalData = survival.data, 
        keycovar = c('Grade','Age'), time = 1, event = 2)
stns <- tnsGSEA2(stns)
stns <- tnsKM(stns)
tnsPlotKM(stns)

csgroen/RTNsurvival documentation built on April 2, 2019, 9:56 p.m.