Skip to contents

This function performs a standard single-cell analysis workflow.

Usage

standard_scop(
  srt,
  prefix = "Standard",
  assay = NULL,
  do_normalization = NULL,
  normalization_method = "LogNormalize",
  do_HVF_finding = TRUE,
  HVF_method = "vst",
  nHVF = 2000,
  HVF = NULL,
  do_scaling = TRUE,
  vars_to_regress = NULL,
  regression_model = "linear",
  linear_reduction = "pca",
  linear_reduction_dims = 50,
  linear_reduction_dims_use = NULL,
  linear_reduction_params = list(),
  force_linear_reduction = FALSE,
  nonlinear_reduction = "umap",
  nonlinear_reduction_dims = c(2, 3),
  nonlinear_reduction_params = list(),
  force_nonlinear_reduction = TRUE,
  neighbor_metric = "euclidean",
  neighbor_k = 20L,
  cluster_algorithm = "louvain",
  cluster_resolution = 0.6,
  verbose = TRUE,
  seed = 11
)

Arguments

srt

A Seurat object.

prefix

A prefix to add to the names of intermediate objects created by the function. Default is "Standard".

assay

The name of the assay to use for the analysis. If NULL, the default assay of the Seurat object will be used.

do_normalization

Whether to perform normalization. If NULL, normalization will be performed if the specified assay does not have scaled data.

normalization_method

The method to use for normalization. Options are "LogNormalize", "SCT", or "TFIDF". Default is "LogNormalize".

do_HVF_finding

Whether to perform high variable feature finding. If TRUE, the function will force to find the highly variable features (HVF) using the specified HVF method.

HVF_method

The method to use for finding highly variable features. Options are "vst", "mvp", or "disp". Default is "vst".

nHVF

The number of highly variable features to select. If NULL, all highly variable features will be used.

HVF

A vector of feature names to use as highly variable features. If NULL, the function will use the highly variable features identified by the HVF method.

do_scaling

Whether to perform scaling. If TRUE, the function will force to scale the data using the ScaleData function.

vars_to_regress

A vector of feature names to use as regressors in the scaling step. If NULL, no regressors will be used.

regression_model

The regression model to use for scaling. Options are "linear", "poisson", or "negativebinomial". Default is "linear".

linear_reduction

The linear dimensionality reduction method to use. Options are "pca", "svd", "ica", "nmf", "mds", or "glmpca". Default is "pca".

linear_reduction_dims

The number of dimensions to keep after linear dimensionality reduction. Default is 50.

linear_reduction_dims_use

The dimensions to use for downstream analysis. If NULL, all dimensions will be used.

linear_reduction_params

A list of parameters to pass to the linear dimensionality reduction method.

force_linear_reduction

Whether to force linear dimensionality reduction even if the specified reduction is already present in the Seurat object.

nonlinear_reduction

The nonlinear dimensionality reduction method to use. Options are "umap", "umap-naive", "tsne", "dm", "phate", "pacmap", "trimap", "largevis", or "fr". Default is "umap".

nonlinear_reduction_dims

The number of dimensions to keep after nonlinear dimensionality reduction. If a vector is provided, different numbers of dimensions can be specified for each method. Default is c(2, 3).

nonlinear_reduction_params

A list of parameters to pass to the nonlinear dimensionality reduction method.

force_nonlinear_reduction

Whether to force nonlinear dimensionality reduction even if the specified reduction is already present in the Seurat object. Default is TRUE.

neighbor_metric

The distance metric to use for finding neighbors. Options are "euclidean", "cosine", "manhattan", or "hamming". Default is "euclidean".

neighbor_k

The number of nearest neighbors to use for finding neighbors. Default is 20.

cluster_algorithm

The clustering algorithm to use. Options are "louvain", "slm", or "leiden". Default is "louvain".

cluster_resolution

The resolution parameter to use for clustering. Larger values result in fewer clusters. Default is 0.6.

verbose

Whether to print the message. Default is TRUE.

seed

The random seed to use for reproducibility. Default is 11.

Value

A Seurat object.

See also

Examples

