Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Score cell-cycle activity

Score the S-phase and G2M-phase gene programs in 3,696 cells of the embryonic mouse pancreas Bastidas-Ponce et al., 2019, assign each cell a cell-cycle phase, and find the cycling populations. Strong S and G2M programs concentrate in three of the 12 computed Leiden clusters, made up mostly of Ductal cells: cluster 7 is 95% G2M, and clusters 8 and 11 are 84% and 89% S. Cluster 7 also holds a small group of 23 Ngn3 high endocrine progenitors (Ngn3 high EP) that includes the cells with the highest S and G2M scores. The Pre-endocrine and hormone-producing clusters are 82% to 96% G1, the phase of cells that express neither program, which includes cells that have left the cycle. Cluster 2, mostly Ductal cells, and clusters 4 and 10, mostly Ngn3 high EP cells, split between G1 and S, but each has a median S score of 0.00, and the scores published with the data call many of these S calls G1.

Open the prepared analysis

Download the prepared store and reopen its saved RNA analysis:

DataStore has 3696 (3696) cells with 1 assays: RNA Cell metadata: 'I', 'ids', 'names', 'G2M_score', 'RNA_UMAP1', 'RNA_UMAP2', 'RNA_clusters', 'RNA_leiden_cluster', 'RNA_nCounts', 'RNA_nFeatures', 'RNA_percentMito', 'RNA_percentRibo', 'S_score', 'clusters', 'clusters_coarse' RNA assay has 27998 features and following metadata: 'I', 'ids', 'names', 'dropOuts', 'highly_variable_genes', 'nCells'

Started: 2026-11-14T15:42:34.159113Z | Wall time: 7.178 s

The cell table, ds.cells, listed above as cell metadata, holds the published annotation: clusters names eight cell types, and S_score and G2M_score are cell-cycle scores published with the data.

ds.pipeline.open(label="rna") reopens the saved run of ds.pipeline.rna, CyteArc’s RNA analysis recipe, without recomputing it. Indexing the run by an output name returns an artifact reference, a handle to one saved result: analysis_cell_selection is a frozen cell selection, the fixed list of cells that the analysis used; umap is the two-dimensional layout of those cells; and clusters holds their Leiden clusters. The run’s clusters and the cell table’s clusters, which the code names CellField("clusters"), hold different labels. Draw both on the saved UMAP to see which published types each computed cluster holds:

Two UMAPs of the 3,696 embryonic mouse pancreas cells. Left: colored by the 12 computed Leiden clusters, with each number printed on its cells; clusters 1, 3, 5, 6, 9 and 12 fill the left side, clusters 4 and 10 the arc across the top, and clusters 2, 7, 8 and 11 the right-hand branch, with 7, 8 and 11 at its bottom and a few cluster 7 cells in a small group beside the arc. Right: colored by the eight published cell types, named on their cells, with Ductal and Ngn3 low EP cells on the right-hand branch, Ngn3 high EP cells along the arc and in the small group beside it, and Pre-endocrine, Alpha, Beta, Delta and Epsilon cells on the left side.

Started: 2026-11-14T15:42:41.339178Z | Wall time: 0.609 s

The Ductal cells and the Ngn3 low endocrine progenitors (Ngn3 low EP) fill the right-hand branch, the Ngn3 high EP cells the arc across the top, and the Pre-endocrine cells and the hormone-producing Alpha, Beta, Delta and Epsilon cells the left side. The 12 Leiden clusters divide the right-hand branch into clusters 2, 7, 8 and 11 and the arc into clusters 4 and 10, and they put a small group of Ngn3 high EP cells beside the arc into cluster 7.

Score the S and G2M programs

ds.scores.cell_cycle scores each phase in four steps:

  1. It matches the phase’s marker genes to the assay’s gene names. By default the markers come from CyteArc’s bundled lists, cytearc.quality_control.s_phase_genes and g2m_phase_genes, which hold Seurat’s 2019 update of the S and G2M markers in human gene symbols. Matching ignores case, so these symbols match mouse genes of the same name, and a marker renamed since the data were annotated matches its previous symbol.

  2. It ranks all genes by their mean log-normalized expression over the scored cells and cuts the ranking into bins of genes with similar means; n_bins sets their number.

  3. From each bin that holds a marker, it draws control genes at random with a fixed seed, rand_seed, as many per bin as the shorter marker list holds.

  4. It subtracts each cell’s mean control expression from its mean marker expression.

Check which markers match the store’s gene names, with the matching function that the scorer uses:

