changes the coordinates of tidy_cpgs to the fragment coordinates. This is necessary to avoid over-counting of reads with coordinates that are shifted by several bps from the restriction site.

gpatterns.adjust_read_pos(calls, frag_intervs, maxdist = 0,
  rm_off_target = TRUE)

Arguments

calls
tidy_cpgs data frame
frag_intervs
intervals set of the fragment
maxdist
maximal distance from fragments
rm_off_target
if TRUE - remove reads with distance > maxdist from frag_intervs if FALSE - those reads would be left unchanged

Value

tidy_cpgs data frame with chrom,start,end coordinates adjusted to fragment intervals