Skip to contents

Run generalized principal components analysis (GLMPCA)

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. Can be a Seurat object, an assay object, or a matrix-like object.

...

Passed to the glmpca::glmpca function.

assay

Assay to use. NULL uses the default assay.

layer

Assay layer to use.

features

Features used instead of a reduction.

L

The number of components to be computed.

fam

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

rev.gmlpca

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

ndims.print

The dimensions (number of components) to print in the output.

nfeatures.print

The number of features to print in the output.

reduction.name

Reduction to be stored in the Seurat object.

reduction.key

The prefix for the column names of the basis vectors.

verbose

Whether to print the message. Default is TRUE.

seed.use

Random seed.

Examples

data(pancreas_sub)
pancreas_sub <- RunStandardWorkflow(pancreas_sub)
#>  [2026-08-30 05:00:56] Start standard processing workflow...
#>  [2026-08-30 05:00:56] Checking a list of <Seurat>...
#> ! [2026-08-30 05:00:56] Data 1/1 of the `srt_list` is "unknown"
#> Warning: Data 1/1 of the `srt_list` is "unknown"
#>  [2026-08-30 05:00:56] Perform `NormalizeData()` with `normalization.method = 'LogNormalize'` on 1/1 of `srt_list`...
#>  [2026-08-30 05:00:56] Perform `FindVariableFeatures()` on 1/1 of `srt_list`...
#>  [2026-08-30 05:00:57] Use the separate HVF from `srt_list`
#>  [2026-08-30 05:00:57] Number of available HVF: 2000
#>  [2026-08-30 05:00:57] Finished check
#>  [2026-08-30 05:00:57] Perform `ScaleData()`
#>  [2026-08-30 05:00:57] Perform pca linear dimension reduction
#>  [2026-08-30 05:00:57] Use stored estimated dimensions 1:23 for Standardpca
#>  [2026-08-30 05:00:58] Perform `Seurat::FindClusters()` with `cluster_algorithm = 'louvain'` and `cluster_resolution = 0.6`
#>  [2026-08-30 05:00:58] Reorder clusters...
#>  [2026-08-30 05:00:58] Skip `log1p()` because `layer = data` is not "counts"
#>  [2026-08-30 05:00:58] Perform umap nonlinear dimension reduction
#>  [2026-08-30 05:01:06] Standard processing workflow completed
pancreas_sub <- RunGLMPCA(pancreas_sub)
#>  GLMPC_ 1 
#>  Positive:  Barx2, Cartpt, Gm3448, Ptger3, Mesp1, Prl, Gip, Ceacam10, Spock1, Cdkn2b 
#>  	   Dusp26, RP23-385E22.2, Pax6os1, Cypt3, 1700015F17Rik, 3930402G23Rik, RP23-428N8.3, 4930426D05Rik, Fbln5, Ucn3 
#>  	   Aard, Lrrc6, 1700001C02Rik, Kng2, Pcdh8, Tac1, 2410021H03Rik, Slc38a5, Gtf2ird2, A130057D12Rik 
#>  Negative:  Col23a1, Col1a1, Col6a1, Ctgf, Islr, Anxa1, Isg15, Zfp385b, Sp140, Ctsk 
#>  	   P2ry2, Hoxb4, Plscr2, Platr22, Kcnj8, Col3a1, Timp3, Edn1, Gm26633, Prickle2 
#>  	   Il18, Pgr, Grin3a, Tagln, Pkd2l1, Lsp1, Tmem119, 1110002O04Rik, Tmem100, AA986860 
#>  GLMPC_ 2 
#>  Positive:  Bhlhe22, Klk11, Laptm5, Cd37, Bhlhe23, Tfap2c, Sema3g, Tmem114, Fgf8, Adra2c 
#>  	   Neurod2, Krtap17-1, Epb42, Fam71b, Gm8773, Tgm7, Eya2, P2ry14, Glod5, Fgf18 
#>  	   Nhlh1, Gm6086, Prom2, 1700128E19Rik, Cmklr1, Ppp1r14a, Wnt3, Ifitm1, Snai2, Lynx1 
#>  Negative:  Sst, Aif1, Klhl14, Gm26633, Dkk2, Col1a2, Ctgf, Tnni3, Col25a1, Ctsk 
#>  	   Col23a1, Lgr5, Crygn, Fam198b, RP23-428N8.3, Sp5, Fgb, Tac1, Zfp385b, Platr22 
#>  	   Cbln4, Kcne2, Gad2, 4930426D05Rik, Col6a1, 4930539E08Rik, M1ap, Prrg1, Olfml2a, Isg15 
#>  GLMPC_ 3 
#>  Positive:  Col1a2, Gad2, Col6a1, Col23a1, Sparcl1, Gcg, Sp140, Islr, Calb1, Col1a1 
#>  	   Kcnj8, Guca2a, Col3a1, Tmem100, Galnt16, P2ry2, Hist1h4a, Pid1, Ryr3, Smpx 
#>  	   BC043934, Tstd1, Pou6f2, Fgb, Gsg1l, Ctsk, Tnni3, Itgb7, Fam46d, Gm6878 
#>  Negative:  Pif1, RP23-58K20.3, Igfbp3, Kcne2, Gm933, Aif1, Sst, Msx1, Fam198b, Iqgap3 
#>  	   Aspm, Elovl4, Espl1, Depdc1a, Cdc25c, Kif2c, Nusap1, Cnrip1, Cenpf, Parpbp 
#>  	   Ccnb1, Gtse1, Hmmr, Mmel1, Bub1, Plk1, Kif20a, Icosl, RP23-4H17.3, Kif18a 
#>  GLMPC_ 4 
#>  Positive:  Npy, Sparcl1, Dlgap1, Galnt16, Ins1, Gm38112, Gm15640, Cldn18, Kcnj8, Col3a1 
#>  	   Gad2, Ins2, Sp5, Jakmip3, Nhs, P2ry1, Islr, Adam32, Tmem215, Arhgap36 
#>  	   Hist1h1a, Syndig1l, Nckap5los, 1700024G13Rik, Col5a1, Fam124a, Slfn9, Nnat, Gm11789, Clspn 
#>  Negative:  Anxa1, Gast, D7Ertd443e, Tstd1, Platr22, Tnfaip8l3, Edn1, Bmp2, Ctsk, Ifit1bl1 
#>  	   Fcgr3, Cd37, Fam46d, Ltb, Gm29440, Sp140, Zfp97, Srgn, Lmod3, Lst1 
#>  	   Rerg, 1500035N22Rik, Fgf8, Fam198b, Pkd2l1, Gm15895, Ngf, Pou6f2, Ankrd1, Gm13375 
#>  GLMPC_ 5 
#>  Positive:  Cbln4, Tex36, Gm933, Ghrl, Irs4, Gpr6, Lrrtm3, Foxd3, Gm17455, Kcnj8 
#>  	   Anxa1, Galnt16, Arhgap22, Sparcl1, Tnni3, Col3a1, Platr22, Col23a1, St8sia2, Avp 
#>  	   RP23-172P1.4, Col1a2, Spock1, Islr, Gm3448, Prickle2, Tmem119, Colec12, Col1a1, Ngf 
#>  Negative:  Srgn, Lst1, Fcgr3, Ryr3, Lmx1a, Tyrobp, Lrrc6, P2ry14, Il1r2, Kng2 
#>  	   Coro1a, Slfn2, Pid1, 4933440M02Rik, Rac2, Gm6410, 4930426D05Rik, Klhl14, Slc4a10, Alox5ap 
#>  	   Olfml2a, Gm37350, M1ap, Lgr5, Tac1, Gm11636, Ifitm1, Ncf2, Sp5, Fgb 
CellDimPlot(
  pancreas_sub,
  group.by = "CellType",
  reduction = "glmpca"
)