Estimate the nucleosome repeat length (NRL) from modified-base distances.
Source:R/modbase_spacing.R
estimateNRL.Rd
Estimate the nucleosome repeat length (NRL) from the frequencies
of same-read modified base distances, e.g. generated by
calcModbaseSpacing
. The NRL is obtained from the slope of a
linear fit to the modes in the distance distribution.
Arguments
- x
numeric
vector giving the counts of distances (typically the calculated withcalcModbaseSpacing
.- 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-percent 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
- 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
calcModbaseSpacing
to calculate the distances from
base modification data, plotModbaseSpacing
to visualize
annotated distance frequencies between modified bases.