% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qc_util.R
\name{diff_expr_PCA}
\alias{diff_expr_PCA}
\title{Function to do PCA using `stats::prcomp`}
\usage{
diff_expr_PCA(counts, n = 500, scale. = FALSE)
}
\arguments{
\item{counts}{Counts matrix.}

\item{n}{Number of rows to be selected from the sorted variance matrix (by default, the top 500 rows are selected from the matrix sorted in decreasing order).}

\item{scale.}{A logical value passed to \code{prcomp}; should the variables be scaled to have unit variance?}
}
\value{
An object of class \code{prcomp} as returned by \code{\link[stats]{prcomp}}, holding the
  principal component decomposition of the (optionally variance-filtered) count matrix.
}
\description{
Function to do PCA using `stats::prcomp`
}
\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)
pca <- diff_expr_PCA(edgeR::cpm(counts, log = TRUE), n = 100)
pca$sdev[1:3]
}
