Skip to contents

Score cell cycle and visualize on embedding and distribution.

Usage

VisCellCycle(
  object,
  genes_s,
  genes_g2m,
  reduction = "umap",
  dims = 1:10,
  palette = "C",
  alpha = 0.8
)

Arguments

object

A Seurat object; required.

genes_s

Character vector for S phase genes; required.

genes_g2m

Character vector for G2/M phase genes; required.

reduction

Reduction name for overlay ('umap' or 'pca'). Default: 'umap'.

dims

Dimensions used to compute embedding if needed. Default: 1:10.

palette

Viridis palette option for color/fill. Default: "C".

alpha

Points and bars alpha. Default: 0.8.

Value

A list with object, plot (patchwork), cluster (DimPlot) and bar (distribution).

Author

benben-miao

Examples

obj <- SeuratVisProExample(
    n_cells = 300,
    n_genes = 1000,
    n_clusters = 10,
    seed = 123,
    genes_mt = "^MT-",
    neighbor_dims = 10,
    cluster_res = 0.5,
    umap_dims = 10,
    spatial = FALSE)
#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
#> 
#> Number of nodes: 300
#> Number of edges: 4508
#> 
#> Running Louvain algorithm...
#> Maximum modularity in 10 random starts: 0.9485
#> Number of communities: 10
#> Elapsed time: 0 seconds

genes_s <- paste0('G', 1:10); genes_g2m <- paste0('G', 11:20)

res <- VisCellCycle(
  obj,
  genes_s,
  genes_g2m,
  reduction = "umap",
  dims = 1:10,
  palette = "C",
  alpha = 0.8)

res$plot

res$cluster

res$bar