knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
# Load required packages library(CytoExploreR) library(CytoExploreRData)
# Compensation FCS Files cyto_save(Compensation, save_as = "Compensation-Samples") # Activation FCS Files cyto_save(Activation, save_as = "Activation-Samples")
# Setup compensation controls gs <- cyto_setup("Compensation-Samples", gatingTemplate = "Compensation-gatingTemplate.csv") # Transform fluorescent channels - default logicle transformations gs <- cyto_transform(gs) # Gate Cells cyto_gate_draw(gs, parent = "root", alias = "Cells", channels = c("FSC-A", "SSC-A")) # Gate Single Cells cyto_gate_draw(gs, parent = "Cells", alias = "Single Cells", channels = c("FSC-A", "FSC-H"))
knitr::include_graphics('CytoExploreR/CytoExploreR-1.png')
# Compute spillover matrix spill <- cyto_spillover_compute(gs, parent = "Single Cells", spillover = "Spillover-Matrix.csv")
knitr::include_graphics('Compensation/Compensation-9.png')
# Edit spillover matrix spill <- cyto_spillover_edit(gs, parent = "Single Cells", spillover = "Spillover-Matrix.csv")
knitr::include_graphics('Compensation/Compensation-10.png')
# Visualise uncompensated data cyto_plot_compensation(gs, parent = "Single Cells") # Visualise compensated data cyto_plot_compensation(gs, parent = "Single Cells", spillover = "Spillover-Matrix.csv", compensate = TRUE)
knitr::include_graphics('Compensation/Compensation-14.png')
library(CytoExploreR) library(CytoExploreRData) fs <- Activation gs <- GatingSet(fs) gs <- cyto_compensate(gs) gs <- cyto_transform(gs, plot = FALSE) gs <- cyto_gatingTemplate_apply(gs, Activation_gatingTemplate)
# Load and annotate samples gs <- cyto_setup("Activation-Samples", gatingTemplate = "Activation-gatingTemplate.csv")
knitr::include_graphics('CytoExploreR/CytoExploreR-2.png')
# Apply compensation gs <- cyto_compensate(gs, spillover = "Spillover-Matrix.csv") # Transform fluorescent channels - default logicle transformations gs <- cyto_transform(gs)
knitr::include_graphics('CytoExploreR/CytoExploreR-3.png')
# Gate Cells cyto_gate_draw(gs, parent = "root", alias = "Cells", channels = c("FSC-A","SSC-A"))
cyto_plot_save("CytoExploreR-4.png", height = 7, width = 7) cyto_plot(gs, parent = "root", alias = "Cells", channels = c("FSC-A","SSC-A"), group_by = "all", label_text_size = 1)
knitr::include_graphics('CytoExploreR/CytoExploreR-4.png')
# Gate Single Cells cyto_gate_draw(gs, parent = "Cells", alias = "Single Cells", channels = c("FSC-A","FSC-H"))
cyto_plot_save("CytoExploreR-5.png", height = 7, width = 7) cyto_plot(gs, parent = "Cells", alias = "Single Cells", channels = c("FSC-A","SSC-A"), group_by = "all", label_text_size = 1)
knitr::include_graphics('CytoExploreR/CytoExploreR-5.png')
# Extract unstained control NIL <- cyto_extract(gs, "Single Cells")[[33]] # Gate Live Cells cyto_gate_draw(gs, parent = "Single Cells", alias = c("Dead Cells", "Live Cells"), channels = c("Hoechst-405", "Hoechst-430"), type = "rectangle", negate = TRUE, overlay = NIL)
cyto_plot_save("CytoExploreR-6.png", height = 7, width = 7) cyto_plot(gs, parent = "Single Cells", alias = "", channels = c("Hoechst-405","Hoechst-430"), group_by = "all", overlay = cyto_extract(gs, "Single Cells")[[33]], label_text_size = 1)
knitr::include_graphics('CytoExploreR/CytoExploreR-6.png')
# Gate T Cells and Dedritic Cells cyto_gate_draw(gs, parent = "Live Cells", alias = c("T Cells", "Dendritic Cells"), channels = c("CD11c", "Va2"), type = c("ellipse", "rectangle"), overlay = NIL)
cyto_plot_save("CytoExploreR-7.png", height = 7, width = 7) cyto_plot(gs, parent = "Live Cells", alias = "", channels = c("CD11c","Va2"), group_by = "all", overlay = cyto_extract(gs, "Single Cells")[[33]], label_text_size = 1)
knitr::include_graphics('CytoExploreR/CytoExploreR-7.png')
# Gate CD4 & CD8 T Cells cyto_gate_draw(gs, parent = "T Cells", alias = c("CD4 T Cells", "CD8 T Cells"), channels = c("CD4", "CD8"), type = "r")
cyto_plot_save("CytoExploreR-8.png", height = 7, width = 7) cyto_plot(gs, parent = "T Cells", alias = "", channels = c("CD4","CD8"), group_by = "all", label_text_size = 1)
knitr::include_graphics('CytoExploreR/CytoExploreR-8.png')
# Extract CD4 T Cells CD4 <- cyto_extract(gs, "CD4 T Cells") # Extract naive CD4 T Cells CD4_naive <- cyto_select(CD4, OVAConc = 0) # Gate CD69+ CD4 T Cells cyto_gate_draw(gs, parent = "CD4 T Cells", alias = "CD69+ CD4 T Cells", channels = c("CD44", "CD69"), type = "rectangle", overlay = CD4_naive)
cyto_plot_save("CytoExploreR-9.png", height = 7, width = 7) cyto_plot(gs, parent = "CD4 T Cells", alias = "", channels = c("CD44","CD69"), group_by = "all", label_text_size = 1, overlay = cyto_select(cyto_extract(gs, "CD4 T Cells"), OVAConc = 0))
knitr::include_graphics('CytoExploreR/CytoExploreR-9.png')
# Gate CD69+ CD8 T Cells cyto_gate_draw(gs, parent = "CD8 T Cells", alias = "CD69+ CD8 T Cells", channels = c("CD44", "CD69"), type = "rectangle", contour_lines = 15)
cyto_plot_save("CytoExploreR-10.png", height = 7, width = 7) cyto_plot(gs, parent = "CD8 T Cells", alias = "", channels = c("CD44","CD69"), group_by = "all", label_text_size = 1, contour_lines = 15)
knitr::include_graphics('CytoExploreR/CytoExploreR-10.png')
# Gating Tree cyto_plot_gating_tree(gs[[32]], stat = "freq")
# Gating scheme cyto_plot_gating_scheme(gs[32], back_gate = TRUE, gate_track = TRUE)
cyto_plot_save("CytoExploreR-11.png", height = 10, width = 10) cyto_plot_gating_scheme(gs[[32]], back_gate = TRUE, gate_track = TRUE)
knitr::include_graphics('CytoExploreR/CytoExploreR-11.png')
# Compute medFI - exclude unstained control cyto_stats_compute(gs[1:32], alias = c("CD69+ CD4 T Cells", "CD69+ CD8 T Cells"), stat = "median", channels = c("CD44", "CD69"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.