library(ggcyto)
dataDir <- system.file("extdata",package="flowWorkspaceData")
gs <- load_gs(list.files(dataDir, pattern = "gs_bcell_auto",full = TRUE))
data(GvHD)
fs <- GvHD[subset(pData(GvHD), Patient %in%5 & Visit %in% c(5:6))[["name"]]]

flowSet

geom_density layer is used for one-dimensional plot.

autoplot(fs, x = 'FSC-H')

geom_hex layer is added for 2d plot.

autoplot(fs, x = 'FSC-H', y = 'SSC-H', bins = 64)

## flowFrame For the flowFrame, it can display one-dimensional plots for all channels by not supplying the x argument.

autoplot(fs[[1]]) + labs_cyto("marker")

GatingSet

autoplot(gs, "CD3", bins = 64)

Here are some default settings applied:

  • The instrument range is applied by default (through ggcyto_par_set(limits = "instrument")).
  • “CD3” gate is plotted aganst its the parent population: “Live”."
  • Axis labels are inverse transformed through axis_x_inverse_trans/axis_x_inverse_trans.

Multiple gates that share the same parent can be plotted together.

autoplot(gs, c("CD3", "CD19"), bins = 64)

GatingHierarchy

Multiple cell populations with their asssociated gates can be plotted in different panels of the same plot.

## [1] "lymph" "Live"  "CD20"  "CD19"
autoplot(gh, nodes, bins = 64)

ggcyto_arrange

Optionally we can manually arrange it as a gtable object and manipulate the layout afterwards.

## [1] "ggcyto_GatingLayout"
## attr(,"package")
## [1] "ggcyto"
## TableGrob (2 x 4) "arrange": 5 grobs
##       z     cells    name                 grob
## lymph 1 (2-2,1-1) arrange       gtable[layout]
## Live  2 (2-2,2-2) arrange       gtable[layout]
## CD20  3 (2-2,3-3) arrange       gtable[layout]
## CD19  4 (2-2,4-4) arrange       gtable[layout]
##       5 (1-1,1-4) arrange text[GRID.text.1390]