The ccAFv2 classifier requires a thoroughly quality-controlled Seurat object, with an example QC pipeline available here. SCTransform is preferred, standard normalization only applies to the highly variable genes. This can exclude genes needed for the accurate classification of the cell cycle. To address this, the PredictCellCycle function re-runs SCTransform to retain all genes in the dataset
A slice of a human fetus 4 weeks post conception from Zeng et al., 2023 is available for testing purposes here. This data has been QC’d and normalized using SCTransform, following our best practices described above.
library(ccAFv2)
library(Seurat)
## Loading required package: SeuratObject
## Loading required package: sp
## 'SeuratObject' was built under R 4.4.0 but the current version is
## 4.4.2; it is recomended that you reinstall 'SeuratObject' as the ABI
## for R may have changed
## 'SeuratObject' was built with package 'Matrix' 1.7.0 but the current
## version is 1.7.1; it is recomended that you reinstall 'SeuratObject' as
## the ABI for 'Matrix' may have changed
##
## Attaching package: 'SeuratObject'
## The following objects are masked from 'package:base':
##
## intersect, t
spatial_obj = readRDS('GSM6736780_Spatial_10x_PCW4_20220122_slice1.rds')
spatial_obj = PredictCellCycle(spatial_obj, species='human', gene_id='symbol', spatial=TRUE)
## Running ccAFv2:
## Redoing SCTransform to ensure maximum overlap with classifier genes...
## Total possible marker genes for this classifier: 861
## Marker genes present in this dataset: 835
## Missing marker genes in this dataset: 26
## Predicting cell cycle state probabilities...
## 59/59 - 0s - 390ms/epoch - 7ms/step
## Choosing cell cycle state...
## Adding probabilities and predictions to metadata
## Done
To represent spatial RNA-seq data, cell cycle states are often mapped onto tissue slice images taken before sequencing. We use an enhanced SpatialDimPlot function that colors cells by their cell cycle state. This function supports all SpatialDimPlot parameters except group.by and cols.
library(ggplot2)
SpatialDimPlot.ccAFv2(spatial_obj) + theme(legend.position = "right")
SpatialDimPlot for slice 1 of a human fetus at 4 weeks post-conception colorized using the cell cycle states.