plotTSIS: Plot time-series switches of a pair of isoforms

View source: R/plotTSIS.R

plotTSISR Documentation

Plot time-series switches of a pair of isoforms

Description

Plot time-series switches of a pair of isoforms

Usage

plotTSIS(data2plot, scores = NULL, iso1 = NULL, iso2 = NULL,
  gene.name = NULL, y.lab = "Expression", make.plotly = F, times,
  prob.cutoff = 0.5, x.lower.boundary = 9, x.upper.boundary = 17,
  show.region = T, show.scores = T, error.type = "stderr",
  show.errorbar = T, errorbar.width = 0.1, errorbar.size = 0.5,
  line.width = 1, point.size = 3, marker.size = 1, spline = F,
  spline.df = NULL, ribbon.plot = F)

Arguments

data2plot

the transcript isoform expression data for switch plots with rows of isoforms and columns of samples. See TSIS.data$data.exp for details.

scores

the output scores of functions iso.switch and score.filter. Default is NULL. To show score labels on the plot, the scores must be provided.

iso1, iso2

character string names of isoforms to plot. the input data2plot must be a data frame of two rows and the row names are used as isoforms to plot.

gene.name

a character string of gene name to show as the title of the plot. If gene.name=NULL, the plot title will be "iso1_vs_iso2".

y.lab

the y axis label of the plot, default is "Expression".

make.plotly

logical, to plot plotly format figures (TRUE) or ggplot2 format figures(FALSE)?. See details in ggplotly in plotly R pacakge.

times

a numeric vector of time labellings of all the relicated samples, e.g. 1,1,1,2,2,2,3,3,3,...

prob.cutoff

the cut-off of switch frequencies/probabilities to label the switch points.

x.lower.boundary, x.upper.boundary

Specifies the time frame of interest to investigate the isoform switches.

show.region

logical, to highlight the time frame under investigation (TRUE) or not (FALSE)?

show.scores

logical, to show score labels on the plot (TRUE) or not (FALSE)? The scores object must be provided.

error.type

the error type used to show the error bar in the plots. Options are "stderr" for standard error and "sd" for standard deviation. See details in data.error.

show.errorbar

logical, to show error bar (TRUE) or not (FALSE) in the error bar plot.

errorbar.width, errorbar.size

the width and size of error bars. See detials in geom_errorbar in ggplot2 R pacakge.

line.width, point.size

line width and point marker size of the plots.

spline

logical, to plot the spline smoothed lines (TRUE) or the lines of mean expression (FALSE).

spline.df

the degree of freedom used for spline. The value must be the same as in the function iso.switch. See spline details in geom_smooth in ggplot2 and ns in splines.

ribbon.plot

logcial, to make ribbon plot (TRUE) or error bar plot (FALSE). See ribbon plot details in geom_smooth in ggplot2 R pacakge.

Value

a ggplot2 or ggplotly (if plotly=TRUE) plot.

See Also

ggplotly, iso.switch, score.filter, data.error, geom_smooth, ns

Examples


#generate random datasets
set.seed(100)
data2plot<-data.frame(matrix(abs(rnorm(60)),nrow=2),row.names = c('iso1','iso2'))
#error bar plot
plotTSIS(data2plot=data2plot,scores=NULL,iso1=NULL,iso2=NULL,gene.name=NULL,
        y.lab='Expression',make.plotly=F,times=rep(1:10,each=3),prob.cutoff=0.5,x.lower.boundary=3,
        x.upper.boundary=8,show.region=T,error.type='stderr',ribbon.plot = F)

#ribbon plot
plotTSIS(data2plot=data2plot,scores=NULL,iso1=NULL,iso2=NULL,gene.name=NULL,
         y.lab='Expression',make.plotly=F,times=rep(1:10,each=3),prob.cutoff=0.5,x.lower.boundary=3,
         x.upper.boundary=8,show.region=T,error.type='stderr',ribbon.plot = T)


wyguo/TSIS documentation built on May 21, 2023, 12:36 a.m.