knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
img <- htmltools::img(src = knitr::image_uri("logo.png"), alt = 'logo', style = 'float:right; width:150px') html <- htmltools::doRenderTags(img) readr::write_lines(html, path = "logo.html")
library(CytoExploreR) gs <- cyto_load( system.file( "extdata/Compensation-GatingSet", package = "CytoExploreRData" ) )
cyto_plot_save("Compensation-1.png", height = 6, width = 12) cyto_plot_custom(c(1,2)) cyto_plot(gs[[5]], parent = "Single Cells", overlay = cyto_extract(gs[[7]], parent = "Single Cells"), channels = "CD8", density_fill = c("green4", "black"), density_fill_alpha = c(1, 0.8), xlim = c(-2, 4.5), title = "Primary Detector") cyto_plot(gs[[5]], parent = "Single Cells", overlay = cyto_extract(gs[[7]], parent = "Single Cells"), channels = "Va2", density_fill = c("red", "black"), density_fill_alpha = c(1, 0.8), xlim = c(-2, 4.5), title = "Secondary Detector") text(3.5,60, "FITC \n spillover \n into PE-A", cex = 1.1) arrows(2.8, 60, 2.4, 47) cyto_plot_complete()
knitr::include_graphics('Compensation/Compensation-1.png')
gs <- cyto_compensate(cyto_copy(gs), spillover = "190421-Spillover-Matrix.csv")
cyto_plot_save("Compensation-2.png", height = 6, width = 12) cyto_plot_custom(c(1,2)) cyto_plot(gs[[5]], parent = "Single Cells", overlay = cyto_extract(gs[[7]], parent = "Single Cells"), channels = "CD8", density_fill = c("green4", "black"), density_fill_alpha = c(1, 0.8), xlim = c(-2, 4.5), title = "Primary Detector", layout = FALSE) cyto_plot(gs[[5]], parent = "Single Cells", overlay = cyto_extract(gs[[7]], parent = "Single Cells"), channels = "Va2", density_fill = c("red", "black"), density_fill_alpha = c(1, 0.8), title = "Secondary Detector", xlim = c(-2, 4.5), layout = FALSE) text(3.5,60, "FITC \n spillover \n removed \n from PE-A", cex = 1.1) arrows(2.8, 60, 2.2, 50) cyto_plot_complete()
knitr::include_graphics('Compensation/Compensation-2.png')
# Load required packages library(CytoExploreRData) library(CytoExploreR) # Compensation dataset Compensation # Save Compensation dataset FCS files to Compensation-Samples folder cyto_save(Compensation, save_as = "Compensation-Samples")
# Compensation GatingSet gs <- cyto_setup("Compensation-Samples", gatingTemplate = "Compensation-gatingTemplate.csv")
knitr::include_graphics('Compensation/Compensation-3.png')
# Apply logicle transformation to fluorescent channels gs <- cyto_transform(gs, type = "logicle")
cyto_plot_save("Compensation-4.png", height = 8, width = 10) cyto_plot_profile(gs[[5]], parent = "Single Cells", channels = cyto_fluor_channels(gs), header = NA) cyto_plot_complete()
knitr::include_graphics('Compensation/Compensation-4.png')
cyto_gate_draw(gs, parent = "root", alias = "Cells", channels = c("FSC-A", "SSC-A"))
knitr::include_graphics('Compensation/Compensation-5.png')
cyto_gate_draw(gs, parent = "Cells", alias = "Single Cells", channels = c("FSC-A", "SSC-A"))
knitr::include_graphics('Compensation/Compensation-6.png')
# Automated compensation spill <- cyto_spillover_compute(gs, parent = "Single Cells", spillover = "Spillover-Matrix.csv")
# Computed spillover matrix
spill
knitr::include_graphics('Compensation/Compensation-9.png')
# Open CytoExploreR spillover matrix editor spill <- cyto_spillover_edit(gs, parent = "Single Cells", spillover = "Spillover-Matrix.csv")
knitr::include_graphics('Compensation/Compensation-10.png')
knitr::include_graphics('Compensation/Compensation-11.png')
knitr::include_graphics('Compensation/Compensation-12.png')
cyto_plot_compensation(gs, parent = "Single Cells")
cyto_plot_save("Compensation-13.png", height = 8, width = 10) cyto_plot_compensation(gs[[5]], parent = "Single Cells", overlay = cyto_extract(gs[[7]], "Single Cells")) cyto_plot_complete()
knitr::include_graphics('Compensation/Compensation-13.png')
cyto_plot_compensation(gs, parent = "Single Cells", spillover = "Spillover-Matrix.csv", compensate = TRUE)
cyto_plot_save("Compensation-14.png", height = 8, width = 10) cyto_plot_compensation(gs[[5]], parent = "Single Cells", overlay = cyto_extract(gs[[7]], "Single Cells"), compensate = TRUE, spillover = spill) # auto comp cyto_plot_complete()
knitr::include_graphics('Compensation/Compensation-14.png')
# Compensation GatingSet gs <- cyto_setup("Compensation-Samples", gatingTemplate = "Compensation-gatingTemplate.csv") # Apply compensation gs <- cyto_compensate(gs, spillover = "Spillover-Matrix.csv") # Data transformations gs <- cyto_transform(gs, type = "logicle") # Apply gates cyto_gatingTemplate_apply(gs, gatingTemplate = "Compensation-gatingTemplate.csv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.