geom_overlay: Overlay a population on an existing ggcyto plot analogous to...

Description Usage Arguments Value Examples

View source: R/geom_overlay.R

Description

It is useful for "backgating" plots.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
geom_overlay(data, ...)

## Default S3 method:
geom_overlay(data, ...)

## S3 method for class 'character'
geom_overlay(data, ...)

## S3 method for class 'ncdfFlowList'
geom_overlay(data, ...)

## S3 method for class 'flowSet'
geom_overlay(data, ...)

## S3 method for class 'flowFrame'
geom_overlay(data, ...)

Arguments

data

a filter (Currently only rectangleGate (1d or 2d), polygonGate, ellipsoidGate are supported.) or a list of these gates or filterList or character specifying a gated cell population in the GatingSet

...

other arguments mapping, The mapping aesthetic mapping data a polygonGate fill polygonGate is not filled by default colour default is red pd pData (data.frame) that has rownames represents the sample names used as key to be merged with filterList

Value

a geom_overlay layer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(ggcyto)
dataDir <- system.file("extdata",package="flowWorkspaceData")
gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE))
p <- autoplot(gs, "CD3+")

# add a flowSet as the overlay
fs <- getData(gs, "DPT")
p + geom_overlay(data = fs, size = 0.3, alpha = 0.7)

# add overlay layer by gate name
p + geom_overlay(data = "DNT", size = 0.3, alpha = 0.7)

#add overlay for 1d densityplot
p <- ggcyto(gs, aes(x = CD4), subset = "CD3+") + geom_density(aes(y = ..count..))
p + geom_overlay("DNT", aes(y = ..count..), fill = "red")

ggcyto documentation built on Jan. 15, 2019, 6:01 p.m.