plotFeature: Plot features of interest

View source: R/plotFeature.R

plotFeatureR Documentation

Plot features of interest

Description

plot each feature with (or without) the fitted trend.

Usage

plotFeature(Data, tVectIn = NULL, featureNames, showFit = TRUE,
  simple = FALSE, showLegend = TRUE, trendyOutData = NULL,
  cexLegend = 1, legendLocation = "side", xlab = "Time",
  ylab = "Normalized Expression", segColors = c("chartreuse3",
  "coral1", "black", "cornflowerblue"), customTitle = NULL,
  customLabels.x = NULL, spacing.x = NULL)

Arguments

Data

a matrix of normalized expression measurements. Rows are genes/features and columns are samples.

tVectIn

a numerical vector indicating the time-points or the order of samples. If it is NULL (default), then the time/order will be assumed to be equaly spaced from 1:N (N is number of samples).

featureNames

a list of genes or features to plot

showFit

whether to plot the segmented regression fitting (default is TRUE)

simple

if TRUE the plot will not highlight the breakpoints and segments and will only display a black fitted line. (default is FALSE)

showLegend

if TRUE and simple=FALSE then a legend will be output (default = TRUE)

trendyOutData

segmented regression fitting result from running trendy(); if showFit is TRUE and trendyOutData is NULL, then the segmented regression will be fit for each of the genes and it may take longer to run

cexLegend

cex option for sizing of legend text, default is 1.

legendLocation

whether to place the legend to the right 'side' of each plot or at the 'bottom' of a multo-panelled plot (default is 'side').

xlab

x-axis name

ylab

y-axis name

segColors

define colors for the 'breakpoint', and 'up', 'same', 'down' segments (default: segColors = c("chartreuse3", "coral1", "black", "cornflowerblue"))

customTitle

default is set the plot title as the name of the feature. Otherwise this should be a named vector, with the featureName as the name and the element as the desired plot title. (i.e. customTitle <- c("MyTitle" = gene1)).

customLabels.x

specify x-axis tick labels instead of using the default values from tVectIn.

spacing.x

specify x-axis tick spacing, smaller values give more tick marks.

Value

plot of gene expression and fitted line

Author(s)

Ning Leng and Rhonda Bacher

Examples

 d1 <- matrix(c(c(rnorm(50,5,1),sort(rnorm(50, 15, 5))), rnorm(100, 50,10)), 2, 100, TRUE)
 rownames(d1) <- c("g1","g2")
 colnames(d1) <- paste0("time", seq_len(100))
 plotFeature(d1, featureNames=c("g1","g2"))

rhondabacher/Trendy documentation built on Oct. 26, 2023, 3:46 a.m.