tnsPlotKM,TNS-method {RTNsurvival} | R Documentation

## Kaplan-Meier plots for TNS class objects

### 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

    ## 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 character vector of attributes listed in the column names of the survivalData. All attributes should be binary encoded for plotting. Available attributes can be checked by running colnames(tnsGet(tns, "survivalData")). Alternatively, attributes can be grouped when provided within a list.
`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

    # 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)

[Package RTNsurvival version 1.12.2 Index]