Skip to contents

Run GLMPCA (generalized version of principal components analysis)

Usage

RunGLMPCA(object, ...)

# S3 method for class 'Seurat'
RunGLMPCA(
  object,
  assay = NULL,
  layer = "counts",
  features = NULL,
  L = 5,
  fam = c("poi", "nb", "nb2", "binom", "mult", "bern"),
  rev.gmlpca = FALSE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "glmpca",
  reduction.key = "GLMPC_",
  verbose = TRUE,
  seed.use = 11,
  ...
)

# S3 method for class 'Assay'
RunGLMPCA(
  object,
  assay = NULL,
  layer = "counts",
  features = NULL,
  L = 5,
  fam = c("poi", "nb", "nb2", "binom", "mult", "bern"),
  rev.gmlpca = FALSE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "GLMPC_",
  verbose = TRUE,
  seed.use = 11,
  ...
)

# S3 method for class 'Assay5'
RunGLMPCA(
  object,
  assay = NULL,
  layer = "counts",
  features = NULL,
  L = 5,
  fam = c("poi", "nb", "nb2", "binom", "mult", "bern"),
  rev.gmlpca = FALSE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "GLMPC_",
  verbose = TRUE,
  seed.use = 11,
  ...
)

# Default S3 method
RunGLMPCA(
  object,
  assay = NULL,
  layer = "counts",
  features = NULL,
  L = 5,
  fam = c("poi", "nb", "nb2", "binom", "mult", "bern"),
  rev.gmlpca = FALSE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "GLMPC_",
  verbose = TRUE,
  seed.use = 11,
  ...
)

Arguments

object

An object. This can be a Seurat object, an assay object, or a matrix-like object.

...

Additional arguments to be passed to the glmpca::glmpca function.

assay

The assay to be used for the analysis. Default is NULL.

layer

The layer to be used for the analysis. Default is "counts".

features

The features to be used for the analysis. Default is NULL, which uses all variable features.

L

The number of components to be computed. Default is 5.

fam

The family of the generalized linear model to be used. Currently supported values are "poi", "nb", "nb2", "binom", "mult", and "bern". Default is "poi".

rev.gmlpca

Whether to perform reverse GLMPCA (i.e., transpose the input matrix) before running the analysis. Default is FALSE.

ndims.print

The dimensions (number of components) to print in the output. Default is 1:5.

nfeatures.print

The number of features to print in the output. Default is 30.

reduction.name

The name of the reduction to be stored in the Seurat object. Default is "glmpca".

reduction.key

The prefix for the column names of the basis vectors. Default is "GLMPC_".

verbose

Whether to print the message. Default is TRUE.

seed.use

The random seed to be used. Default is 11.

Examples

pancreas_sub <- RunGLMPCA(object = pancreas_sub)
#> Error in apply(X = data.use[features, ], MARGIN = 1, FUN = stats::var): dim(X) must have a positive length
CellDimPlot(
  pancreas_sub,
  group.by = "CellType",
  reduction = "glmpca"
)
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.