This function will perform a normalization of flow cytometry data based on warping functions computed on high-density region landmarks for individual flow channels.
warpSet(x, stains, grouping = NULL, monwrd = TRUE, subsample=NULL, peakNr=NULL, clipRange=0.01, nbreaks=11, fres, bwFac=2, warpFuns=FALSE,target=NULL, ...)
flowSet
. x
to be
normalized. phenoData
slot of x
used as a grouping
factor. The within-group and between-group variance is computed and
a warning is issued in case the latter is bigger than the former,
indicating the likely removal of signal by the normalization
procedure. landmarkreg
. flowSet
by sub sampling for all density estimation steps and the calculation
of the warping functions. This can increase computation time for
large data sets, however it might reduce the accuracy of the density
estimates. To be used with care. min(x) - 0.01 *
diff(range(x))
.filterResultList
objects. This can
be used to speed up the process since the curv1Filter
step
can take quite some time.curv1Filter
for smoothing of the density estimate. flowSet
or a list of warping functions.flowSet
should be normalized. If NULL
, then the mean of the peaks is used.landmarkreg
. flowSet
if warpFuns
is FALSE
,
otherwise a list of warping functions. Additional inforamtion is
attached as the warping
attribute to the flowSet
in form
of a list. Normalization is achived by first identifying high-density regions
(landmarks) for each flowFrame
in the flowSet
for a single channel and subsequently by
computing warping functions for each flowFrame
that best align
these landmarks. This is based on the algorithm implemented in the
landmarkreg
function in the fda
package. An intermediate step classifies the high-density regions, see
landmarkMatrix
for details.
Please note that this normalization is on a channel-by-channel basis. Multiple channels are normalized in a loop.
data(ITN)
dat <- transform(ITN, "CD4"=asinh(CD4), "CD3"=asinh(CD3), "CD8"=asinh(CD8))
lg <- lymphGate(dat, channels=c("CD3", "SSC"),
preselection="CD4",scale=1.5)
dat <- Subset(dat, lg$n2gate)
datr <- warpSet(dat, "CD8", grouping="GroupID", monwrd=TRUE)
if(require(flowViz)){
d1 <- densityplot(~CD8, dat, main="original", filter=curv1Filter("CD8"))
d2 <- densityplot(~CD8, datr, main="normalized", filter=curv1Filter("CD8"))
plot(d1, split=c(1,1,2,1))
plot(d2, split=c(2,1,2,1), newpage=FALSE)
}
Run the code above in your browser using DataLab