markersnot foundmatched by a previous symbol
S43nonenone
G2M54nonePIMREG as Fam64a, JPT1 as Hn1

Started: 2026-11-14T15:42:41.951113Z | Wall time: 0.140 s

All 43 S markers and all 54 G2M markers match. Two G2M markers carry newer symbols than the store’s gene names and match by their previous ones: PIMREG as Fam64a and JPT1 as Hn1.

Score the cells of the saved analysis. The call saves each cell’s S score, G2M score and phase as a new cell_cycle artifact and returns its reference. A cell with both scores below zero is G1, and any other cell takes the phase with the higher score, S on a tie:

S scoreG2M scorephase
0-0.024501-0.038461G1
10.020201-0.028616S
2-0.001931-0.045212G1
30.1046090.023677S
4-0.006316-0.020066G1

Started: 2026-11-14T15:42:42.093742Z | Wall time: 1.829 s

Rows 0, 2 and 4 have both scores below zero, so those cells are G1. Row 1 has a positive S score and a negative G2M score, and row 3 has two positive scores, the higher for S, so both are S.

Find the cycling populations

Tabulate the phases within each computed cluster, beside the published cell type that most of the cluster’s cells carry and the median of each score:

cellspublished cell typetype %G1 %S %G2M %median Smedian G2M
computed cluster
1552Beta979550-0.01-0.04
2544Ductal77425710.00-0.04
3449Alpha949460-0.01-0.04
4385Ngn3 high EP100514910.00-0.03
5369Pre-endocrine849190-0.01-0.04
6347Pre-endocrine6282171-0.01-0.03
7227Ductal6705950.020.16
8213Ductal96684100.060.00
9194Epsilon709280-0.01-0.05
10175Ngn3 high EP58494650.00-0.04
11145Ductal83089110.110.02
1296Delta729640-0.01-0.04

Started: 2026-11-14T15:42:43.926282Z | Wall time: 0.086 s

Clusters 7, 8 and 11, mostly Ductal cells, are the only clusters with fewer than 10% G1 cells. Cluster 7 is 95% G2M and clusters 8 and 11 are 84% and 89% S; their medians, 0.16 for G2M in cluster 7 and 0.06 and 0.11 for S in clusters 8 and 11, are the only medians of either score above 0.02. The Pre-endocrine clusters 5 and 6 and the hormone-producing clusters 1 (Beta), 3 (Alpha), 9 (Epsilon) and 12 (Delta) are 82% to 96% G1. Cluster 2, mostly Ductal cells, and the Ngn3 high EP clusters 4 and 10 split between G1 and S, with 42% to 51% G1, but each has a median S score of 0.00: many of their S calls rest on S scores close to zero.

Draw the phases on the UMAP, with clusters 7, 8 and 11 numbered, beside a plot of every cell’s S and G2M scores:

G1: 2,355 cells (64%), S: 1,067 cells (29%), G2M: 274 cells (7%)
Two panels in one set of phase colors, G1 blue, S green and G2M orange. Left: UMAP of the pancreas cells colored by assigned phase, with clusters 7, 8 and 11 numbered; G2M cells fill cluster 7 at the bottom of the right-hand branch, S cells fill clusters 8 and 11 beside it and make up about half of the cells along the rest of the branch and the top arc, the small group of cells beside the arc is S along its stalk and G2M at its tip, a few more G2M cells line the inner edge of the arc, and the left side is almost entirely G1. Right: G2M score against S score for every cell, with the boundaries of the phase rule drawn as lines: an S score of zero below a G2M score of zero, a G2M score of zero left of an S score of zero, and the diagonal where the two scores are equal. G1 cells form a compact cloud in the lower-left corner, S cells spread to the right below the diagonal with many close to an S score of zero, and G2M cells rise above the diagonal to G2M scores above 0.3.

Started: 2026-11-14T15:42:44.014150Z | Wall time: 0.345 s

Of the 3,696 cells, 2,355 (64%) are G1, 1,067 (29%) S and 274 (7%) G2M. On the UMAP, the G2M cells of cluster 7 and the S cells of clusters 8 and 11 lie side by side at the bottom of the right-hand branch, and S and G1 cells mix in similar numbers along the rest of the branch and the arc. The small group of Ngn3 high EP cells beside the arc is S along its stalk and G2M at its tip, and a few more G2M cells line the inner edge of the arc. In the score plot, the G1 cells form a compact cloud with both scores slightly below zero. The S cells spread to the right of the vertical line, many of them close to it, and the G2M cells rise above the diagonal, where the G2M score exceeds the S score.

