First of all, we want to see if the fixed estimateLogicle can achive the same transformation result as fasinh used in flowJo workspace

inverseTrans <- getTransformations(gh, inverse = T)[[1]] 
chnl <- '(Yb170)Dd'
data <- getData(gh)
densityplot(~., data, channels = chnl, main = "fasinh")

raw <- transform(data, transformList(chnl, inverseTrans))
densityplot(~., raw, channels = chnl, main = "raw")

lgcl <- estimateLogicle(raw, channels = chnl)
densityplot(~., transform(raw, lgcl), channels = chnl, main = "logicle")

Now we’d like to know if these transformation is good enough for the density based gating algorithm

DNA (first gate)

plotGate(gh, checkName = F, node, raw.scale = F)

densityplot(gh, node)

Looks like both density is well spread-out and two mindensity gates (with appropriate gate_range) may work.

Live gate

plotGate(gh, node, checkName = F, raw.scale = F)

densityplot(gh, node)

tailGate on cell_length and mindensity on La139 should work.

lymphocytes gate

plotGate(gh, node, checkName = F, raw.scale = F)

densityplot(gh, node)

tailGate and mindensity with some smoothing (adjust) may help, e.g.

densityplot(gh, node, darg = list(adjust = 5))

CD3+ gate:

plotGate(gh, node, checkName = F, raw.scale = F)

densityplot(gh, node)

The same as above.

Cytokines

nodes <- getChildren(gh, "CD4", path = "auto")[16:19]
nodes
## [1] "CD4/IFNg" "CD4/IL2"  "CD4/IL4"  "CD4/IL10"
parent <- getData(gh, "CD4")

chnls <- pData(parameters(parent))[["name"]][c(38, 34, 30, 23)]

plotGate(gh, checkName = F, nodes, raw.scale = F)

densityplot(~., parent , channels = chnls)

With some smoothing and the second peak as reference peak, tailgate seems to be able to pick the right spot to cut. e.g.

tailgate(parent, chnls[1], num_peaks = 2, ref_peak = 2, adjust = 2)
## Rectangular gate '' with dimensions:
##   (Yb170)Dd: (8750.37578538113,Inf)
tailgate(parent, chnls[3], num_peaks = 2, ref_peak = 2, adjust = 3)
## Rectangular gate '' with dimensions:
##   (Dy162)Dd: (5454.68480376081,Inf)