GetFlowJoLabels | R Documentation |
Reads a FlowJo workspace file using the flowWorkspace library and returns a list with a matrix containing gating results and a vector with a label for each cell from a set of specified gates
GetFlowJoLabels(
files,
wspFile,
group = "All Samples",
cellTypes = NULL,
getData = FALSE,
...
)
files |
The FCS files of interest |
wspFile |
The FlowJo wsp file to read |
group |
The FlowJo group to parse. Default "All Samples". |
cellTypes |
Cell types to use for final labeling the cells. Should correspond with a subset of the gate names in FlowJo. |
getData |
If true, flowFrames are returned as well. |
... |
Extra arguments to pass to CytoML::flowjo_to_gatingset |
This function returns a list, which for every file contains 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 one label to each cell. If only one file is given, only one list is returned instead of a list of lists.
PlotPies
# Identify the files
fcs_file <- system.file("extdata", "68983.fcs", package = "FlowSOM")
wspFile <- system.file("extdata", "gating.wsp", package = "FlowSOM")
# Specify the cell types of interest for assigning one label per cell
cellTypes <- c("B cells",
"gd T cells", "CD4 T cells", "CD8 T cells",
"NK cells", "NK T cells")
# Parse the FlowJo workspace
gatingResult <- GetFlowJoLabels(fcs_file, wspFile,
cellTypes = cellTypes,
getData = TRUE)
# Check the number of cells assigned to each gate
colSums(gatingResult$matrix)
# Build a FlowSOM tree
flowSOM.res <- FlowSOM(gatingResult$flowFrame,
colsToUse = c(9, 12, 14:18),
nClus = 10,
seed = 1)
# Plot pies indicating the percentage of cell types present in the nodes
PlotPies(flowSOM.res,
gatingResult$manual,
backgroundValues = flowSOM.res$metaclustering)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.