Learn R Programming

ggcyto (version 1.0.5)

autoplot.flowSet: Plot fluorescence intensity in one or two dimension.

Description

Overloaded autoplot for the cytomertry data structure: flowFrame or flowSet, Gatinghierarchy, GatingSet. It plots the cytometry data with geom_histogram, geom_density or geom_hex.

Usage

"autoplot"(object, x, y = NULL, bins = 30, ...)
"autoplot"(object, ...)
"autoplot"(object, gate, x = NULL, y = "SSC-A", bins = 30, ...)
"autoplot"(object, gate, y = "SSC-A", bool = FALSE, arrange.main = sampleNames(object), arrange = TRUE, merge = TRUE, projections = list(), strip.text = c("parent", "gate"), ...)

Arguments

object
flowFrame, flowSet, GatingSet object
x,y
define the dimension of the plot
bins
passed to geom_hex
...
other arguments passed to ggplot
gate
the gate to be plotted
bool
whether to plot boolean gates
arrange.main
the main title of the arranged plots
arrange
whether to use arrangeGrob to put multiple plots in the same page
merge
wehther to merge multiple gates into the same panel when they share the same parent and projections
projections
a list of customized projections
strip.text
either "parent" (the parent population name) or "gate "(the gate name). The latter usually is used when merge is FALSE

Value

a ggcyto object

Examples

Run this code
library(flowCore)
data(GvHD)
fs <- GvHD[subset(pData(GvHD), Patient %in%5:7 & Visit %in% c(5:6))[["name"]]]

#1d- density plot
autoplot(fs, x = "SSC-H")

#2d plot: default geom_hex plot
autoplot(fs, x = 'FSC-H', y ='SSC-H')

#autplot for GatingSet
dataDir <- system.file("extdata",package="flowWorkspaceData")
gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE))
autoplot(gs, "CD3+")

#autplot for GatingHierarchy
gh <- gs[[1]]
autoplot(gh) # by default the strip.text shows the parent population

#To display the gate name
#autoplot(gh , strip.text = "gate")

Run the code above in your browser using DataLab