Draw each score on the UMAP to see where each program is strongest:

Two UMAPs of the pancreas cells colored by the S score (left, up to about 0.22) and the G2M score (right, up to about 0.35) on viridis color scales. Within the right-hand branch, the S score is highest in a band at its bottom, where clusters 8 and 11 lie, and the G2M score in the neighboring region of cluster 7. Both scores reach their highest values in the small group of cells beside the top arc, the S score along its stalk and the G2M score at its tip, and stay near zero across the left side and along the arc.

Started: 2026-11-14T15:42:44.360635Z | Wall time: 0.231 s

Within the right-hand branch, the S score is highest in clusters 8 and 11 and the G2M score in cluster 7. The highest values of both scores fall in the small group beside the arc: the S score peaks along its stalk and the G2M score at its tip. Split cluster 7, which holds that group, by published cell type:

cellsG1SG2Mmedian Smedian G2M
published cell type in cluster 7
Ductal153031500.020.15
Ngn3 low EP5000500.010.18
Ngn3 high EP2308150.080.19
Pre-endocrine1001-0.010.16

Started: 2026-11-14T15:42:44.594285Z | Wall time: 0.015 s

Cluster 7 holds 23 Ngn3 high EP cells, which make up nearly all of the small group beside the arc: 8 are S and 15 G2M, with a median S score of 0.08 and a median G2M score of 0.19, against 0.00 and -0.03 in cluster 4, which is 100% Ngn3 high EP. The 153 Ductal and 50 Ngn3 low EP cells of cluster 7 are almost all G2M.

Compare with the published scores

Correlate the new scores with the published S_score and G2M_score columns, and assign phases from both with the same rule:

S score: Pearson r = 0.979
G2M score: Pearson r = 0.984
Same phase: 86.1% of 3,696 cells
phase from the published scoresG1SG2Mtotal
phase from the new scores
G12355002355
S50156061067
G2M52267274
total28615622733696

Started: 2026-11-14T15:42:44.611255Z | Wall time: 0.069 s

The two sets of scores correlate at r = 0.979 for S and 0.984 for G2M, and their phases agree for 86.1% of the cells. Every cell that the new scores call G1 is G1 by the published scores too, and 267 of the 274 G2M cells are G2M by both. The S calls differ: the published scores call 562 cells S, about half as many as the new scores’ 1,067, and 501 of the new S calls are G1 by the published scores. Count each computed cluster’s S calls and how many of them the published scores call G1:

computed cluster123456789101112
S calls303122918732581117915811294
G1 by the published scores30146241223251021135804

Started: 2026-11-14T15:42:44.682375Z | Wall time: 0.009 s

The published scores call G1 none of the S calls in clusters 7 and 11 and only 21 of the 179 in cluster 8, the clusters with strong cell-cycle programs. They call G1 146 of the 312 S calls in cluster 2, 122 of the 187 in cluster 4 and 58 of the 81 in cluster 10, and nearly all of the few S calls in the Pre-endocrine and hormone-producing clusters, such as all 30 in cluster 1. Many cells have an S score close to zero, as the score plot shows, so a small difference between two sets of scores moves them across the boundary between G1 and S. CyteArc’s scorer matches Scanpy’s on these cells when both use the same control genes (comparisons with other tools). Read an S call whose S score is close to zero as uncertain, and report the continuous scores beside the phases.

Score your own data

By default, a ds.pipeline.rna run scores the cell cycle with the same scorer in its cell_cycle stage and keeps the scores and phases as the run’s s_score, g2m_score and cell_cycle_phase cell fields. The saved run on this store was made without that stage, so this page calls the scorer directly; the pipeline reference lists the stage’s settings. A marker that matches no gene name is left out with a warning, and a phase with no match stops the call with an error; to score an assay whose gene names are not symbols, pass your own lists as s_genes and g2m_genes. Each call draws its control genes from the expression bins of the cells it scores, so scores from calls on different cells are not on one scale; score the samples that you want to compare in one call.

Gene-set scoring scores other gene programs in each cell with AUCell and WAGGR, and fate mapping scores how differentiated each of these pancreas cells is with ds.scores.potency.

References
  1. Bastidas-Ponce, A., Tritschler, S., Dony, L., Scheibner, K., Tarquis-Medina, M., Salinno, C., Schirge, S., Burtscher, I., Böttcher, A., Theis, F. J., Lickert, H., & Bakhti, M. (2019). Comprehensive single cell mRNA profiling reveals a detailed roadmap for pancreatic endocrinogenesis. Development, 146(12), dev173849. 10.1242/dev.173849