data_dir = "/shared/projects/2422_ebaii_n1/atelier_scrnaseq/Intro_Rmd/" # Load data sobj = readRDS(paste0(data_dir, "sobj.rds")) sobj # Libraries of interest library(Seurat) # Visualize our favorite gene FeaturePlot(sobj, reduction = "tsne", features = "Ptcra") + theme(aspect.ratio = 1) # Ptcra is more expressed on the right, but how many cells are concerned ? # Which cells are positive for Ptcra ? library(ggplot2) sobj$is_Ptcra_pos = (FetchData(sobj, "Ptcra")[, 1] > 0) DimPlot(sobj, reduction = "tsne", group.by = "is_Ptcra_pos") + theme(aspect.ratio = 1) # How many cells are positive ? table(sobj$is_Ptcra_pos) # half of cells are Ptcra+