Estimate the nucleosome repeat length (NRL) from the frequencies of same-strand alignment distances (phasogram), e.g. generated by calcPhasogram. The NRL is obtained from the slope of a linear fit to the modes in the phasogram.

estimateNRL(
  x,
  mind = 140L,
  usePeaks = 1:8,
  span1 = 100/length(x),
  span2 = 1500/length(x)
)

Arguments

x

numeric vector giving the counts of alignment distances (typically the output of calcPhasogram.

mind

integer(1) specifying the minimal distance to be used for NRL estimation. The default value (140) ignores any distance too short to span at least a single nucleosome.

usePeaks

integer vector selecting the modes (peaks) in the phasogram used in NRL estimation.

span1

numeric(1) giving the smoothing parameter for de-trending loess fit (high pass filter).

span2

numeric(1) giving the smoothing parameter for de-noising loess fit (low pass filter).

Value

A list with elements:

nrl

the estimated nucleosome repeat length

nrl.CI95

the 95% confidence interval

xs

smoothed (de-trended) phasogram

loessfit

the de-noising fit to the de-trended phasogram

lmfit

the linear fit to the phasogram peaks

peaks

the peak locations

mind

minimal distance included in the fit

span1

smoothing parameter for de-trending loess fit

span2

smoothing parameter for de-noising loess fit

usePeaks

the peaks used in the fit

See also

calcPhasogram to calculate the phasogram from alignments, plotPhasogram to visualize an annotated phasogram

Author

Michael Stadler

Examples

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