# Read the flowFrame
fileName <- system.file("extdata","lymphocytes.fcs",package="FlowSOM")
ff <- flowCore::read.FCS(fileName)
ff_c <- flowCore::compensate(ff,flowCore::description(ff)$SPILL)
flowCore::colnames(ff_c)[8:18] <- paste("Comp-",
flowCore::colnames(ff_c)[8:18],
sep="")
# Specify the gating file and the gates of interest
gatingFile <- system.file("extdata","manualGating.xml",
package="FlowSOM")
gateIDs <- c( "B cells"=8,
"ab T cells"=10,
"yd T cells"=15,
"NK cells"=5,
"NKT cells"=6)
cellTypes <- c("B cells","ab T cells","yd T cells",
"NK cells","NKT cells")
gatingResult <- ProcessGatingML(ff_c, gatingFile, gateIDs, cellTypes)
# Build a FlowSOM tree
flowSOM.res <- FlowSOM(ff_c,compensate=FALSE,transform=TRUE,
toTransform=8:18,colsToUse=c(9,12,14:18),nClus=10)
# Plot pies indicating the percentage of cell types present in the nodes
PlotPies(flowSOM.res[[1]],gatingResult$manual)
Run the code above in your browser using DataLab