labbok part 7 immune cell scoring

PHOTO EMBED

Wed Jan 22 2025 20:02:33 GMT+0000 (Coordinated Universal Time)

Saved by @eho135

# 6 Immune cell scoring ####
# since community 1, 0 both contain immune cells, do immune cell scoring to see involvement 

# Score each cell based on activation of listed genes 




# for T cell activation 
# define a gene set for T-cell activation
tcell_activation_genes <-  c("CD69", "CD3G", "IFNG", "TNF", "CD3E", "CD3D", "ZAP70", "LCK")

# add activation score to Seurat object
seurat_object <- AddModuleScore(so_donorint, features = list(tcell_activation_genes), name = "Tcell_Activation")

# visualize activation score and save plot
VlnPlot(seurat_object, features = "Tcell_Activation1", pt.size = 0)
ggsave("plots5/tcellactivation_0.25.png")





# for cytotoxic T cells 
# define cytotoxic T cells gene set and add cytotoxic T cells score to Seurat object
cytotoxic_tcell_genes <-  c("CD8A", "GZMK", "GZMA") 
seurat_object <- AddModuleScore(seurat_object, features = list(cytotoxic_tcell_genes), name = "Cytotoxic_Tcell")

# visualize cytotoxic T cells 
VlnPlot(seurat_object, features = "Cytotoxic_Tcell1", pt.size = 0)
ggsave("plots5/cytotoxictcells_0.25.png")



# for exhausted T cells
# define exhausted T cells gene set abd add exhausted T cells score to Seurat object
exhausted_tcell_genes <-  c("PD1", "CTLA4", "LAG3", "TIM3") 
seurat_object <- AddModuleScore(seurat_object, features = list(exhausted_tcell_genes), name = "Exhausted_Tcell")

# visualize exhausted T cells 
VlnPlot(seurat_object, features = "Exhausted_Tcell1", pt.size = 0)
ggsave("plots5/exhaustedtcells_0.25.png")





# for Macrophage activation 
# define a gene set for macrophage activation
macrophage_activation_genes <-  c("CD80", "CD86", "TNF", "IL6", "STAT1", "IRF5", "iNOS", "CXCL8", "IL8")

# add activation score to Seurat object
seurat_object <- AddModuleScore(so_donorint, features = list(macrophage_activation_genes), name = "Macrophage_Activation")

# visualize activation score
VlnPlot(seurat_object, features = "Macrophage_Activation1", pt.size = 0)
ggsave("plots5/macrophageactivation_0.25.png")




# for B cell activation - just exploring 
# define a gene set for B-cell activation
bcell_activation_genes <-  c("IRF4", "CD86", "CD79A", "BTK")

# add activation score to Seurat object
seurat_object <- AddModuleScore(so_donorint, features = list(bcell_activation_genes), name = "Bcell_Activation")

# visualize activation score
VlnPlot(seurat_object, features = "Bcell_Activation1", , pt.size = 0)
ggsave("plots5/bcellactivation_0.25.png")



For full activation, B cells require co-stimulatory signals, often provided by T helper cells (Tfh cells) during T-dependent activation or through pathogen-associated signals during T-independent activation.




content_copyCOPY