transcriptRegionSpectrumPlot: Bar-chart to show the hosting transcript regions of binding...

View source: R/PlotFunction.R

transcriptRegionSpectrumPlotR Documentation

Bar-chart to show the hosting transcript regions of binding sites

Description

A diagnostic function that plots the transcript regions of the hosting gene for each binding site. The function assignToTranscriptRegions is expected to be executed prior to calling this plot function.

Usage

transcriptRegionSpectrumPlot(
  object,
  values = c("asis", "percentage"),
  normalize = FALSE,
  normalize.factor = c("sum", "median", "mean"),
  show.others = FALSE,
  text.size = 4
)

Arguments

object

a BSFDataSet object

values

character; if values should be presented 'as-is', that means for example as frequencies in case normalization = FALSE, or as percentages

normalize

logical; whether to normalize values

normalize.factor

character; indicate by what factor values should be normalized to region length by

show.others

logical; whether to show 'others' category. Has to be false if normalize = TRUE

text.size

numeric; font size of the numbers to be displayed on each bar

Details

Count frequencies can be normalized to the length of the hosting region with option normalize. The specific factor how the hosting region length is used is given by normalize.factor. In the case of normalize.factor = "sum" binding site frequencies are divided by the summed length of all regions that host the specific binding site.

Further with option values once can indicate whether raw or normalized frequencies should be shown 'as-is' or normalized to 'percentages'.

Value

a plot of type ggplot

See Also

assignToTranscriptRegions transcriptRegionOverlapsPlot

Examples

# load clip data
files <- system.file("extdata", package="BindingSiteFinder")
load(list.files(files, pattern = ".rda$", full.names = TRUE))
load(list.files(files, pattern = ".rds$", full.names = TRUE)[1])
load(list.files(files, pattern = ".rds$", full.names = TRUE)[2])
bds = makeBindingSites(object = bds, bsSize = 9)
bds = assignToGenes(bds, anno.genes = gns)
bds = assignToTranscriptRegions(object = bds, anno.transcriptRegionList = regions)
transcriptRegionSpectrumPlot(bds)


ZarnackGroup/BindingSiteFinder documentation built on May 31, 2024, 3:29 a.m.