Cluster and Reduce Dimensions of a seurat object

clustering_workflow(
  seu,
  excluded_cells,
  resolution = seq(0.2, 2, by = 0.2),
  organism = "human",
  experiment_name = "default_experiment",
  ...
)

Arguments

excluded_cells

named list of cells to exclude

resolution

resolution(s) to use for clustering cells

organism

Organism

...
feature_seus

list of seurat objects named according to feature of interest ("gene" or "transcript")

Examples

clustered_human_seu <- clustering_workflow(panc8, experiment_name = "seurat_pancreas", organism = "human")
#> Centering and scaling data matrix
#> PC_ 1 
#> Positive:  CD99, ERO1B, HMGN2, AC124312.1, MT-ND6, MT-ND1, HACD3, MT-ATP6, AL035071.1, NORAD 
#> 	   ATP5F1A, RACK1, PRUNE2, FAM171B, PRELID3B, EFNA5, AL354740.1, ARFGEF3, TENT5C, SARAF 
#> 	   G6PC2, PCSK1, ATP5PB, PFKFB2, ATP5F1C, ATP5F1B, UNC79, RGPD5, HNRNPA1, SLC25A6 
#> Negative:  IFITM3, RHOC, LGALS3, ZFP36L1, SERPING1, LITAF, TACSTD2, SERPINA3, KRT7, LCN2 
#> 	   SDC4, PRSS8, DHRS3, CFB, CTSH, ANXA4, CLDN1, COL18A1, TNFRSF12A, IL32 
#> 	   SERINC2, KRT19, TM4SF1, KRT18, SERPINH1, PDZK1IP1, CLDN4, C3, GPRC5B, PMEPA1 
#> PC_ 2 
#> Positive:  C10orf10, CRYBA2, KRT8, VGF, CLDN4, SERPINA1, CRH, LOXL4, ATP1A1, HSPB1 
#> 	   RASD1, GATM, SERINC2, SLC44A4, KRT18, CD74, CAMK2G, GPX2, UCP2, MUC1 
#> 	   GSTA1, AQP3, PRSS8, ARRDC4, LCN2, SPINK1, S100A6, SDC4, CFB, REG1A 
#> Negative:  COL6A3, SPARC, F2R, NID1, COL4A1, COL15A1, TIMP3, COL1A2, PXDN, PLAT 
#> 	   COL3A1, COL1A1, BGN, COL5A1, CDH11, XAF1, MMP2, SFRP2, PDGFRB, LAMA4 
#> 	   COL5A2, VCAN, ITGA1, ADAMTS4, LRRC32, GPNMB, LUM, CRISPLD2, SRPX2, RPL10 
#> PC_ 3 
#> Positive:  YWHAZ, OCLN, SAT1, SERPINA3, SDC4, LCN2, SOD2, TACSTD2, TM4SF1, KRT7 
#> 	   CFB, CLDN1, CPM, PDZK1IP1, C3, IL32, PRSS8, MT-ND1, MT-ATP6, RACK1 
#> 	   RPL10, TMC5, MT-ND6, CD44, ANXA4, CLDN10, PIGR, HNRNPA1, ANXA3, AKR1C3 
#> Negative:  TIMP1, PDGFRB, COL3A1, COL6A2, BGN, COL1A2, COL5A1, CRYBA2, SPON2, CYGB 
#> 	   SFRP2, AEBP1, MXRA8, COL15A1, MRC2, MMP2, LAMC3, THBS2, THY1, COL1A1 
#> 	   NID1, C11orf96, COL6A1, CDH11, SPARC, HTRA3, LRRC32, VCAN, LUM, IGFBP4 
#> PC_ 4 
#> Positive:  MCAM, TINAGL1, FLT1, TM4SF18, PLVAP, ERG, IGFBP7, CFTR, MYCT1, ECSCR 
#> 	   PMEPA1, ACVRL1, MMP7, STC1, KRT23, RGCC, VTCN1, S1PR1, PCDH12, AQP1 
#> 	   IFI27, CA2, CLEC14A, EMCN, CD93, CDH5, ESAM, PTPRB, CXCR4, SPP1 
#> Negative:  CTRB1, CTRB2, CTRC, CPA2, PNLIP, REG1B, PRSS1, PLA2G1B, PRSS3, CPA1 
#> 	   CELA2A, KLK1, CELA3A, CPB1, PRSS3P2, PNLIPRP1, BCAT1, PNLIPRP2, RARRES2, MGST1 
#> 	   DPEP1, SYCN, ALB, CELA3B, REG3A, CXCL17, PDIA2, SPINK1, GSTA2, CEL 
#> PC_ 5 
#> Positive:  PODXL, FLT1, ERG, PLVAP, MYCT1, ECSCR, CD93, S1PR1, EMCN, CDH5 
#> 	   CLEC14A, PCDH12, RGCC, VWF, PTPRB, PRDM1, ESAM, ACVRL1, CALCRL, F2RL3 
#> 	   ROBO4, BCL6B, TM4SF18, CXCR4, ELTD1, ICAM2, PECAM1, ESM1, CLIC2, CXorf36 
#> Negative:  CFTR, MMP7, ALDH1A3, IER3, SPP1, VTCN1, C1S, KRT23, SERPING1, TSPAN8 
#> 	   KRT19, TFPI2, HSD17B2, AQP1, LGALS4, LITAF, CLDN10, SLC3A1, NOTCH3, ANXA3 
#> 	   SERPINA5, CHI3L1, DEFB1, COL1A1, VCAM1, CDH6, CEACAM7, PDLIM3, SDC1, ATP1A1 
#> Warning: Command RunPCA.gene changing from SeuratCommand to SeuratCommand
#> Warning: Command RunTSNE changing from SeuratCommand to SeuratCommand
#> Warning: The following arguments are not used: check_duplicates
#> Warning: The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric
#> To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation'
#> This message will be shown once per session
#> 13:33:38 UMAP embedding parameters a = 0.9922 b = 1.112
#> Found more than one class "dist" in cache; using the first, from namespace 'BiocGenerics'
#> Also defined by 'spam'
#> 13:33:38 Read 1011 rows and found 30 numeric columns
#> 13:33:38 Using Annoy for neighbor search, n_neighbors = 30
#> Found more than one class "dist" in cache; using the first, from namespace 'BiocGenerics'
#> Also defined by 'spam'
#> 13:33:38 Building Annoy index with metric = cosine, n_trees = 50
#> 0%   10   20   30   40   50   60   70   80   90   100%
#> [----|----|----|----|----|----|----|----|----|----|
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> |
#> 13:33:39 Writing NN index file to temp file /tmp/RtmpLoWyKl/file3206326fca74e5
#> 13:33:39 Searching Annoy index using 1 thread, search_k = 3000
#> 13:33:39 Annoy recall = 100%
#> 13:33:39 Commencing smooth kNN distance calibration using 1 thread
#>  with target n_neighbors = 30
#> 13:33:40 Initializing from normalized Laplacian + noise (using RSpectra)
#> 13:33:40 Commencing optimization for 500 epochs, with 40366 positive edges
#> 13:33:41 Optimization finished
#> Warning: Command RunUMAP.gene.pca changing from SeuratCommand to SeuratCommand
#> [13:33:41] Clustering Cells...
#> Computing nearest neighbor graph
#> Computing SNN
#> Warning: Command FindNeighbors.gene.pca changing from SeuratCommand to SeuratCommand
#> clustering at 0.2 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1011
#> Number of edges: 35653
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.9547
#> Number of communities: 7
#> Elapsed time: 0 seconds
#> Warning: Command FindClusters changing from SeuratCommand to SeuratCommand
#> clustering at 0.4 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1011
#> Number of edges: 35653
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.9182
#> Number of communities: 9
#> Elapsed time: 0 seconds
#> clustering at 0.6 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1011
#> Number of edges: 35653
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.8853
#> Number of communities: 9
#> Elapsed time: 0 seconds
#> clustering at 0.8 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1011
#> Number of edges: 35653
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.8537
#> Number of communities: 11
#> Elapsed time: 0 seconds
#> clustering at 1 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1011
#> Number of edges: 35653
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.8256
#> Number of communities: 11
#> Elapsed time: 0 seconds
#> clustering at 1.2 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1011
#> Number of edges: 35653
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.7992
#> Number of communities: 12
#> Elapsed time: 0 seconds
#> clustering at 1.4 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1011
#> Number of edges: 35653
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.7787
#> Number of communities: 12
#> Elapsed time: 0 seconds
#> clustering at 1.6 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1011
#> Number of edges: 35653
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.7584
#> Number of communities: 13
#> Elapsed time: 0 seconds
#> clustering at 1.8 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1011
#> Number of edges: 35653
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.7383
#> Number of communities: 13
#> Elapsed time: 0 seconds
#> clustering at 2 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1011
#> Number of edges: 35653
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.7183
#> Number of communities: 13
#> Elapsed time: 0 seconds
#> stashing presto markers for gene_snn_res.0.2
#> stashing presto markers for gene_snn_res.0.4
#> stashing presto markers for gene_snn_res.0.6
#> stashing presto markers for gene_snn_res.0.8
#> stashing presto markers for gene_snn_res.1
#> stashing presto markers for gene_snn_res.1.2
#> stashing presto markers for gene_snn_res.1.4
#> stashing presto markers for gene_snn_res.1.6
#> stashing presto markers for gene_snn_res.1.8
#> stashing presto markers for gene_snn_res.2
#> [13:33:51] Logging Technical Details...
clustered_mouse_seu <- clustering_workflow(baron2016singlecell)
#> Centering and scaling data matrix
#> PC_ 1 
#> Positive:  Sparc, Msn, Col4a1, Col4a2, Cdh5, Thbs1, Pecam1, Ier3, Flt1, Plvap 
#> 	   Rhoc, Egfl7, Kdr, Anxa2, Eng, Esam, B2m, Cd93, Esm1, Nrp1 
#> 	   Tm4sf1, Sema7a, Ifitm3, Mmrn2, Adgrl4, Sgk1, Sox4, S1pr1, Lamb1, Mcam 
#> Negative:  Scg3, Chgb, Resp18, Prss53, G6pc2, Insm1, Ero1lb, Tmem27, Syt4, Prlr 
#> 	   Gsdma, Papss2, Vgf, Nkx6.1, Slc7a14, Bace2, Hadh, Sez6l, Igf1r, Rnase4 
#> 	   Neat1, Pcsk1, Slc38a4, Lpl, Scgn, Pak3, Wnt4, Tmem215, Phactr1, Gjd2 
#> PC_ 2 
#> Positive:  Cdh5, Flt1, Pecam1, Egfl7, Plvap, Kdr, Esm1, Adgrl4, S1pr1, Cd93 
#> 	   Emcn, Esam, Sema7a, Mmrn2, Eng, Igfbp3, Cd34, Ptprb, Notch4, Myct1 
#> 	   Sparcl1, Robo4, Tmem204, Dll4, Tcf4, Mcam, Angpt2, Ctla2a, Inhbb, Gimap6 
#> Negative:  Krt8, Clu, Krt18, Cldn4, Cd44, Onecut2, Scara3, S100a6, Cldn3, Krt19 
#> 	   Lcn2, Dsg2, Fermt1, Sox9, F3, Cxadr, Sfn, Wfdc2, Cdh1, Plet1 
#> 	   Anxa3, Sprr1a, Ankrd1, Cp, Lad1, Plscr1, Muc1, Bicc1, Cd14, Wwc1 
#> PC_ 3 
#> Positive:  Ctss, Pla2g7, Laptm5, Tyrobp, Cd74, H2.Aa, C1qb, Mpeg1, Fcer1g, Acp5 
#> 	   C1qc, Lyz2, H2.Ab1, Ms4a6d, H2.Eb1, Ms4a7, Clec4d, C3ar1, Apoe, Coro1a 
#> 	   Cd53, Csf1r, Ccl5, Ms4a6c, Tgfbi, Cybb, Lilrb4a, Mmp12, Cd36, Csf2rb2 
#> Negative:  Igfbp7, Sox4, Esm1, Flt1, Cdh5, Egfl7, Plvap, Inhbb, Kdr, Col4a1 
#> 	   Nfib, Gja1, Emcn, Sparc, Adgrl4, Tm4sf1, Lamb1, Cd34, Ptprb, Dll4 
#> 	   Col4a2, Efna1, Mmrn2, Igfbp3, S100a16, Prss23, Sparcl1, Pecam1, Tmem204, Myct1 
#> PC_ 4 
#> Positive:  Prrx1, Pdgfrb, Ndufa4l2, S1pr3, Igfbp5, Gm13889, Lhfp, Ednra, Mgp, Tbx3 
#> 	   Des, Axl, Rgs5, Col6a1, Kcne4, Col6a2, Plac9b, Cox4i2, Rarres2, Il11 
#> 	   Notch3, Cspg4, Ngf, Aebp1, Vim, Pde3a, Smtn, Tpm2, Serping1, Lgals1 
#> Negative:  Cdh5, Pecam1, Inhbb, Efna1, Adgrl4, S1pr1, Egfl7, Kdr, Esm1, Mmrn2 
#> 	   Robo4, Flt1, Notch4, Emcn, Cd34, Smad6, Ptprb, Gpihbp1, Dll4, Ly6a 
#> 	   Myct1, Nid2, Flt4, Srgn, Igfbp3, Plvap, Sema3f, Adgrl2, Mgll, Prkch 
#> PC_ 5 
#> Positive:  Prss53, G6pc2, Prlr, Ero1lb, Igf1r, Bace2, Papss2, Tmem215, Gng12, Sytl4 
#> 	   Nkx6.1, Pcsk1, Sqstm1, Syt4, Ttyh1, Gsdma, Itgav, Ucn3, Adra2a, Gabbr2 
#> 	   Nupr1, Kdm2b, Neat1, Hmox1, Emilin1, Cox6a2, Gjd2, Fkbp1b, Slc2a2, Dnajc24 
#> Negative:  Pyy, Rbp4, Gpx3, Gnas, Gc, Tmem27, Etv1, Gcg, Eef1a2, Arg1 
#> 	   Ppy, Sst, Kcnk3, Sfrp5, Resp18, Itpr1, Ttr, Cst3, Irx1, Irx2 
#> 	   Fev, Hhex, Serping1, Ache, Dpp6, Nefm, Egr1, Arx, Fos, Mest 
#> Warning: The following arguments are not used: check_duplicates
#> 13:34:00 UMAP embedding parameters a = 0.9922 b = 1.112
#> Found more than one class "dist" in cache; using the first, from namespace 'BiocGenerics'
#> Also defined by 'spam'
#> 13:34:00 Read 1886 rows and found 30 numeric columns
#> 13:34:00 Using Annoy for neighbor search, n_neighbors = 30
#> Found more than one class "dist" in cache; using the first, from namespace 'BiocGenerics'
#> Also defined by 'spam'
#> 13:34:00 Building Annoy index with metric = cosine, n_trees = 50
#> 0%   10   20   30   40   50   60   70   80   90   100%
#> [----|----|----|----|----|----|----|----|----|----|
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> *
#> |
#> 13:34:00 Writing NN index file to temp file /tmp/RtmpLoWyKl/file320632265ce28
#> 13:34:00 Searching Annoy index using 1 thread, search_k = 3000
#> 13:34:00 Annoy recall = 100%
#> 13:34:01 Commencing smooth kNN distance calibration using 1 thread
#>  with target n_neighbors = 30
#> 13:34:02 Initializing from normalized Laplacian + noise (using RSpectra)
#> 13:34:02 Commencing optimization for 500 epochs, with 75976 positive edges
#> 13:34:04 Optimization finished
#> [13:34:04] Clustering Cells...
#> Computing nearest neighbor graph
#> Computing SNN
#> clustering at 0.2 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1886
#> Number of edges: 65309
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.9445
#> Number of communities: 8
#> Elapsed time: 0 seconds
#> clustering at 0.4 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1886
#> Number of edges: 65309
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.9119
#> Number of communities: 9
#> Elapsed time: 0 seconds
#> clustering at 0.6 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1886
#> Number of edges: 65309
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.8855
#> Number of communities: 10
#> Elapsed time: 0 seconds
#> clustering at 0.8 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1886
#> Number of edges: 65309
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.8601
#> Number of communities: 12
#> Elapsed time: 0 seconds
#> clustering at 1 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1886
#> Number of edges: 65309
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.8406
#> Number of communities: 15
#> Elapsed time: 0 seconds
#> clustering at 1.2 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1886
#> Number of edges: 65309
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.8240
#> Number of communities: 15
#> Elapsed time: 0 seconds
#> clustering at 1.4 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1886
#> Number of edges: 65309
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.8075
#> Number of communities: 15
#> Elapsed time: 0 seconds
#> clustering at 1.6 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1886
#> Number of edges: 65309
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.7912
#> Number of communities: 16
#> Elapsed time: 0 seconds
#> clustering at 1.8 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1886
#> Number of edges: 65309
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.7753
#> Number of communities: 16
#> Elapsed time: 0 seconds
#> clustering at 2 resolution
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 1886
#> Number of edges: 65309
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.7608
#> Number of communities: 17
#> Elapsed time: 0 seconds
#> stashing presto markers for gene_snn_res.0.2
#> stashing presto markers for gene_snn_res.0.4
#> stashing presto markers for gene_snn_res.0.6
#> stashing presto markers for gene_snn_res.0.8
#> stashing presto markers for gene_snn_res.1
#> stashing presto markers for gene_snn_res.1.2
#> stashing presto markers for gene_snn_res.1.4
#> stashing presto markers for gene_snn_res.1.6
#> stashing presto markers for gene_snn_res.1.8
#> stashing presto markers for gene_snn_res.2
#> Warning: The following features are not present in the object: MCM5, PCNA, TYMS, FEN1, MCM2, MCM4, RRM1, UNG, GINS2, MCM6, CDCA7, DTL, PRIM1, UHRF1, MLF1IP, HELLS, RFC2, RPA2, NASP, RAD51AP1, GMNN, WDR76, SLBP, CCNE2, UBR7, POLD3, MSH2, ATAD2, RAD51, RRM2, CDC45, CDC6, EXO1, TIPIN, DSCC1, BLM, CASP8AP2, USP1, CLSPN, POLA1, CHAF1B, BRIP1, E2F8, not searching for symbol synonyms
#> Warning: The following features are not present in the object: HMGB2, CDK1, NUSAP1, UBE2C, BIRC5, TPX2, TOP2A, NDC80, CKS2, NUF2, CKS1B, MKI67, TMPO, CENPF, TACC3, FAM64A, SMC4, CCNB2, CKAP2L, CKAP2, AURKB, BUB1, KIF11, ANP32E, TUBB4B, GTSE1, KIF20B, HJURP, CDCA3, HN1, CDC20, TTK, CDC25C, KIF2C, RANGAP1, NCAPD2, DLGAP5, CDCA2, CDCA8, ECT2, KIF23, HMMR, AURKA, PSRC1, ANLN, LBR, CKAP5, CENPE, CTCF, NEK2, G2E3, GAS2L3, CBX5, CENPA, not searching for symbol synonyms
#> Warning: Could not find enough features in the object from the following feature lists: S.Score Attempting to match case...Could not find enough features in the object from the following feature lists: G2M.Score Attempting to match case...
#> [13:34:09] Logging Technical Details...