% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/replace_bg.R
\name{replace_bg}
\alias{replace_bg}
\title{Replace the control regions with user provided background.}
\usage{
replace_bg(grl, bg, txdb)
}
\arguments{
\item{grl}{A \code{GRangesList} of the merged peaks which the background regions are waiting to be replaced.}

\item{bg}{A \code{GRanges} or \code{GRangesList} object of the user provided background.}

\item{txdb}{A \code{TxDb} object that define the transcript annotation.}
}
\value{
A \code{GRangesList} object.
The first portion is the exons regions that is not overlapped with \code{annoation}.

If the resulting ranges have less number and width compared with what defined in \code{cut_off_width} or \code{cut_off_num},
the exon regions of txdb will be returned as the background.

The second portion is the restructed user provided annotation with gene id annotated.
}
\description{
Replace the control regions with user provided background.
}
\keyword{internal}
