knitr::opts_chunk$set(echo = TRUE)
CytoRSuite is built on and shares the same gatingTemplate as the openCyto package. This means that users can take advantage of both the manual gating in CytoRSuite and the automated gating in openCyto for their analyses. Furthermore, CytoRSuite users can take advantage of some of the other features of the openCyto gatingTemplate, such as boolean and reference gates. More information on the openCyto gatingTemplate can be found here.
Here we aim to demonstrate the use of both manual and automated gating approaches using CytoRSuite and openCyto. For demonstration purposes we will use the Activation
dataset shipped with CytoRSuiteData.
library(CytoRSuite) # openCyto is imported with CytoRSuite library(CytoRSuiteData) # Assign Activation flowSet to fs fs <- Activation # Add fs to a GatingSet gs <- GatingSet(fs) # Apply compensation gs <- compensate(gs, fs[[1]]@description$SPILL) # Transform fluorescent channels trans <- estimateLogicle(gs[[4]], cyto_fluor_channels(gs)) gs <- transform(gs, trans)
Cells
# gate_draw returns gatingTemplate entry template <- gate_draw(gs, parent = "root", alias = "Cells", channels = c("FSC-A","SSC-A"))
Single Cells
template <- rbind(template, gate_draw(gs, parent = "Cells", alias = "Single Cells", channels = c("FSC-A","FSC-H")))
Live Cells
template <- rbind(template, gate_draw(gs, parent = "Single Cells", alias = "Live Cells", channels = c("Alexa Fluor 405-A", "Alexa Fluor 430-A")))
T Cells
template <- rbind(template, app_pop(gs, alias = "T Cells", pop = "+", parent = "Live Cells", dims = "APC-Cy7-A,PE-A", gating_method = "flowClust", gating_args = "K=3,target=c(0,3)"))
CD4 T Cells
template <- rbind(template, app_pop(gs, alias = "CD4 T Cells", pop = "+", parent = "T Cells", dims = "Alexa Fluor 700-A,Alexa Fluor 488-A", gating_method = "flowClust", gating_args = "K=3,target=c(3,0)"))
CD8 T Cells
template <- rbind(template, app_pop(gs, alias = "CD8 T Cells", pop = "+", parent = "T Cells", dims = "Alexa Fluor 700-A,Alexa Fluor 488-A", gating_method = "flowClust", gating_args = "K=3,target=c(0,3)"))
CD69+ CD4 T Cells
template <- rbind(template, gate_draw(gs, parent = "CD4 T Cells", alias = "CD69+ CD4 T Cells", channels = c("Alexa Fluor 647-A", "7-AAD-A"), type = "interval", axis = "y"))
CD69+ CD8 T Cells
template <- rbind(template, gate_draw(gs, parent = "CD8 T Cells", alias = "CD69+ CD8 T Cells", channels = c("Alexa Fluor 647-A", "7-AAD-A"), type = "interval", axis = "y"))
write.csv(template, "gatingTemplate.csv", row.names = FALSE)
# Assign Activation flowSet to fs fs <- Activation # Add fs to a GatingSet gs <- GatingSet(fs) # Apply compensation gs <- compensate(gs, fs[[1]]@description$SPILL) # Transform fluorescent channels trans <- estimateLogicle(gs[[4]], cyto_fluor_channels(gs)) gs <- transform(gs, trans) # Apply gatingTemplate gt <- gatingTemplate("gatingTemplate.csv") gating(gt,gs) # Visualise Gating Scheme cyto_plot_gating_scheme(gs[[4]])
For more information on manual gating using CytoRSuite refer to Gating Functions and Gate Manipulation vignettes. For more information on automated gating using openCyto refer to this Gating Methods vignette.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.