knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
# Activation GatingSet library(CytoExploreRData) gs_linear <- GatingSet(Activation)
cyto_plot_save("Transformations-1.png") cyto_plot(gs_linear[[1]], parent = "root", channels = "CD8", title = "Linear Data", density_fill = "orange") cyto_plot_complete()
knitr::include_graphics('Transformations/Transformations-1.png')
gs_log <- cyto_transform(cyto_copy(gs_linear), channels = "CD8", type = "log", copy = TRUE) cyto_plot_save("Transformations-2.png") cyto_plot_custom(c(1,1)) cyto_plot(gs_log[[1]], parent = "root", channels = "CD8", title = "Log Transformation", density_fill = "deepskyblue") text(0.3, 60, "values \n approaching \n zero dumped \n in first bin") arrows(0.15, 60, 0.05, 40) rect(-0.08,-14,0.5,-2, border = "red", lwd = 2, xpd = NA) cyto_plot_complete()
knitr::include_graphics('Transformations/Transformations-2.png')
gs_arc <- cyto_transform(cyto_copy(gs_linear), channels = "CD8", type = "arcsinh", copy = TRUE) gs_biex <- cyto_transform(cyto_copy(gs_linear), channels = "CD8", type = "biex", copy = TRUE) gs_logicle <- cyto_transform(cyto_copy(gs_linear), channels = "CD8", type = "logicle", copy = TRUE) cyto_plot_save("Transformations-3.png", width = 10, height = 10) cyto_plot_custom(c(2,2)) # LOG cyto_plot(gs_log[[1]], parent = "root", channels = "CD8", title = "Log Transformation", density_fill = "deepskyblue") rect(-0.08,-14,0.5,-2, border = "red", lwd = 2, xpd = NA) # ARCSINH cyto_plot(gs_arc[[1]], parent = "root", channels = "CD8", title = "Arcsinh Transformation", density_fill = "deeppink") rect(-0.31,-14,0.3,-2, border = "red", lwd = 2, xpd = NA) # BIEX cyto_plot(gs_biex[[1]], parent = "root", channels = "CD8", title = "Biexponential Transformation", density_fill = "green") rect(-165,-14,1050,-2, border = "red", lwd = 2, xpd = NA) # LOGICLE cyto_plot(gs_logicle[[1]], parent = "root", channels = "CD8", title = "Logicle Transformation", density_fill = "yellow") rect(0.1,-14,1.15,-2, border = "red", lwd = 2, xpd = NA) cyto_plot_complete()
knitr::include_graphics('Transformations/Transformations-3.png')
# Load required packages library(CytoExploreR) library(CytoExploreRData) # Activation dataset Activation # Save Activation dataset FCS files to Activation-Samples folder cyto_save(Activation, save_as = "Activation-Samples")
# Activation GatingSet gs <- cyto_setup("Activation-Samples") # Apply compensation gs <- cyto_compensate(gs)
# Default log transformer trans_log <- cyto_transformer_log(gs)
gs_log <- cyto_transform(cyto_copy(gs_linear), type = "log", copy = TRUE) cyto_plot_save("Transformations-4.png", height = 10, width = 12) cyto_plot_profile(gs_log[[1]], parent = "root", channels = cyto_fluor_channels(gs_log), header = "Log Transformers", density_fill = "deepskyblue") cyto_plot_complete() gs_arc <- cyto_transform(cyto_copy(gs_linear), type = "arcsinh", copy = TRUE) cyto_plot_save("Transformations-5.png", height = 10, width = 12) cyto_plot_profile(gs_arc[[1]], parent = "root", channels = cyto_fluor_channels(gs_arc), header = "Arcsinh Transformers", density_fill = "deeppink") cyto_plot_complete() gs_biex <- cyto_transform(cyto_copy(gs_linear), type = "biex", copy = TRUE) cyto_plot_save("Transformations-6.png", height = 10, width = 12) cyto_plot_profile(gs_biex[[1]], parent = "root", channels = cyto_fluor_channels(gs_biex), header = "Biexponential Transformers", density_fill = "green") cyto_plot_complete() gs_logicle <- cyto_transform(cyto_copy(gs_linear), type = "logicle", copy = TRUE) cyto_plot_save("Transformations-7.png", height = 10, width = 12) cyto_plot_profile(gs_logicle[[1]], parent = "root", channels = cyto_fluor_channels(gs_logicle), header = "Logicle Transformers", density_fill = "yellow") cyto_plot_complete()
knitr::include_graphics('Transformations/Transformations-4.png')
# Default arcsinh transformer trans_arcsinh <- cyto_transformer_arcsinh(gs)
knitr::include_graphics('Transformations/Transformations-5.png')
# Default biexponentail transformer trans_biex <- cyto_transformer_biex(gs)
knitr::include_graphics('Transformations/Transformations-6.png')
# Default biexponentail transformer trans_logicle <- cyto_transformer_logicle(gs)
knitr::include_graphics('Transformations/Transformations-7.png')
# Remove PE-A & 7-AAD-A transformers trans_biex <- trans_biex[-match(c("PE-A", "7-AAD-A"), names(trans_biex))] # Check transformers have been removed trans_biex
cyto_plot_save("Transformations-8.png", height = 6, width = 6) gs_biex <- cyto_transform(cyto_copy(gs_linear[1]), channels = "Va2", type = "biex", widthBasis = -10, copy = TRUE, plot = FALSE) cyto_plot(gs_biex[[1]], parent = "root", channels = "Va2", title = "widthBasis = -10") cyto_plot_complete()
# default PE transformer PE_biex <- cyto_transformer_biex(gs, channels = "PE-A", widthBasis = -10)
knitr::include_graphics('Transformations/Transformations-8.png')
cyto_plot_save("Transformations-9.png", height = 6, width = 6)
cyto_plot_save("Transformations-9.png", height = 6, width = 6) gs_biex <- cyto_transform(cyto_copy(gs_linear[1]), channels = "Va2", type = "biex", widthBasis = -100, copy = TRUE, plot = FALSE) cyto_plot(gs_biex[[1]], parent = "root", channels = "Va2", title = "widthBasis = -100") cyto_plot_complete()
# PE transformer PE_biex <- cyto_transformer_biex(gs, channels = "PE-A",. widthBasis = -100)
knitr::include_graphics('Transformations/Transformations-9.png')
cyto_plot_save("Transformations-10.png", height = 6, width = 6)
cyto_plot_save("Transformations-10.png", height = 6, width = 6) gs_biex <- cyto_transform(cyto_copy(gs_linear[1]), channels = "Va2", type = "biex", widthBasis = -1000, copy = TRUE, plot = FALSE) cyto_plot(gs_biex[[1]], parent = "root", channels = "Va2", title = "widthBasis = -1000") cyto_plot_complete()
# PE transformer PE_biex <- cyto_transformer_biex(gs, channels = "PE-A",. widthBasis = -1000)
knitr::include_graphics('Transformations/Transformations-10.png')
# PE transformer PE_biex <- cyto_transformer_biex(gs, channels = "PE-A",. widthBasis = -100) # Combine transformer definitions trans <- cyto_transformer_combine(trans_biex, PE_biex, trans_logicle["7-AAD-A"]) # All transformer definitions trans
# Apply transformers to data gs <- cyto_transform(gs, trans = trans)
# Activation GatingSet gs <- cyto_setup("Activation-Samples") # Apply compensation gs <- cyto_compensate(gs) # Apply transformers gs <- cyto_transform(gs, type = "logicle")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.