% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qc_plots.R
\name{diff_expr_ggplot_mds}
\alias{diff_expr_ggplot_mds}
\title{Function to generate a MDS plot using `ggplot2`}
\usage{
diff_expr_ggplot_mds(
  counts,
  samp.name,
  groups,
  grp.nam = NULL,
  pairs = NULL,
  pairs.name = NULL,
  gene.selection = "common",
  dim.plot = c(1, 2),
  main = NULL
)
}
\arguments{
\item{counts}{Counts matrix.}

\item{samp.name}{Optional sample names to be used in the plot, given as character vector.}

\item{groups}{Sample groups for plot annotation as character vector or factor.}

\item{grp.nam}{Legend title.}

\item{pairs}{Factor of identifiers specifying paired samples for paired or other block designs, or batch effects.}

\item{pairs.name}{Legend title for paired or block design variables in MDS ggplot.}

\item{gene.selection}{Character passed to \code{plotMDS()} specifying the mode to select genes for comparisons.}

\item{dim.plot}{Integer vector of length two passed to \code{plotMDS()} specifying the principal components to be plotted.}

\item{main}{Plot title.}
}
\value{
A \code{ggplot} object containing the multidimensional scaling plot.
}
\description{
Function to generate a MDS plot using `ggplot2`
}
\examples{
si <- diff_expr_get_samp_info(diffwrap_samp_info, "SampleName", "Group")
counts <- diff_expr_filter_counts(diff_expr_read_counts(diffwrap_counts, si), si)
groups <- stats::relevel(si$Groups, ref = "control")
lcpm <- edgeR::cpm(counts, log = TRUE)
g <- diff_expr_ggplot_mds(lcpm, samp.name = colnames(lcpm), groups = groups)
class(g)
}
\seealso{
[plotMDS()]
}
