% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/getBackgroundBins.R
\name{getBackgroundBins}
\alias{getBackgroundBins}
\title{getBackgroundBins}
\usage{
getBackgroundBins(
  x,
  bias = NULL,
  flbias = NULL,
  w = 0.1,
  bs = NULL,
  pseudo = 0,
  verbose = TRUE
)
}
\arguments{
\item{x}{A SummarizedExperiment containing a 'counts' assay, or a matrix of
counts, or a vector of expected (e.g. mean) counts.}

\item{bias}{A vector of length equal to \code{ncol(object)} specifying the
per-peak bias (i.e. GC content). If omitted, will try to get it
from \code{rowData(x)$bias}.}

\item{flbias}{A vector of length equal to \code{ncol(object)} specifying the
per-peak fragment length bias (e.g. log10-transformed median length of
fragments overlapping each region). If omitted, will try to get it
from \code{rowData(object)$flbias}. If absent, will use 2-dimensional bias bins
(which is already pretty good).}

\item{w}{Standard deviation of the Gaussian kernel.}

\item{bs}{Number of bins per dimension. This can be a single integer (total
bins = \code{bs^2}), or an integer vector of length 2 (if \code{flbias=NULL}) or 3
(in which case there are \code{prod(bs)} total bins). The values specify the
number of bins for, in order: enrichment, GC and fragment length. By
default, \code{bs=50} if \code{flbias} is not provided (mimicking chromVAR), and
\code{bs=c(30, 30, 6)} if it is.}

\item{pseudo}{Optional pseudocount to be added. This should not be needed
with standard workflows.}

\item{verbose}{Whether to print processing info.}
}
\value{
A \code{bcvBackground} object, to be used with
\code{\link{computeBackgrounds}}.
}
\description{
Computes chromVAR-like background (i.e. bias) bins, as well as bin-to-bin
selection probabilities needed for \code{\link{betterChromVAR}}.
}
\details{
The procedure underlying this function is the same as in
\code{chromVAR::getBackgroundPeaks}, with the following differences:
\itemize{
\item Rather than producing a set of background peaks for each input peak, the
function returns peak-to-bin mappings and bin-to-bin background selection
probabilities, which enables an analytic background computation. It is, as
such, entirely deterministic.
\item The function supports the optional use of a third bias dimension, provided
through the \code{flbias} argument, meant for fragment length bias. This is
still an experimental feature.
}
}
\examples{
counts_se <- getDummyData()$counts
background <- getBackgroundBins(counts_se)
}
\references{
Schep A.N., Wu B., Buenrostro J.D., Greenleaf W.J. (2017) chromVAR:
inferring transcription-factor-associated accessibility from
single-cell epigenomic data, Nature Methods, doi: 10.1038/nmeth.4401
}