library(Matrix)
PrepareEnv()
#>  [2025-09-20 14:07:48] Preparing scop Python Environment
#>  [2025-09-20 14:07:48] Environment name: scop_env
#>  [2025-09-20 14:07:48] Python version: 3.10-1
#>  [2025-09-20 14:07:48] Number of packages to install: 21
#>  [2025-09-20 14:07:48] Auto-detecting conda...
#>  [2025-09-20 14:07:49] Using existing environment: /usr/share/miniconda/envs/scop_env
#>  [2025-09-20 14:07:49] Checking and installing required packages...
#>  [2025-09-20 14:07:49] Installing conda packages
#>  [2025-09-20 14:07:50] Checking 3 packages in environment: scop_env
#>  [2025-09-20 14:07:51] Retrieving package list for environment: scop_env
#>  [2025-09-20 14:07:53] Found 205 packages installed
#>  [2025-09-20 14:07:53] leidenalg 0.10.2
#>  [2025-09-20 14:07:53] tbb 2022.2.0
#>  [2025-09-20 14:07:53] python-igraph 0.11.9
#>  [2025-09-20 14:07:53] Installing pip packages
#>  [2025-09-20 14:07:55] Checking 18 packages in environment: scop_env
#>  [2025-09-20 14:07:55] Retrieving package list for environment: scop_env
#>  [2025-09-20 14:07:57] Found 205 packages installed
#>  [2025-09-20 14:07:57] matplotlib 3.10.3
#>  [2025-09-20 14:07:57] numba 0.59.1
#>  [2025-09-20 14:07:57] llvmlite 0.42.0
#>  [2025-09-20 14:07:57] numpy 1.26.4
#>  [2025-09-20 14:07:57] palantir 1.4.1
#>  [2025-09-20 14:07:57] pandas 2.0.3
#>  [2025-09-20 14:07:57] scanpy 1.11.3
#>  [2025-09-20 14:07:57] scikit-learn 1.7.0
#>  [2025-09-20 14:07:57] scipy 1.15.3
#>  [2025-09-20 14:07:57] scvelo 0.3.3
#>  [2025-09-20 14:07:57] wot 1.0.8.post2
#>  [2025-09-20 14:07:57] trimap 1.1.4
#>  [2025-09-20 14:07:57] pacmap 0.8.0
#>  [2025-09-20 14:07:57] phate 1.0.11
#>  [2025-09-20 14:07:57] bbknn 1.6.0
#>  [2025-09-20 14:07:57] scanorama 1.7.4
#>  [2025-09-20 14:07:57] scvi-tools 1.2.1
#>  [2025-09-20 14:07:57] cellrank 2.0.7
#>  [2025-09-20 14:08:00] Python Environment Ready
#> conda environment: 
#>   conda:          /usr/share/miniconda/bin/conda
#>   environment:    /usr/share/miniconda/envs/scop_env
#> python config: 
#>   python:         /usr/share/miniconda/envs/scop_env/bin/python3.10
#>   libpython:      /usr/share/miniconda/envs/scop_env/lib/libpython3.10.so
#>   pythonhome:     /usr/share/miniconda/envs/scop_env:/usr/share/miniconda/envs/scop_env
#>   version:        3.10.1 | packaged by conda-forge | (main, Dec 22 2021, 01:39:36) [GCC 9.4.0]
#>   numpy:          /usr/share/miniconda/envs/scop_env/lib/python3.10/site-packages/numpy
#>   numpy_version:  1.26.4
#>   
#>   NOTE: Python version was forced by use_python() function
data(pancreas_sub)
pancreas_sub <- standard_scop(pancreas_sub)
#>  [2025-09-20 14:08:00] Start standard scop workflow...
#>  [2025-09-20 14:08:01] Checking a list of <Seurat> object...
#> ! [2025-09-20 14:08:01] Data 1/1 of the `srt_list` is "unknown"
#>  [2025-09-20 14:08:01] Perform `NormalizeData()` with `normalization.method = 'LogNormalize'` on the data 1/1 of the `srt_list`...
#>  [2025-09-20 14:08:03] Perform `Seurat::FindVariableFeatures()` on the data 1/1 of the `srt_list`...
#>  [2025-09-20 14:08:04] Use the separate HVF from srt_list
#>  [2025-09-20 14:08:04] Number of available HVF: 2000
#>  [2025-09-20 14:08:04] Finished check
#>  [2025-09-20 14:08:04] Perform `Seurat::ScaleData()`
#> Warning: Different features in new layer data than already exists for scale.data
#>  [2025-09-20 14:08:05] Perform pca linear dimension reduction
#> StandardPC_ 1 
#> Positive:  Aplp1, Cpe, Gnas, Fam183b, Map1b, Hmgn3, Pcsk1n, Chga, Tuba1a, Bex2 
#> 	   Syt13, Isl1, 1700086L19Rik, Pax6, Chgb, Scgn, Rbp4, Scg3, Gch1, Camk2n1 
#> 	   Cryba2, Pcsk2, Pyy, Tspan7, Mafb, Hist3h2ba, Dbpht2, Abcc8, Rap1b, Slc38a5 
#> Negative:  Spp1, Anxa2, Sparc, Dbi, 1700011H14Rik, Wfdc2, Gsta3, Adamts1, Clu, Mgst1 
#> 	   Bicc1, Ldha, Vim, Cldn3, Cyr61, Rps2, Mt1, Ptn, Phgdh, Nudt19 
#> 	   Smtnl2, Smco4, Habp2, Mt2, Col18a1, Rpl12, Galk1, Cldn10, Acot1, Ccnd1 
#> StandardPC_ 2 
#> Positive:  Rbp4, Tagln2, Tuba1b, Fkbp2, Pyy, Pcsk2, Iapp, Tmem27, Meis2, Tubb4b 
#> 	   Pcsk1n, Dbpht2, Rap1b, Dynll1, Tubb2a, Sdf2l1, Scgn, 1700086L19Rik, Scg2, Abcc8 
#> 	   Atp1b1, Hspa5, Fam183b, Papss2, Slc38a5, Scg3, Mageh1, Tspan7, Ppp1r1a, Ociad2 
#> Negative:  Neurog3, Btbd17, Gadd45a, Ppp1r14a, Neurod2, Sox4, Smarcd2, Mdk, Pax4, Btg2 
#> 	   Sult2b1, Hes6, Grasp, Igfbpl1, Gpx2, Cbfa2t3, Foxa3, Shf, Mfng, Tmsb4x 
#> 	   Amotl2, Gdpd1, Cdc14b, Epb42, Rcor2, Cotl1, Upk3bl, Rbfox3, Cldn6, Cer1 
#> StandardPC_ 3 
#> Positive:  Nusap1, Top2a, Birc5, Aurkb, Cdca8, Pbk, Mki67, Tpx2, Plk1, Ccnb1 
#> 	   2810417H13Rik, Incenp, Cenpf, Ccna2, Prc1, Racgap1, Cdk1, Aurka, Cdca3, Hmmr 
#> 	   Spc24, Kif23, Sgol1, Cenpe, Cdc20, Hist1h1b, Cdca2, Mxd3, Kif22, Ska1 
#> Negative:  Anxa5, Pdzk1ip1, Acot1, Tpm1, Anxa2, Dcdc2a, Capg, Sparc, Ttr, Pamr1 
#> 	   Clu, Cxcl12, Ndrg2, Hnf1aos1, Gas6, Gsta3, Krt18, Ces1d, Atp1b1, Muc1 
#> 	   Hhex, Acadm, Spp1, Enpp2, Bcl2l14, Sat1, Smtnl2, 1700011H14Rik, Tgm2, Fam159a 
#> StandardPC_ 4 
#> Positive:  Glud1, Tm4sf4, Akr1c19, Cldn4, Runx1t1, Fev, Pou3f4, Gm43861, Pgrmc1, Arx 
#> 	   Cd200, Lrpprc, Hmgn3, Ppp1r14c, Pam, Etv1, Tsc22d1, Slc25a5, Akap17b, Pgf 
#> 	   Fam43a, Emb, Jun, Krt8, Dnajc12, Mid1ip1, Ids, Rgs17, Uchl1, Alcam 
#> Negative:  Ins2, Ins1, Ppp1r1a, Nnat, Calr, Sytl4, Sdf2l1, Iapp, Pdia6, Mapt 
#> 	   G6pc2, C2cd4b, Npy, Gng12, P2ry1, Ero1lb, Adra2a, Papss2, Arhgap36, Fam151a 
#> 	   Dlk1, Creld2, Gip, Tmem215, Gm27033, Cntfr, Prss53, C2cd4a, Lyve1, Ociad2 
#> StandardPC_ 5 
#> Positive:  Pdx1, Nkx6-1, Npepl1, Cldn4, Cryba2, Fev, Jun, Chgb, Gng12, Adra2a 
#> 	   Mnx1, Sytl4, Pdk3, Gm27033, Nnat, Chga, Ins2, 1110012L19Rik, Enho, Krt7 
#> 	   Mlxipl, Tmsb10, Flrt1, Pax4, Tubb3, Prrg2, Gars, Frzb, BC023829, Gm2694 
#> Negative:  Irx2, Irx1, Gcg, Ctxn2, Tmem27, Ctsz, Tmsb15l, Nap1l5, Pou6f2, Gria2 
#> 	   Ghrl, Peg10, Smarca1, Arx, Lrpap1, Rgs4, Ttr, Gast, Tmsb15b2, Serpina1b 
#> 	   Slc16a10, Wnk3, Ly6e, Auts2, Sct, Arg1, Dusp10, Sphkap, Dock11, Edn3 
#>  [2025-09-20 14:08:06] Perform `Seurat::FindClusters()` with louvain and `cluster_resolution` = 0.6
#>  [2025-09-20 14:08:06] Reorder clusters...
#> ! [2025-09-20 14:08:06] Using `Seurat::AggregateExpression()` to calculate pseudo-bulk data for <Assay5>
#>  [2025-09-20 14:08:06] Perform umap nonlinear dimension reduction
#>  [2025-09-20 14:08:06] Non-linear dimensionality reduction (umap) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:08:06] UMAP will return its model
#>  [2025-09-20 14:08:10] Non-linear dimensionality reduction (umap) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:08:10] UMAP will return its model
#>  [2025-09-20 14:08:15] Run scop standard workflow done
CellDimPlot(
  pancreas_sub,
  group.by = "SubCellType"
)
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.


