% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocess.R
\name{diff_expr_make_contrasts}
\alias{diff_expr_make_contrasts}
\title{Function to make contrast matrix}
\usage{
diff_expr_make_contrasts(
  design,
  groups,
  pairs = NULL,
  block = FALSE,
  contrasts = NULL
)
}
\arguments{
\item{design}{Numeric design matrix.}

\item{groups}{\code{character}. Vector of group names.}

\item{pairs}{\code{character}. Name of the column in 'samp.info' containing paired sample information.}

\item{block}{\code{logical}. Are the samples not independent? See Details section.}

\item{contrasts}{Character vector specifying group name pairs to be compared in the format expected by
\code{makeContrasts()}, i.e., "group2-group1".}
}
\value{
A contrast \code{matrix} as produced by \code{\link[limma]{makeContrasts}}, or \code{NULL}
  when no contrast matrix is needed because the comparisons are already inherent to the design matrix.
}
\description{
Function to make contrast matrix
}
\details{
The 'block' argument is used to specify whether the comparisons are to be made within AND between subjects or in the case of
technical replicates, i.e., if the samples are not independent, in other words, correlated.
  @seealso [makeContrasts()]
}
\examples{
si <- diff_expr_get_samp_info(diffwrap_samp_info, "SampleName", "Group")
groups <- stats::relevel(si$Groups, ref = "control")
design <- diff_expr_make_design(si, groups)
diff_expr_make_contrasts(design, groups)
}
