library(SingleCellExperiment)
library(ggplot2)
library(plotly)
library(dplyr)
library(colorspace)
library(dittoSeq)
library(tidyseurat)
seurat_obj <- tidyomicsWorkshop::seurat_obj
What proportion of all cells are gamma-delta T cells? Use signature_score > 0.7 to identify gamma-delta T cells.
seurat_obj |>
join_features(
features = c("CD3D", "TRDC", "TRGC1", "TRGC2", "CD8A", "CD8B"),
shape = "wide"
) |>
mutate(signature_score =
scales::rescale(CD3D + TRDC + TRGC1 + TRGC2, to=c(0,1)) -
scales::rescale(CD8A + CD8B, to=c(0,1))
) |>
mutate(gamma_delta = signature_score > 0.7) |>
count(gamma_delta) |>
summarise(proportion = n/sum(n))