From 1ec1298ca0fe18436527476c8b4385bb3f0ff0e9 Mon Sep 17 00:00:00 2001 From: RubD Date: Fri, 25 Aug 2023 21:48:56 -0400 Subject: [PATCH] update documentation --- NAMESPACE | 1 + man/runPCA.Rd | 4 +- man/runPCA_BiocSingular.Rd | 4 +- man/runPCA_BiocSingular_irlba_projection.Rd | 50 ++++++++++++ man/runPCAprojection.Rd | 86 +++++++++++++++++++++ 5 files changed, 141 insertions(+), 4 deletions(-) create mode 100644 man/runPCA_BiocSingular_irlba_projection.Rd create mode 100644 man/runPCAprojection.Rd diff --git a/NAMESPACE b/NAMESPACE index fc9c382a2..b8dbd7803 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -332,6 +332,7 @@ export(runIntegratedUMAP) export(runPAGEEnrich) export(runPAGEEnrich_OLD) export(runPCA) +export(runPCAprojection) export(runPatternSimulation) export(runRankEnrich) export(runSpatialDeconv) diff --git a/man/runPCA.Rd b/man/runPCA.Rd index cd873d887..04463b6cd 100644 --- a/man/runPCA.Rd +++ b/man/runPCA.Rd @@ -18,7 +18,7 @@ runPCA( scale_unit = TRUE, ncp = 100, method = c("irlba", "exact", "random", "factominer"), - method_params = list(NA), + method_params = BiocParallel::SerialParam(), rev = FALSE, set_seed = TRUE, seed_number = 1234, @@ -53,7 +53,7 @@ runPCA( \item{method}{which implementation to use} -\item{method_params}{additional parameters} +\item{method_params}{BiocParallelParam object} \item{rev}{do a reverse PCA} diff --git a/man/runPCA_BiocSingular.Rd b/man/runPCA_BiocSingular.Rd index 5eed4ec01..5a0fabf4a 100644 --- a/man/runPCA_BiocSingular.Rd +++ b/man/runPCA_BiocSingular.Rd @@ -13,7 +13,7 @@ runPCA_BiocSingular( set_seed = TRUE, seed_number = 1234, BSPARAM = c("irlba", "exact", "random"), - BSParameters = list(NA), + BPPARAM = BiocParallel::SerialParam(), ... ) } @@ -34,7 +34,7 @@ runPCA_BiocSingular( \item{BSPARAM}{method to use} -\item{BSParameters}{additonal parameters for method} +\item{BPPARAM}{BiocParallelParam object} } \value{ list of eigenvalues, loadings and pca coordinates diff --git a/man/runPCA_BiocSingular_irlba_projection.Rd b/man/runPCA_BiocSingular_irlba_projection.Rd new file mode 100644 index 000000000..c15befc14 --- /dev/null +++ b/man/runPCA_BiocSingular_irlba_projection.Rd @@ -0,0 +1,50 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dimension_reduction.R +\name{runPCA_BiocSingular_irlba_projection} +\alias{runPCA_BiocSingular_irlba_projection} +\title{runPCA_BiocSingular_irlba_projection} +\usage{ +runPCA_BiocSingular_irlba_projection( + x, + ncp = 100, + center = TRUE, + scale = TRUE, + rev = FALSE, + set_seed = TRUE, + seed_number = 1234, + BPPARAM = BiocParallel::SerialParam(), + random_subset = 500, + verbose = TRUE, + ... +) +} +\arguments{ +\item{x}{matrix or object that can be converted to matrix} + +\item{ncp}{number of principal components to calculate} + +\item{center}{center the matrix before pca} + +\item{scale}{scale features} + +\item{rev}{reverse PCA} + +\item{set_seed}{use of seed} + +\item{seed_number}{seed number to use} + +\item{BPPARAM}{BiocParallelParam object} + +\item{random_subset}{random subset to perform PCA on} + +\item{verbose}{verbosity level} +} +\value{ +list of eigenvalues, loadings and pca coordinates +} +\description{ +Performs PCA based on the biocSingular package on a +subset of the matrix. It uses the obtained loadings to predicted coordinates +for the remaining matrix. +} +\keyword{internal} diff --git a/man/runPCAprojection.Rd b/man/runPCAprojection.Rd new file mode 100644 index 000000000..727f3369a --- /dev/null +++ b/man/runPCAprojection.Rd @@ -0,0 +1,86 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dimension_reduction.R +\name{runPCAprojection} +\alias{runPCAprojection} +\title{runPCAprojection} +\usage{ +runPCAprojection( + gobject, + spat_unit = NULL, + feat_type = NULL, + expression_values = c("normalized", "scaled", "custom"), + reduction = c("cells", "feats"), + random_subset = 500, + name = NULL, + feats_to_use = "hvf", + return_gobject = TRUE, + center = TRUE, + scale_unit = TRUE, + ncp = 100, + method = c("irlba"), + method_params = BiocParallel::SerialParam(), + rev = FALSE, + set_seed = TRUE, + seed_number = 1234, + verbose = TRUE +) +} +\arguments{ +\item{gobject}{giotto object} + +\item{spat_unit}{spatial unit} + +\item{feat_type}{feature type} + +\item{expression_values}{expression values to use} + +\item{reduction}{cells or genes} + +\item{random_subset}{random subset to perform PCA on} + +\item{name}{arbitrary name for PCA run} + +\item{feats_to_use}{subset of features to use for PCA} + +\item{return_gobject}{boolean: return giotto object (default = TRUE)} + +\item{center}{center data first (default = TRUE)} + +\item{scale_unit}{scale features before PCA (default = TRUE)} + +\item{ncp}{number of principal components to calculate} + +\item{method}{which implementation to use} + +\item{method_params}{BiocParallelParam object} + +\item{rev}{do a reverse PCA} + +\item{set_seed}{use of seed} + +\item{seed_number}{seed number to use} + +\item{verbose}{verbosity of the function} + +\item{genes_to_use}{deprecated use feats_to_use} + +\item{...}{additional parameters for PCA (see details)} +} +\value{ +giotto object with updated PCA dimension recuction +} +\description{ +runs a Principal Component Analysis +} +\details{ +See \code{\link[BiocSingular]{runPCA}} and \code{\link[FactoMineR]{PCA}} for more information about other parameters. +This PCA implementation is similar to \code{\link{runPCA}}, except that it +performs PCA on a subset of the cells or features, and predict on the others. +This can significantly increase speed without sacrificing accuracy too much. +\itemize{ + \item feats_to_use = NULL: will use all features from the selected matrix + \item feats_to_use = : can be used to select a column name of + highly variable features, created by (see \code{\link{calculateHVF}}) + \item feats_to_use = c('geneA', 'geneB', ...): will use all manually provided features +} +}