% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qc_util.R
\name{diff_expr_pseudo_counts}
\alias{diff_expr_pseudo_counts}
\title{Function to calculate pseudo counts representing batch-corrected normalised but untransformed values}
\usage{
diff_expr_pseudo_counts(
  d,
  design,
  pairs = "pairs",
  disp = "tagwise.dispersion",
  do.cpm = TRUE
)
}
\arguments{
\item{d}{Passed to \code{edgeR} functions: matrix of counts or a DGEList object.}

\item{design}{numeric design matrix}

\item{pairs}{\code{character}. Name of column with identifiers specifying paired samples for paired or other block designs, or batch effects.
Defaults to "pairs" as this is the prefix added by 'diff_expr_make_design()'. When used outside the package's scope the user
must supply the correct prefix.}

\item{disp}{\code{character}. one of "tagwise.dispersion", "trended.dispersion", "bin.dispersion"}

\item{do.cpm}{\code{logical}. should the pseudo counts be transformed to CPMs?}
}
\value{
A \code{matrix} of pseudo counts in which the effect of the blocking variable has been
  removed; on the log2 counts per million scale if \code{do.cpm=TRUE} and on the count scale
  otherwise.
}
\description{
Function to calculate pseudo counts representing batch-corrected normalised but untransformed values
}
\examples{
\donttest{
si <- diff_expr_get_samp_info(diffwrap_samp_info, "SampleName", "Group")
si$Subject <- diffwrap_samp_info$Subject[order(diffwrap_samp_info$SampleName)]
counts <- diff_expr_filter_counts(diff_expr_read_counts(diffwrap_counts, si), si)
groups <- stats::relevel(si$Groups, ref = "control")
d <- edgeR::calcNormFactors(edgeR::DGEList(counts, group = groups))
design <- diff_expr_make_design(si, groups, pairs = "Subject")
pc <- diff_expr_pseudo_counts(d = d, design = design, pairs = "pairs")
dim(pc)
}
}
