ProcessGatingML: Process a gatingML file

Description Usage Arguments Value See Also Examples

View source: R/0_FlowSOM.R

Description

Reads a gatingML file using the flowUtils library and returns a list with a matrix containing filtering results for each specified gate and a vector with a label for each cell

Usage

1
ProcessGatingML(flowFrame, gatingFile, gateIDs, cellTypes, silent = FALSE)

Arguments

flowFrame

The flowFrame to apply the gating on

gatingFile

The gatingML file to read

gateIDs

Named vector containing ids to extract from the gatingML file to use in the matrix

cellTypes

Cell types to use for labeling the cells. Should be a subset of the names of the gateIDs

silent

If FALSE, show messages of which gates are being processed

Value

This function returns a list in which the first element ("matrix") is a matrix containing filtering results for each specified gate and the second element ("manual") is a vector which assigns a label to each cell

See Also

PlotPies

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
   # 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)

FlowSOM documentation built on May 31, 2017, 11:26 a.m.