# Read from file, build self-organizing map and minimal spanning tree
fileName <- system.file("extdata","lymphocytes.fcs",package="FlowSOM")
flowSOM_res <- FlowSOM(fileName, compensate=TRUE,transform=TRUE,
scale=TRUE,colsToUse=c(9,12,14:18),nClus=7)
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="")
# Get the manually gated labels using a gatingML file
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)
# 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