R: Per-channel normalization based on landmark registration
gaussNorm
R Documentation
Per-channel normalization based on landmark registration
Description
This funciton normalizes a set of flow cytometry data samples by
identifying and aligning the high density regions (landmarks or peaks) for each channel.
The data of each channel is shifted in such a way that the identified high
density regions are moved to fixed locations called base landmarks.
A character vector of flow parameters in flowset to be
normalized.
max.lms
A numeric vector of the maximum number of base
landmarks to be used for normalizing each channel. If it has only one
value that will be used as the maximum number of base landmarks for
all the channels.
base.lms
A list of vector for each channel that contains the
base landmarks for normalizing that channel. If not specified the base
landmarks are computed from the set of extracted landmarks.
peak.density.thr
The peaks with density value less than
"peak.density.thr times maximum peak density" are discarded.
peak.distance.thr
The sequences of peaks that are located closer than
"peak.distance.thr times range of data" are identified. Then for
each sequence only one peak (the one with the highest intensity
value) is used as a landmark. In other words no two landmarks are
located closer than "peak.distance.thr times range of data" to each other.
debug
Logical. Forces the function to draw before and
after normalization plots for each sample. The plot of the i-th sample is stored in paste(fname, i) file.
fname
The pre- and post- normalization plots of the i-th sample is
stored in paste(fname, i) file if debug is set to
TRUE. If default value is used the plots are drawn on separate X11 windows
for each sample. In this case, the function waits for a user input to draw the plots
for the next sample.
Details
Normalization is archived in three phases: (i) identifying high-density regions
(landmarks) for each flowFrame
in the flowSet for a single channel; (ii) computing the best
matching between the landmarks and a set of fixed reference
landmarks for each channel called base landmarks; (iii) manipulating
the data of each channel in such a way that each landmark is moved to
its matching base landmark.
Please note that this normalization is on a channel-by-channel
basis. Multiple channels are normalized in a loop.
Value
A list with items flowset: normalized flowSet.
confidence: a confidence measure of the normalization procedure.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(flowStats)
Loading required package: flowCore
Loading required package: fda
Loading required package: splines
Loading required package: Matrix
Attaching package: 'Matrix'
The following object is masked from 'package:flowCore':
%&%
Attaching package: 'fda'
The following object is masked from 'package:graphics':
matplot
Loading required package: mvoutlier
Loading required package: sgeostat
sROC 0.1-2 loaded
Loading required package: cluster
Loading required package: flowWorkspace
Loading required package: flowViz
Loading required package: lattice
Loading required package: ncdfFlow
Loading required package: RcppArmadillo
Loading required package: BH
Loading required package: gridExtra
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/flowStats/gaussNorm.Rd_%03d_medium.png", width=480, height=480)
> ### Name: gaussNorm
> ### Title: Per-channel normalization based on landmark registration
> ### Aliases: gaussNorm
>
> ### ** Examples
>
>
> 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 <- gaussNorm(dat, "CD8")$flowset
Adjusting the distance between landmarks
...............
> 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)
+ }
>
>
>
>
>
>
> dev.off()
null device
1
>