Skip to contents

Plot distances bwtween modified bases and annotate it with estimated nucleosome repeat length (NRL).

Usage

plotModbaseSpacing(
  x,
  hide = TRUE,
  xlim = NULL,
  base_size = 14,
  detailedPlots = FALSE,
  ...
)

Arguments

x

numeric vector giving the counts of distances between modified bases on the same read (typically calculated by calcModbaseSpacing.

hide

If TRUE (the default), hide distance counts not used in the NRL estimate (mind parameter from estimateNRL).

xlim

numeric(2) with the x-axis (distance) limits in the first two plots (see Details). if NULL (the default), the full range defined by x and hide will be used.

base_size

Numeric scalar defining the base font size in pts.

detailedPlots

If TRUE, create three plots instead of just a single plot (see Details).

...

Additional arguments passed to estimateNRL to control NRL estimation.

Value

A ggplot object.

Details

The function will visualize an annotated distance frequencies between modified bases. For detailedPlots=FALSE (the default), it will create a single annotated plot. For detailedPlots=TRUE, it will create three plots (using par(mfrow=c(1,3))):

  1. raw phase counts with de-trending and de-noising loess fits

  2. residual phase counts with de-noising loess fit and detected peaks

  3. linear fit to peaks and NRL estimation

See also

calcModbaseSpacing to calculate the distance frequencies from base modification data, estimateNRL to estimate nucleosome repeat length.

Author

Michael Stadler

Examples

  # see the help for calcModbaseSpacing() for a full example