## Example 1: calling up gpaSet directly
data(ITN)
data(BackGating)
tl <- transformList(colnames(ITN)[3:7], asinh, transformationId="asinh")
dat <- transform(ITN, tl)
xy = c("FSC", "SSC")
bgChannels = c("CD8", "CD4", "CD3")
## bg <- flowStats:::backGating(dat, xy=xy, channels=bgChannels)
## using pre-generated backgating results: BackGating
s <- gpaSet(dat, params=xy, bgChannels=bgChannels, bg=BackGating)
if(require(flowViz)) {
d1 <- densityplot(~., s, channels=c("FSC", "SSC"),
layout=c(2,1), main="After GPA using bg")
d2 <- xyplot(FSC ~ SSC, as(s, "flowFrame"),
channels=c("FSC", "SSC"), main="All flowFrames")
plot(d1)
plot(d2)
}
## view "GPA" attribute
attr(s, "GPA")
## Example 2: using work flow and normalization objects
data(ITN)
ITN <- ITN[1:8, ]
wf <- workFlow(ITN)
tl <- transformList(colnames(ITN)[3:7], asinh, transformationId="asinh")
add(wf, tl)
x <- Data(wf[["asinh"]])
## normalize 'FSC' and 'SSC' channels
norm <- normalization(normFun=function(x, parameters, ...)
gpaSet(x, parameters, ...),
parameters = c("FSC", "SSC"),
arguments=list(bgChannels=c("CD8", "CD3"),
register="backgating"),
normalizationId="Procrustes")
add(wf, norm2, parent="asinh")
s <- Data(wf[["Procrustes"]])
if(require(flowViz)) {
d1 <- densityplot(~., s, channels=c("FSC", "SSC"),
layout=c(2,1), main="After GPA using bg")
d2 <- xyplot(FSC ~ SSC, as(s, "flowFrame"),
channels=c("FSC", "SSC"), main="All flowFrames")
plot(d1)
plot(d2)
} ## end of dontrun
Run the code above in your browser using DataLab