plot.serp_data: Plot a profile along a gene

Description Usage Arguments Details Value See Also

View source: R/utils_enrichment.R

Description

For each position, a confidence interval is plotted. Transparency reflects the total number of reads contributing to the confidence interval.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S3 method for class 'serp_data'
plot(
  data,
  gene,
  type = c("enrichment", "rpm"),
  samples,
  sample1,
  sample2,
  exp,
  rep,
  bin,
  window_size,
  conf.level = 0.95,
  color = exp,
  highlightregion = list(),
  highlightargs = list()
)

Arguments

data

A serp_data object. Must contain raw (unnormalized) read counts.

gene

Name of the gene/ORF to plot.

type

Plot type. One of enrichment, rpm.

samples

Samples to plot. If missing, all samples will be plotted.

sample1

Name of the first sample (the numerator). If missing, the default sample1 of the data set will be used.

sample2

Name of the second sample (the denominator). If missing, the default sample2 of the data set will be used.

exp

Character vector of experiments to plot. If missing, all experiments are plotted.

rep

Character vector of replicates to plot. If missing, all replicates will be plotted.

bin

Bin level (bynuc or byaa). If missing, the default binning level of the data set will be used.

window_size

Neighborhood size for the confidence interval calculation in nucleotides. If missing, the default window size of the data set will be used.

conf.level

Confidence level.

highlightargs

Named list of additional parameters to pass to annotate. Each list element will be recycled to match the number of annotations.

colaes

Variable to use for the color scale.

higlightregion

Regions in the plot to be highlighted. Can be either a list containing two-element numeric vectors or a two-column matrix. Rectangles spanning the entire height of the plot will be drawn between the given x positions.

Details

If type is enrichment, a binomial confidence interval for enrichment of sample1 compared to sample2 is calculated using binom_ci_profile. The samples argument is ignored.

If type is samples, a Poisson confidence interval for RPM in samples samples is calculated using pois_ci_profile. The upper and lower bounds are then divided by window_size to indicate confidence in the local smoothed read density. The sample1 and sample2 arguments are ignored.

Value

A ggplot object.

See Also

defaults


ilia-kats/RiboSeqTools documentation built on Oct. 5, 2020, 7:41 p.m.