tnsPlotCovariates-methods: Plot regulon activity and categorical covariates

Description Usage Arguments Details Value Examples

Description

This method plots regulon activity for a given regulon in all samples and adds covariate tracks to evaluate the regulon activity distribution. The samples are order by regulon activity for that particular regulon.

Usage

1
2
3
4
5
## S4 method for signature 'TNS'
tnsPlotCovariates(tns, regs = NULL, attribs = NULL,
  fname = "covarplot", fpath = ".", plotpdf = FALSE,
  plotbatch = FALSE, panelHeights = c(1, 1), width = 5.3,
  height = 4, dummyEncode = TRUE, divs = NULL)

Arguments

tns

A A TNS object.

regs

An optional string vector specifying regulons to plot.

attribs

A character vector of column names from the survivalData. All attribs should be either binary encoded or categorical variables for plotting. Available attribs can be checked by running colnames(tnsGet(tns, "survivalData"))

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

plotpdf

A logical value. If TRUE, a pdf file is created instead of plotting to the graphics device.

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.

panelHeights

A numeric vector of length 2 specifying the relative heights of the panels (regulon activity plot, and covariate tracks)

width

A numeric value. Represents the width of the plot.

height

A numeric value. Represents the height of the plot.

dummyEncode

A logical value. If TRUE, all categorical variables are dummy encoded. If FALSE, categorical variables are represented as one track and a legend is added to the plot.

divs

A numeric vector of division positions in the covariate tracks.

Details

Automatic dummy encoding is available for categorical variables.

Value

A plot of regulon activity and covariate tracks.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 # load survival data
 data(survival.data)
 # load TNI-object
 data(stni, package = "RTN")
 
 # create TNS object
 stns <- tni2tnsPreprocess(stni, survivalData = survival.data,
 keycovar = c('Grade','Age'), time = 1, event = 2)
 stns <- tnsGSEA2(stns)
 
 # plot only binary covariates
 tnsPlotCovariates(stns, "MYB", 
 attribs = c("ER+", "ER-", "PR+", "PR-", "LumA", "LumB", "Basal", "Her2",
 "Normal"),
 divs = c(2, 4))
 
 # also dummy encode categorical variables (LN and Grade)
 tnsPlotCovariates(stns, "MYB", 
 attribs = c("ER+", "ER-", "PR+", "PR-", "LumA", "LumB", "Basal", "Her2",
 "Normal", "LN", "Grade"),
 divs = c(2, 4, 9, 12))
 
 # don't dummy encode categorical variables
 tnsPlotCovariates(stns, "MYB", attribs = c("ER+", "ER-", "PR+", "PR-",
 "LumA", "LumB", "Basal", "Her2", "Normal", "Grade"), divs = c(2, 4, 9),
 dummyEncode = FALSE)
 

csgroen/RTNsurvival documentation built on May 20, 2019, 1:49 p.m.