# Use a combination of different linear
# or non-linear dimension reduction methods
linear_reductions <- c(
  "pca", "nmf", "mds", "glmpca"
)
pancreas_sub <- standard_scop(
  pancreas_sub,
  linear_reduction = linear_reductions,
  nonlinear_reduction = "umap"
)
#>  [2025-09-20 14:08:15] Start standard scop workflow...
#>  [2025-09-20 14:08:15] Checking a list of <Seurat> object...
#>  [2025-09-20 14:08:16] Data 1/1 of the `srt_list` has been log-normalized
#>  [2025-09-20 14:08:16] Perform `Seurat::FindVariableFeatures()` on the data 1/1 of the `srt_list`...
#>  [2025-09-20 14:08:16] Use the separate HVF from srt_list
#>  [2025-09-20 14:08:16] Number of available HVF: 2000
#>  [2025-09-20 14:08:16] Finished check
#>  [2025-09-20 14:08:16] Perform `Seurat::ScaleData()`
#>  [2025-09-20 14:08:17] Perform pca linear dimension reduction
#> StandardPC_ 1 
#> Positive:  Aplp1, Cpe, Gnas, Fam183b, Map1b, Hmgn3, Pcsk1n, Chga, Tuba1a, Bex2 
#> 	   Syt13, Isl1, 1700086L19Rik, Pax6, Chgb, Scgn, Rbp4, Scg3, Gch1, Camk2n1 
#> 	   Cryba2, Pcsk2, Pyy, Tspan7, Mafb, Hist3h2ba, Dbpht2, Abcc8, Rap1b, Slc38a5 
#> Negative:  Spp1, Anxa2, Sparc, Dbi, 1700011H14Rik, Wfdc2, Gsta3, Adamts1, Clu, Mgst1 
#> 	   Bicc1, Ldha, Vim, Cldn3, Cyr61, Rps2, Mt1, Ptn, Phgdh, Nudt19 
#> 	   Smtnl2, Smco4, Habp2, Mt2, Col18a1, Rpl12, Galk1, Cldn10, Acot1, Ccnd1 
#> StandardPC_ 2 
#> Positive:  Rbp4, Tagln2, Tuba1b, Fkbp2, Pyy, Pcsk2, Iapp, Tmem27, Meis2, Tubb4b 
#> 	   Pcsk1n, Dbpht2, Rap1b, Dynll1, Tubb2a, Sdf2l1, Scgn, 1700086L19Rik, Scg2, Abcc8 
#> 	   Atp1b1, Hspa5, Fam183b, Papss2, Slc38a5, Scg3, Mageh1, Tspan7, Ppp1r1a, Ociad2 
#> Negative:  Neurog3, Btbd17, Gadd45a, Ppp1r14a, Neurod2, Sox4, Smarcd2, Mdk, Pax4, Btg2 
#> 	   Sult2b1, Hes6, Grasp, Igfbpl1, Gpx2, Cbfa2t3, Foxa3, Shf, Mfng, Tmsb4x 
#> 	   Amotl2, Gdpd1, Cdc14b, Epb42, Rcor2, Cotl1, Upk3bl, Rbfox3, Cldn6, Cer1 
#> StandardPC_ 3 
#> Positive:  Nusap1, Top2a, Birc5, Aurkb, Cdca8, Pbk, Mki67, Tpx2, Plk1, Ccnb1 
#> 	   2810417H13Rik, Incenp, Cenpf, Ccna2, Prc1, Racgap1, Cdk1, Aurka, Cdca3, Hmmr 
#> 	   Spc24, Kif23, Sgol1, Cenpe, Cdc20, Hist1h1b, Cdca2, Mxd3, Kif22, Ska1 
#> Negative:  Anxa5, Pdzk1ip1, Acot1, Tpm1, Anxa2, Dcdc2a, Capg, Sparc, Ttr, Pamr1 
#> 	   Clu, Cxcl12, Ndrg2, Hnf1aos1, Gas6, Gsta3, Krt18, Ces1d, Atp1b1, Muc1 
#> 	   Hhex, Acadm, Spp1, Enpp2, Bcl2l14, Sat1, Smtnl2, 1700011H14Rik, Tgm2, Fam159a 
#> StandardPC_ 4 
#> Positive:  Glud1, Tm4sf4, Akr1c19, Cldn4, Runx1t1, Fev, Pou3f4, Gm43861, Pgrmc1, Arx 
#> 	   Cd200, Lrpprc, Hmgn3, Ppp1r14c, Pam, Etv1, Tsc22d1, Slc25a5, Akap17b, Pgf 
#> 	   Fam43a, Emb, Jun, Krt8, Dnajc12, Mid1ip1, Ids, Rgs17, Uchl1, Alcam 
#> Negative:  Ins2, Ins1, Ppp1r1a, Nnat, Calr, Sytl4, Sdf2l1, Iapp, Pdia6, Mapt 
#> 	   G6pc2, C2cd4b, Npy, Gng12, P2ry1, Ero1lb, Adra2a, Papss2, Arhgap36, Fam151a 
#> 	   Dlk1, Creld2, Gip, Tmem215, Gm27033, Cntfr, Prss53, C2cd4a, Lyve1, Ociad2 
#> StandardPC_ 5 
#> Positive:  Pdx1, Nkx6-1, Npepl1, Cldn4, Cryba2, Fev, Jun, Chgb, Gng12, Adra2a 
#> 	   Mnx1, Sytl4, Pdk3, Gm27033, Nnat, Chga, Ins2, 1110012L19Rik, Enho, Krt7 
#> 	   Mlxipl, Tmsb10, Flrt1, Pax4, Tubb3, Prrg2, Gars, Frzb, BC023829, Gm2694 
#> Negative:  Irx2, Irx1, Gcg, Ctxn2, Tmem27, Ctsz, Tmsb15l, Nap1l5, Pou6f2, Gria2 
#> 	   Ghrl, Peg10, Smarca1, Arx, Lrpap1, Rgs4, Ttr, Gast, Tmsb15b2, Serpina1b 
#> 	   Slc16a10, Wnk3, Ly6e, Auts2, Sct, Arg1, Dusp10, Sphkap, Dock11, Edn3 
#>  [2025-09-20 14:08:18] Perform `Seurat::FindClusters()` with louvain and `cluster_resolution` = 0.6
#>  [2025-09-20 14:08:18] Reorder clusters...
#> ! [2025-09-20 14:08:18] Using `Seurat::AggregateExpression()` to calculate pseudo-bulk data for <Assay5>
#>  [2025-09-20 14:08:18] Perform umap nonlinear dimension reduction
#>  [2025-09-20 14:08:18] Non-linear dimensionality reduction (umap) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:08:18] UMAP will return its model
#> Warning: Key ‘StandardpcaUMAP2D_’ taken, using ‘standardpcaumap2d_’ instead
#>  [2025-09-20 14:08:22] Non-linear dimensionality reduction (umap) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:08:22] UMAP will return its model
#> Warning: Key ‘StandardpcaUMAP3D_’ taken, using ‘standardpcaumap3d_’ instead
#>  [2025-09-20 14:08:27] Perform nmf linear dimension reduction
#>  [2025-09-20 14:08:27] zdebruine/RcppML installed successfully
#> 
#> iter |      tol 
#> ---------------
#>    1 | 6.94e-01
#>    2 | 9.76e-02
#>    3 | 3.18e-02
#>    4 | 1.49e-02
#>    5 | 8.15e-03
#>    6 | 5.06e-03
#>    7 | 3.40e-03
#>    8 | 2.43e-03
#>    9 | 1.80e-03
#>   10 | 1.37e-03
#>   11 | 1.07e-03
#>   12 | 8.59e-04
#>   13 | 7.01e-04
#>   14 | 5.85e-04
#>   15 | 5.07e-04
#>   16 | 4.47e-04
#>   17 | 4.03e-04
#>   18 | 3.67e-04
#>   19 | 3.32e-04
#>   20 | 2.98e-04
#>   21 | 2.72e-04
#>   22 | 2.48e-04
#>   23 | 2.28e-04
#>   24 | 2.11e-04
#>   25 | 1.99e-04
#>   26 | 1.91e-04
#>   27 | 1.85e-04
#>   28 | 1.76e-04
#>   29 | 1.72e-04
#>   30 | 1.68e-04
#>   31 | 1.62e-04
#>   32 | 1.54e-04
#>   33 | 1.45e-04
#>   34 | 1.35e-04
#>   35 | 1.24e-04
#>   36 | 1.15e-04
#>   37 | 1.06e-04
#>   38 | 9.81e-05
#>   39 | 9.10e-05
#>   40 | 8.53e-05
#>   41 | 8.05e-05
#>   42 | 7.62e-05
#>   43 | 7.25e-05
#>   44 | 6.94e-05
#>   45 | 6.73e-05
#>   46 | 6.61e-05
#>   47 | 6.49e-05
#>   48 | 6.36e-05
#>   49 | 6.22e-05
#>   50 | 6.04e-05
#>   51 | 5.84e-05
#>   52 | 5.62e-05
#>   53 | 5.39e-05
#>   54 | 5.05e-05
#>   55 | 4.69e-05
#>   56 | 4.39e-05
#>   57 | 4.11e-05
#>   58 | 3.85e-05
#>   59 | 3.60e-05
#>   60 | 3.38e-05
#>   61 | 3.18e-05
#>   62 | 3.01e-05
#>   63 | 2.88e-05
#>   64 | 2.77e-05
#>   65 | 2.69e-05
#>   66 | 2.59e-05
#>   67 | 2.50e-05
#>   68 | 2.40e-05
#>   69 | 2.30e-05
#>   70 | 2.20e-05
#>   71 | 2.12e-05
#>   72 | 2.05e-05
#>   73 | 2.00e-05
#>   74 | 1.96e-05
#>   75 | 1.94e-05
#>   76 | 1.90e-05
#>   77 | 1.87e-05
#>   78 | 1.82e-05
#>   79 | 1.72e-05
#>   80 | 1.62e-05
#>   81 | 1.54e-05
#>   82 | 1.45e-05
#>   83 | 1.37e-05
#>   84 | 1.31e-05
#>   85 | 1.25e-05
#>   86 | 1.20e-05
#>   87 | 1.16e-05
#>   88 | 1.11e-05
#>   89 | 1.07e-05
#>   90 | 1.02e-05
#>   91 | 9.91e-06
#>  StandardBE_ 1 
#>  Positive:  Ccnd1, Spp1, Mdk, Rps2, Ldha, Pebp1, Cd24a, Dlk1, Krt8, Mgst1 
#>  	   Clu, Gapdh, Eno1, Prdx1, Cldn10, Mif, Cldn7, Npm1, Dbi, Vim 
#>  	   Sox9, Rpl12, Aldh1b1, Rplp1, Wfdc2, Krt18, Tkt, Aldoa, Hspe1, Ptma 
#>  Negative:  Tmem108, Poc1a, Epn3, Wipi1, Tmcc3, Nhsl1, Fgf12, Plekho1, Tecpr2, Zbtb4 
#>  	   Gm10941, Trf, Man1c1, Hmgcs1, Nipal1, Jam3, Pgap1, Alpl, Kcnip3, Tnr 
#>  	   Gm15915, Rbp2, Cbfa2t2, Sh2d4a, Bbc3, Megf6, Naaladl2, Fam46d, Hist2h2ac, Tox2 
#>  StandardBE_ 2 
#>  Positive:  Spp1, Gsta3, Sparc, Vim, Atp1b1, Mt1, Dbi, Anxa2, Rps2, Id2 
#>  	   Rpl22l1, Rplp1, Mgst1, Clu, Sox9, Cldn6, Mdk, Pdzk1ip1, Bicc1, 1700011H14Rik 
#>  	   Rps12, S100a10, Cldn3, Rpl36a, Ppp1r1b, Adamts1, Serpinh1, Mt2, Ifitm2, Rpl39 
#>  Negative:  Rpa3, Aacs, Tmem108, Poc1a, Epn3, Wipi1, B830012L14Rik, Tmcc3, Wsb1, Plekho1 
#>  	   Ppp2r2b, Tecpr2, Zbtb4, Haus8, Trf, Gm5420, Man1c1, Hmgcs1, Nipal1, Jam3 
#>  	   Tcerg1, Pgap1, Snrpa1, Alpl, Larp1b, Kcnip3, Tnr, Lsm12, Ptbp3, Gm15915 
#>  StandardBE_ 3 
#>  Positive:  Cck, Mdk, Gadd45a, Neurog3, Selm, Sox4, Btbd17, Tmsb4x, Btg2, Cldn6 
#>  	   Cotl1, Ptma, Jun, Ppp1r14a, Rps2, Ifitm2, Neurod2, Igfbpl1, Gnas, Krt7 
#>  	   Nkx6-1, Aplp1, Ppp3ca, Lrpap1, Rplp1, Hn1, Rps12, Mfng, BC023829, Smarcd2 
#>  Negative:  Elovl6, Tmem108, Poc1a, Epn3, Nop56, Wipi1, B830012L14Rik, Rrp15, Rfc1, Fgf12 
#>  	   Slc20a1, Ppp2r2b, Lama1, Tecpr2, Zbtb4, Eif1ax, Fam162a, P4ha3, Gm10941, Tenm4 
#>  	   Pde4b, Gm5420, Man1c1, Hmgcs1, Pgap1, Mgst2, Larp1b, Kcnip3, Tnr, Lsm12 
#>  StandardBE_ 4 
#>  Positive:  Spp1, Cyr61, Krt18, Tpm1, Krt8, Myl12a, Vim, Jun, Anxa5, Tnfrsf12a 
#>  	   Csrp1, Sparc, Cldn7, Nudt19, Anxa2, Clu, Myl9, Atp1b1, Cldn3, Tagln2 
#>  	   S100a10, 1700011H14Rik, Cd24a, Rps2, Dbi, Id2, Lurap1l, Rplp1, Myl12b, Klf6 
#>  Negative:  Rpa3, Elovl6, Aacs, Tmem108, Poc1a, Tmcc3, Rfc1, Plekho1, Slc20a1, Ppp2r2b 
#>  	   Lama1, Tecpr2, Gm10941, Tenm4, Pde4b, Man1c1, Nipal1, Jam3, Pgap1, Alpl 
#>  	   Mgst2, Kcnip3, Tnr, Ptbp3, Gm15915, Cntln, Ocln, Fras1, Rbp2, Cbfa2t2 
#>  StandardBE_ 5 
#>  Positive:  2810417H13Rik, Rrm2, Hmgb2, Dut, Pcna, Lig1, H2afz, Tipin, Tuba1b, Tk1 
#>  	   Mcm5, Dek, Tyms, Gmnn, Ran, Tubb5, Rfc2, Srsf2, Ranbp1, Orc6 
#>  	   Mcm3, Uhrf1, Gins2, Dnajc9, Mcm6, Siva1, Rfc3, Mcm7, Rpa2, Ptma 
#>  Negative:  1110002L01Rik, Aacs, Wipi1, B830012L14Rik, Tmcc3, Trib1, Fgf12, Plekho1, Ppp2r2b, Lama1 
#>  	   Tenm4, Trf, Gm5420, Man1c1, Jam3, Mgst2, Kcnip3, Tnr, Gm15915, Cbfa2t2 
#>  	   Sh2d4a, Bbc3, Fkbp9, Ano6, Prkcb, Megf6, Fam46d, Slc52a3, Ankrd2, Tox2 
#>  [2025-09-20 14:08:37] Perform `Seurat::FindClusters()` with louvain and `cluster_resolution` = 0.6
#>  [2025-09-20 14:08:37] Reorder clusters...
#> ! [2025-09-20 14:08:37] Using `Seurat::AggregateExpression()` to calculate pseudo-bulk data for <Assay5>
#>  [2025-09-20 14:08:37] Perform umap nonlinear dimension reduction
#>  [2025-09-20 14:08:37] Non-linear dimensionality reduction (umap) using (Standardnmf) dims (1-50) as input
#>  [2025-09-20 14:08:37] UMAP will return its model
#>  [2025-09-20 14:08:42] Non-linear dimensionality reduction (umap) using (Standardnmf) dims (1-50) as input
#>  [2025-09-20 14:08:42] UMAP will return its model
#>  [2025-09-20 14:08:46] Perform mds linear dimension reduction
#>  [2025-09-20 14:08:48] Perform `Seurat::FindClusters()` with louvain and `cluster_resolution` = 0.6
#>  [2025-09-20 14:08:48] Reorder clusters...
#> ! [2025-09-20 14:08:48] Using `Seurat::AggregateExpression()` to calculate pseudo-bulk data for <Assay5>
#>  [2025-09-20 14:08:48] Perform umap nonlinear dimension reduction
#>  [2025-09-20 14:08:48] Non-linear dimensionality reduction (umap) using (Standardmds) dims (1-50) as input
#>  [2025-09-20 14:08:48] UMAP will return its model
#>  [2025-09-20 14:08:52] Non-linear dimensionality reduction (umap) using (Standardmds) dims (1-50) as input
#>  [2025-09-20 14:08:52] UMAP will return its model
#>  [2025-09-20 14:08:57] Perform glmpca linear dimension reduction
#>  [2025-09-20 14:08:57] Installing: glmpca...
#>  
#> → Will install 1 package.
#> → The package (0 B) is cached.
#> + glmpca   0.2.0 
#>   
#>  No downloads are needed, 1 pkg is cached
#>  Got glmpca 0.2.0 (x86_64-pc-linux-gnu-ubuntu-24.04) (230.79 kB)
#>  Installed glmpca 0.2.0  (1s)
#>  1 pkg + 1 dep: kept 1, added 1, dld 1 (230.79 kB) [1.9s]
#>  [2025-09-20 14:08:59] glmpca installed successfully
#>  StandardGLMPC_ 1 
#>  Positive:  Cartpt, Pkib, Srrm3, Tnr, Pax6os1, Pnma2, Skap1, Kcnb2, Dusp26, Gpr119 
#>  	   Galr1, Tmem8c, Actc1, Cntfr, Aard, Fut1, Cd3g, Crhr2, Ppp2r2c, Snap25 
#>  	   Ceacam10, Ucn3, Sept3, Isl1, Bhlhe41, Celf6, Bace2, Mbl2, Sez6l, Elavl3 
#>  Negative:  Rxrg, Tnfrsf19, AA986860, Peg12, Apcs, Ugt2b36, Rab32, Cdh3, Tmem213, Rassf9 
#>  	   Ckap2l, Krt23, Spp2, Slc43a1, Slc39a8, Gm684, Sult1a1, Calr4, P4ha3, Fbxo27 
#>  	   Vnn1, Otud1, Akr1b7, Slc22a2, Serpinb6b, Pmp22, Gas1, Ctgf, Lrr1, Traip 
#>  StandardGLMPC_ 2 
#>  Positive:  Crem, Emb, Fam89a, Chid1, Hist1h2bc, Ndn, Pdia4, Serpinb1a, Ocln, Slc16a10 
#>  	   Slc25a5, Nupr1, Nfkbia, Gata6, Serpini1, Mid1ip1, Junb, Zfp36, Atic, Gpx7 
#>  	   Sqle, Aacs, Hadh, Aldoa, Gde1, Fbxo32, Glud1, Akr1c19, Gch1, Pgrmc1 
#>  Negative:  Esyt3, Edn1, Kcnj13, Cpne5, 1700128E19Rik, Slc43a1, Sult1a1, Ankrd1, Plscr2, Myo5a 
#>  	   Tmem119, AU021092, Pmp22, Awat2, Kcnk10, Gm20649, Fam212b, Chrdl1, Fgfbp1, 1500035N22Rik 
#>  	   Tmem255b, Ccdc13, Nkain4, Platr22, Krt20, Sgol2a, Ramp3, Nhlrc1, Gm17056, Nhlh1 
#>  StandardGLMPC_ 3 
#>  Positive:  Gchfr, Apold1, Mbl2, Slc16a6, Pde1a, Ptprt, Adgrf5, Gm2115, Slitrk6, Fam159b 
#>  	   Lrrc24, Nap1l5, Fbp1, Plet1, Pdzrn4, Cypt3, Cpxm1, Vgf, Kctd8, Il1r1 
#>  	   Fbln5, 4930539E08Rik, Gm11131, Cav2, Platr26, Sult1d1, Amph, Stmn3, Gm826, 4933440M02Rik 
#>  Negative:  Adra2c, Nhlh1, Gm4319, Epb42, Lypd1, Adgrb1, Gm8773, Plbd1, Tmem114, Sema3g 
#>  	   Aqp7, Bhlhe22, Slc4a1, Parvb, Tgm7, Pthlh, Kif26a, Galr2, 1520401A03Rik, Fgf18 
#>  	   Olfml2b, Ankrd2, Wnt3, Mmp23, Tspear, Sapcd1, Fam212b, Notum, Pdcd1, 1700128E19Rik 
#>  StandardGLMPC_ 4 
#>  Positive:  Srcin1, Gm28875, Tfpi, Smpx, Snhg11, Tmem255b, B230312C02Rik, Unc5b, 2200002D01Rik, Fut1 
#>  	   Kndc1, Lgals2, Tmem8c, Nkpd1, Mmp23, Tmtc1, 1110002O04Rik, Cntfr, Pmp22, Cpb2 
#>  	   Rtp4, Cldn2, Sparcl1, Cbln4, Ncf2, Fgb, Col1a1, Lix1l, Mag, 1700048O20Rik 
#>  Negative:  Etv4, Icosl, Gm4319, Eci3, Nhlh1, Nrp2, Ppfibp2, Irf8, Sftpc, Egr4 
#>  	   Rasl11a, Ccl20, Esyt3, Ngf, Tssk6, Rps6kl1, Cxcl16, Sgol2a, Brip1, Flnc 
#>  	   Hist1h1a, Rdh5, Slfn9, Gm20649, Cbln1, 2410021H03Rik, Plaur, Rerg, Lockd, Scn9a 
#>  StandardGLMPC_ 5 
#>  Positive:  Adgrf5, Gm13344, Ncf2, Scnn1g, A130057D12Rik, Lrrc9, Colec12, Fn3krp, R3hdml, Fam132b 
#>  	   Dlgap3, Gm16140, Kcnj13, Zfp518b, Mcm10, Gm17056, Nkx6-3, Gm11131, Hbb-bt, Zcchc12 
#>  	   Pdzrn4, Gchfr, Lsp1, Ckm, Troap, Msx1, Elavl3, Col3a1, Coro1a, Wee2 
#>  Negative:  Tnni1, Vwa2, Tmem8c, Pou3f1, Prl, Plppr1, Crygn, Nepn, Gm20649, Fam124a 
#>  	   Tfpi, 2210407C18Rik, Hspa1a, Palm3, Gm6410, Skap1, Nlgn1, Acoxl, Tmem215, C530044C16Rik 
#>  	   Fkbp10, Arhgap36, Otc, Sftpc, Krtap16-1, Cartpt, Lgals9, Smoc2, Tmem132b, Wnt4 
#>  [2025-09-20 14:09:59] Perform `Seurat::FindClusters()` with louvain and `cluster_resolution` = 0.6
#>  [2025-09-20 14:09:59] Reorder clusters...
#> ! [2025-09-20 14:09:59] Using `Seurat::AggregateExpression()` to calculate pseudo-bulk data for <Assay5>
#>  [2025-09-20 14:10:00] Perform umap nonlinear dimension reduction
#>  [2025-09-20 14:10:00] Non-linear dimensionality reduction (umap) using (Standardglmpca) dims (1-50) as input
#>  [2025-09-20 14:10:00] UMAP will return its model
#>  [2025-09-20 14:10:04] Non-linear dimensionality reduction (umap) using (Standardglmpca) dims (1-50) as input
#>  [2025-09-20 14:10:04] UMAP will return its model
#>  [2025-09-20 14:10:09] Run scop standard workflow done
plist1 <- lapply(
  linear_reductions, function(lr) {
    CellDimPlot(
      pancreas_sub,
      group.by = "SubCellType",
      reduction = paste0(
        "Standard", lr, "UMAP2D"
      ),
      xlab = "", ylab = "", title = lr,
      legend.position = "none",
      theme_use = "theme_blank"
    )
  }
)
patchwork::wrap_plots(plotlist = plist1)
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.


