% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qc_plots.R
\name{diff_expr_PCA_ggbiplot}
\alias{diff_expr_PCA_ggbiplot}
\title{Function to generate a PCA biplot using `ggbiplot.n`, a version of `ggbiplot` from https://github.com/vqv/ggbiplot.}
\usage{
diff_expr_PCA_ggbiplot(
  PCA,
  groups,
  grp.nam = NULL,
  ellipse = TRUE,
  circle = TRUE,
  varname.size = 0,
  var.axes = FALSE,
  main = NULL,
  fix.aspect = FALSE,
  tweak = FALSE,
  ...
)
}
\arguments{
\item{PCA}{List of class \code{prcomp} or just a list having a component \code{x} that contains the rotated variables from \code{prcomp}.}

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

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

\item{ellipse}{Logical indicating whether to draw an ellipse around the sample groups.}

\item{circle}{\code{logical}. Draw a correlation circle? (only applies when prcomp was called with scale = TRUE and when var.scale = 1)}

\item{varname.size}{\code{double}. size of the text for variable names}

\item{var.axes}{\code{logical}. draw arrows for the variables?}

\item{main}{Plot title.}

\item{fix.aspect}{\code{logical}. Should the aspect ratio of the x- and y-axes be kept constant for different plot sizes?}

\item{tweak}{\code{logical}. Should the plot theme be tweaked? Will apply values set in axes.title.size, legend.text.size and legend.title.size. Defaults to TRUE.}

\item{...}{Arguments passed to \code{ggbiplot.n()}.}
}
\value{
A \code{ggplot} object containing the PCA biplot. The plot is returned rather than drawn, so
  it has to be printed to appear on a device.
}
\description{
Function to generate a PCA biplot using `ggbiplot.n`, a version of `ggbiplot` from https://github.com/vqv/ggbiplot.
}
\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")
pca <- diff_expr_PCA(edgeR::cpm(counts, log = TRUE), n = 100)
g <- diff_expr_PCA_ggbiplot(pca, groups = groups)
class(g)
}
\seealso{
[ggbiplot.n()]
}