nonlinear_reductions <- c(
  "umap", "tsne", "dm", "phate",
  "pacmap", "trimap", "largevis", "fr"
)
pancreas_sub <- standard_scop(
  pancreas_sub,
  linear_reduction = "pca",
  nonlinear_reduction = nonlinear_reductions
)
#>  [2025-09-20 14:10:09] Start standard scop workflow...
#>  [2025-09-20 14:10:09] Checking a list of <Seurat> object...
#>  [2025-09-20 14:10:10] Data 1/1 of the `srt_list` has been log-normalized
#>  [2025-09-20 14:10:10] Perform `Seurat::FindVariableFeatures()` on the data 1/1 of the `srt_list`...
#>  [2025-09-20 14:10:10] Use the separate HVF from srt_list
#>  [2025-09-20 14:10:10] Number of available HVF: 2000
#>  [2025-09-20 14:10:11] Finished check
#>  [2025-09-20 14:10:11] Perform `Seurat::ScaleData()`
#>  [2025-09-20 14:10:11] Perform pca linear dimension reduction
#> StandardPC_ 1 
#> Positive:  Aplp1, Cpe, Gnas, Fam183b, Map1b, Hmgn3, Pcsk1n, Chga, Tuba1a, Bex2 
#> 	   Syt13, Isl1, 1700086L19Rik, Pax6, Chgb, Scgn, Rbp4, Scg3, Gch1, Camk2n1 
#> 	   Cryba2, Pcsk2, Pyy, Tspan7, Mafb, Hist3h2ba, Dbpht2, Abcc8, Rap1b, Slc38a5 
#> Negative:  Spp1, Anxa2, Sparc, Dbi, 1700011H14Rik, Wfdc2, Gsta3, Adamts1, Clu, Mgst1 
#> 	   Bicc1, Ldha, Vim, Cldn3, Cyr61, Rps2, Mt1, Ptn, Phgdh, Nudt19 
#> 	   Smtnl2, Smco4, Habp2, Mt2, Col18a1, Rpl12, Galk1, Cldn10, Acot1, Ccnd1 
#> StandardPC_ 2 
#> Positive:  Rbp4, Tagln2, Tuba1b, Fkbp2, Pyy, Pcsk2, Iapp, Tmem27, Meis2, Tubb4b 
#> 	   Pcsk1n, Dbpht2, Rap1b, Dynll1, Tubb2a, Sdf2l1, Scgn, 1700086L19Rik, Scg2, Abcc8 
#> 	   Atp1b1, Hspa5, Fam183b, Papss2, Slc38a5, Scg3, Mageh1, Tspan7, Ppp1r1a, Ociad2 
#> Negative:  Neurog3, Btbd17, Gadd45a, Ppp1r14a, Neurod2, Sox4, Smarcd2, Mdk, Pax4, Btg2 
#> 	   Sult2b1, Hes6, Grasp, Igfbpl1, Gpx2, Cbfa2t3, Foxa3, Shf, Mfng, Tmsb4x 
#> 	   Amotl2, Gdpd1, Cdc14b, Epb42, Rcor2, Cotl1, Upk3bl, Rbfox3, Cldn6, Cer1 
#> StandardPC_ 3 
#> Positive:  Nusap1, Top2a, Birc5, Aurkb, Cdca8, Pbk, Mki67, Tpx2, Plk1, Ccnb1 
#> 	   2810417H13Rik, Incenp, Cenpf, Ccna2, Prc1, Racgap1, Cdk1, Aurka, Cdca3, Hmmr 
#> 	   Spc24, Kif23, Sgol1, Cenpe, Cdc20, Hist1h1b, Cdca2, Mxd3, Kif22, Ska1 
#> Negative:  Anxa5, Pdzk1ip1, Acot1, Tpm1, Anxa2, Dcdc2a, Capg, Sparc, Ttr, Pamr1 
#> 	   Clu, Cxcl12, Ndrg2, Hnf1aos1, Gas6, Gsta3, Krt18, Ces1d, Atp1b1, Muc1 
#> 	   Hhex, Acadm, Spp1, Enpp2, Bcl2l14, Sat1, Smtnl2, 1700011H14Rik, Tgm2, Fam159a 
#> StandardPC_ 4 
#> Positive:  Glud1, Tm4sf4, Akr1c19, Cldn4, Runx1t1, Fev, Pou3f4, Gm43861, Pgrmc1, Arx 
#> 	   Cd200, Lrpprc, Hmgn3, Ppp1r14c, Pam, Etv1, Tsc22d1, Slc25a5, Akap17b, Pgf 
#> 	   Fam43a, Emb, Jun, Krt8, Dnajc12, Mid1ip1, Ids, Rgs17, Uchl1, Alcam 
#> Negative:  Ins2, Ins1, Ppp1r1a, Nnat, Calr, Sytl4, Sdf2l1, Iapp, Pdia6, Mapt 
#> 	   G6pc2, C2cd4b, Npy, Gng12, P2ry1, Ero1lb, Adra2a, Papss2, Arhgap36, Fam151a 
#> 	   Dlk1, Creld2, Gip, Tmem215, Gm27033, Cntfr, Prss53, C2cd4a, Lyve1, Ociad2 
#> StandardPC_ 5 
#> Positive:  Pdx1, Nkx6-1, Npepl1, Cldn4, Cryba2, Fev, Jun, Chgb, Gng12, Adra2a 
#> 	   Mnx1, Sytl4, Pdk3, Gm27033, Nnat, Chga, Ins2, 1110012L19Rik, Enho, Krt7 
#> 	   Mlxipl, Tmsb10, Flrt1, Pax4, Tubb3, Prrg2, Gars, Frzb, BC023829, Gm2694 
#> Negative:  Irx2, Irx1, Gcg, Ctxn2, Tmem27, Ctsz, Tmsb15l, Nap1l5, Pou6f2, Gria2 
#> 	   Ghrl, Peg10, Smarca1, Arx, Lrpap1, Rgs4, Ttr, Gast, Tmsb15b2, Serpina1b 
#> 	   Slc16a10, Wnk3, Ly6e, Auts2, Sct, Arg1, Dusp10, Sphkap, Dock11, Edn3 
#>  [2025-09-20 14:10:12] Perform `Seurat::FindClusters()` with louvain and `cluster_resolution` = 0.6
#>  [2025-09-20 14:10:12] Reorder clusters...
#> ! [2025-09-20 14:10:12] Using `Seurat::AggregateExpression()` to calculate pseudo-bulk data for <Assay5>
#>  [2025-09-20 14:10:12] Perform umap nonlinear dimension reduction
#>  [2025-09-20 14:10:12] Non-linear dimensionality reduction (umap) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:10:12] UMAP will return its model
#>  [2025-09-20 14:10:17] Non-linear dimensionality reduction (umap) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:10:17] UMAP will return its model
#>  [2025-09-20 14:10:22] Perform tsne nonlinear dimension reduction
#>  [2025-09-20 14:10:22] Non-linear dimensionality reduction (tsne) using (Standardpca) dims (1-50) as input
#> Read the 1000 x 50 data matrix successfully!
#> OpenMP is working. 1 threads.
#> Using no_dims = 2, perplexity = 30.000000, and theta = 0.500000
#> Computing input similarities...
#> Building tree...
#> Done in 0.15 seconds (sparsity = 0.123070)!
#> Learning embedding...
#> Iteration 50: error is 67.143519 (50 iterations in 0.23 seconds)
#> Iteration 100: error is 58.277912 (50 iterations in 0.11 seconds)
#> Iteration 150: error is 57.729309 (50 iterations in 0.11 seconds)
#> Iteration 200: error is 57.507201 (50 iterations in 0.12 seconds)
#> Iteration 250: error is 57.429325 (50 iterations in 0.12 seconds)
#> Iteration 300: error is 1.071661 (50 iterations in 0.11 seconds)
#> Iteration 350: error is 0.933223 (50 iterations in 0.11 seconds)
#> Iteration 400: error is 0.897008 (50 iterations in 0.11 seconds)
#> Iteration 450: error is 0.880754 (50 iterations in 0.11 seconds)
#> Iteration 500: error is 0.872784 (50 iterations in 0.11 seconds)
#> Iteration 550: error is 0.865676 (50 iterations in 0.11 seconds)
#> Iteration 600: error is 0.859900 (50 iterations in 0.11 seconds)
#> Iteration 650: error is 0.852929 (50 iterations in 0.11 seconds)
#> Iteration 700: error is 0.845604 (50 iterations in 0.11 seconds)
#> Iteration 750: error is 0.841040 (50 iterations in 0.11 seconds)
#> Iteration 800: error is 0.839081 (50 iterations in 0.11 seconds)
#> Iteration 850: error is 0.836511 (50 iterations in 0.11 seconds)
#> Iteration 900: error is 0.834460 (50 iterations in 0.11 seconds)
#> Iteration 950: error is 0.831349 (50 iterations in 0.11 seconds)
#> Iteration 1000: error is 0.830510 (50 iterations in 0.11 seconds)
#> Fitting performed in 2.34 seconds.
#>  [2025-09-20 14:10:24] Non-linear dimensionality reduction (tsne) using (Standardpca) dims (1-50) as input
#> Read the 1000 x 50 data matrix successfully!
#> OpenMP is working. 1 threads.
#> Using no_dims = 3, perplexity = 30.000000, and theta = 0.500000
#> Computing input similarities...
#> Building tree...
#> Done in 0.14 seconds (sparsity = 0.123070)!
#> Learning embedding...
#> Iteration 50: error is 64.031848 (50 iterations in 0.51 seconds)
#> Iteration 100: error is 58.186915 (50 iterations in 0.26 seconds)
#> Iteration 150: error is 57.747960 (50 iterations in 0.23 seconds)
#> Iteration 200: error is 57.553685 (50 iterations in 0.23 seconds)
#> Iteration 250: error is 57.429018 (50 iterations in 0.23 seconds)
#> Iteration 300: error is 1.030081 (50 iterations in 0.24 seconds)
#> Iteration 350: error is 0.868321 (50 iterations in 0.25 seconds)
#> Iteration 400: error is 0.816735 (50 iterations in 0.25 seconds)
#> Iteration 450: error is 0.794752 (50 iterations in 0.25 seconds)
#> Iteration 500: error is 0.781963 (50 iterations in 0.25 seconds)
#> Iteration 550: error is 0.774223 (50 iterations in 0.25 seconds)
#> Iteration 600: error is 0.769137 (50 iterations in 0.26 seconds)
#> Iteration 650: error is 0.765521 (50 iterations in 0.26 seconds)
#> Iteration 700: error is 0.761562 (50 iterations in 0.27 seconds)
#> Iteration 750: error is 0.758342 (50 iterations in 0.28 seconds)
#> Iteration 800: error is 0.755965 (50 iterations in 0.28 seconds)
#> Iteration 850: error is 0.753431 (50 iterations in 0.28 seconds)
#> Iteration 900: error is 0.751412 (50 iterations in 0.28 seconds)
#> Iteration 950: error is 0.749502 (50 iterations in 0.28 seconds)
#> Iteration 1000: error is 0.747763 (50 iterations in 0.28 seconds)
#> Fitting performed in 5.44 seconds.
#>  [2025-09-20 14:10:30] Perform dm nonlinear dimension reduction
#>  [2025-09-20 14:10:30] Non-linear dimensionality reduction (dm) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:10:30] Installing: destiny...
#>  
#> → Will install 15 packages.
#> → All 15 packages (0 B) are cached.
#> + DEoptimR            1.1-4     
#> + RcppEigen           0.3.4.0.2 
#> + TTR                 0.24.4    
#> + VIM                 6.2.6     
#> + destiny             3.22.0    [bld][cmp]
#> + ggplot.multistats   1.0.1     
#> + ggthemes            5.1.0     
#> + knn.covertree       1.0       
#> + laeken              0.5.3     
#> + pcaMethods          2.0.0     [bld][cmp]
#> + ranger              0.17.0    
#> + robustbase          0.99-6    
#> + smoother            1.3       
#> + vcd                 1.4-13    
#> + xts                 0.14.1    
#>  All system requirements are already installed.
#>   
#>  No downloads are needed, 15 pkgs are cached
#>  Got DEoptimR 1.1-4 (x86_64-pc-linux-gnu-ubuntu-24.04) (74.64 kB)
#>  Got ranger 0.17.0 (x86_64-pc-linux-gnu-ubuntu-24.04) (473.78 kB)
#>  Got destiny 3.22.0 (source) (891.59 kB)
#>  Got TTR 0.24.4 (x86_64-pc-linux-gnu-ubuntu-24.04) (524.49 kB)
#>  Got ggthemes 5.1.0 (x86_64-pc-linux-gnu-ubuntu-24.04) (453.69 kB)
#>  Got knn.covertree 1.0 (x86_64-pc-linux-gnu-ubuntu-24.04) (91.51 kB)
#>  Got pcaMethods 2.0.0 (source) (1.04 MB)
#>  Got smoother 1.3 (x86_64-pc-linux-gnu-ubuntu-24.04) (22.69 kB)
#>  Got xts 0.14.1 (x86_64-pc-linux-gnu-ubuntu-24.04) (1.22 MB)
#>  Got ggplot.multistats 1.0.1 (x86_64-pc-linux-gnu-ubuntu-24.04) (31.64 kB)
#>  Got vcd 1.4-13 (x86_64-pc-linux-gnu-ubuntu-24.04) (1.30 MB)
#>  Got RcppEigen 0.3.4.0.2 (x86_64-pc-linux-gnu-ubuntu-24.04) (1.85 MB)
#>  Got robustbase 0.99-6 (x86_64-pc-linux-gnu-ubuntu-24.04) (3.13 MB)
#>  Got laeken 0.5.3 (x86_64-pc-linux-gnu-ubuntu-24.04) (3.16 MB)
#>  Installing system requirements
#>  Executing `sudo sh -c apt-get -y update`
#> Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist [144 B]
#> Hit:2 http://azure.archive.ubuntu.com/ubuntu noble InRelease
#> Hit:3 http://azure.archive.ubuntu.com/ubuntu noble-updates InRelease
#> Hit:4 http://azure.archive.ubuntu.com/ubuntu noble-backports InRelease
#> Hit:5 http://azure.archive.ubuntu.com/ubuntu noble-security InRelease
#> Hit:6 https://packages.microsoft.com/repos/azure-cli noble InRelease
#> Hit:7 https://packages.microsoft.com/ubuntu/24.04/prod noble InRelease
#> Reading package lists...
#>  Executing `sudo sh -c apt-get -y install libcurl4-openssl-dev libssl-dev make cmake libicu-dev`
#> Reading package lists...
#> Building dependency tree...
#> Reading state information...
#> libcurl4-openssl-dev is already the newest version (8.5.0-2ubuntu10.6).
#> libssl-dev is already the newest version (3.0.13-0ubuntu3.5).
#> make is already the newest version (4.3-4.1build2).
#> cmake is already the newest version (3.28.3-1build7).
#> libicu-dev is already the newest version (74.2-1ubuntu3.1).
#> 0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded.
#>  Building pcaMethods 2.0.0
#>  Installed DEoptimR 1.1-4  (69ms)
#>  Installed ggplot.multistats 1.0.1  (100ms)
#>  Installed ggthemes 5.1.0  (145ms)
#>  Installed knn.covertree 1.0  (129ms)
#>  Installed laeken 0.5.3  (81ms)
#>  Installed ranger 0.17.0  (78ms)
#>  Installed RcppEigen 0.3.4.0.2  (101ms)
#>  Installed robustbase 0.99-6  (92ms)
#>  Installed smoother 1.3  (70ms)
#>  Installed TTR 0.24.4  (120ms)
#>  Installed vcd 1.4-13  (96ms)
#>  Installed VIM 6.2.6  (112ms)
#>  Installed xts 0.14.1  (65ms)
#>  Built pcaMethods 2.0.0 (8.4s)
#>  Installed pcaMethods 2.0.0  (1s)
#>  Building destiny 3.22.0
#>  Built destiny 3.22.0 (27.2s)
#>  Installed destiny 3.22.0  (54ms)
#>  1 pkg + 111 deps: kept 95, added 15, dld 14 (14.27 MB) [43s]
#>  [2025-09-20 14:11:13] destiny installed successfully
#> Warning: In destiny::DiffusionMap(data = as_matrix(object), n_eigs = ndcs, 
#>     sigma = sigma, k = k, distance = dist.method, verbose = verbose, 
#>     ...) :
#>  extra argument ‘graph’ will be disregarded
#> finding knns......done. Time: 0.61s
#> Calculating transition probabilities......done. Time: 0.01s
#> 
#> 'as(<dsCMatrix>, "dgTMatrix")' is deprecated.
#> Use 'as(as(., "generalMatrix"), "TsparseMatrix")' instead.
#> See help("Deprecated") and help("Matrix-deprecated").
#> performing eigen decomposition......done. Time: 0.01s
#>  [2025-09-20 14:11:18] Non-linear dimensionality reduction (dm) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:11:18] destiny installed successfully
#> Warning: In destiny::DiffusionMap(data = as_matrix(object), n_eigs = ndcs, 
#>     sigma = sigma, k = k, distance = dist.method, verbose = verbose, 
#>     ...) :
#>  extra argument ‘graph’ will be disregarded
#> finding knns......done. Time: 0.59s
#> Calculating transition probabilities......done. Time: 0.00s
#> 
#> performing eigen decomposition......done. Time: 0.01s
#>  [2025-09-20 14:11:22] Perform phate nonlinear dimension reduction
#>  [2025-09-20 14:11:22] Non-linear dimensionality reduction (phate) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:11:24] Checking 1 packages in environment: scop_env
#>  [2025-09-20 14:11:24] Retrieving package list for environment: scop_env
#>  [2025-09-20 14:11:27] Found 205 packages installed
#>  [2025-09-20 14:11:27] phate version: 1.0.11
#>  [2025-09-20 14:11:29] Non-linear dimensionality reduction (phate) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:11:30] Checking 1 packages in environment: scop_env
#>  [2025-09-20 14:11:31] Retrieving package list for environment: scop_env
#>  [2025-09-20 14:11:33] Found 205 packages installed
#>  [2025-09-20 14:11:33] phate version: 1.0.11
#>  [2025-09-20 14:11:34] Perform pacmap nonlinear dimension reduction
#>  [2025-09-20 14:11:34] Non-linear dimensionality reduction (pacmap) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:11:36] Checking 1 packages in environment: scop_env
#>  [2025-09-20 14:11:36] Retrieving package list for environment: scop_env
#>  [2025-09-20 14:11:38] Found 205 packages installed
#>  [2025-09-20 14:11:38] pacmap version: 0.8.0
#>  [2025-09-20 14:12:01] Non-linear dimensionality reduction (pacmap) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:12:02] Checking 1 packages in environment: scop_env
#>  [2025-09-20 14:12:03] Retrieving package list for environment: scop_env
#>  [2025-09-20 14:12:05] Found 205 packages installed
#>  [2025-09-20 14:12:05] pacmap version: 0.8.0
#>  [2025-09-20 14:12:05] Perform trimap nonlinear dimension reduction
#>  [2025-09-20 14:12:05] Non-linear dimensionality reduction (trimap) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:12:07] Checking 1 packages in environment: scop_env
#>  [2025-09-20 14:12:07] Retrieving package list for environment: scop_env
#>  [2025-09-20 14:12:09] Found 205 packages installed
#>  [2025-09-20 14:12:10] trimap version: 1.1.4
#>  [2025-09-20 14:12:25] Non-linear dimensionality reduction (trimap) using (Standardpca) dims (1-50) as input
#>  [2025-09-20 14:12:26] Checking 1 packages in environment: scop_env
#>  [2025-09-20 14:12:27] Retrieving package list for environment: scop_env
#>  [2025-09-20 14:12:29] Found 205 packages installed
#>  [2025-09-20 14:12:29] trimap version: 1.1.4
#>  [2025-09-20 14:12:30] Perform largevis nonlinear dimension reduction
#>  [2025-09-20 14:12:30] Non-linear dimensionality reduction (largevis) using (Standardpca) dims (1-50) as input
#> 14:12:30 Read 1000 rows and found 50 numeric columns
#> 14:12:30 Normalizing by max-abs
#> 14:12:30 Using FNN for neighbor search, n_neighbors = 150
#> 14:12:31 Commencing calibration for perplexity = 50 using 2 threads
#> 14:12:34 Initializing from random Gaussian with sd = 1e-4
#> 14:12:34 Commencing optimization for 202861 epochs, with 197600 positive edges
#> 14:12:34 Using rng type: pcg
#> 14:14:49 Optimization finished
#>  [2025-09-20 14:14:49] Non-linear dimensionality reduction (largevis) using (Standardpca) dims (1-50) as input
#> 14:14:49 Read 1000 rows and found 50 numeric columns
#> 14:14:49 Normalizing by max-abs
#> 14:14:49 Using FNN for neighbor search, n_neighbors = 150
#> 14:14:51 Commencing calibration for perplexity = 50 using 2 threads
#> 14:14:54 Initializing from random Gaussian with sd = 1e-4
#> 14:14:54 Commencing optimization for 202861 epochs, with 197600 positive edges
#> 14:14:54 Using rng type: pcg
#> 14:17:18 Optimization finished
#>  [2025-09-20 14:17:18] Perform fr nonlinear dimension reduction
#>  [2025-09-20 14:17:18] Non-linear dimensionality reduction (fr) using (Standardpca_SNN) as input
#>  [2025-09-20 14:17:18] Running force-directed layout
#>  [2025-09-20 14:17:20] Force-directed layout computed
#>  [2025-09-20 14:17:20] Non-linear dimensionality reduction (fr) using (Standardpca_SNN) as input
#>  [2025-09-20 14:17:20] Running force-directed layout
#>  [2025-09-20 14:17:21] Force-directed layout computed
#>  [2025-09-20 14:17:21] Run scop standard workflow done
plist2 <- lapply(
  nonlinear_reductions, function(nr) {
    CellDimPlot(
      pancreas_sub,
      group.by = "SubCellType",
      reduction = paste0(
        "Standardpca", toupper(nr), "2D"
      ),
      xlab = "", ylab = "", title = nr,
      legend.position = "none",
      theme_use = "theme_blank"
    )
  }
)
patchwork::wrap_plots(plotlist = plist2)
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.