PlotPies {FlowSOM} | R Documentation

## PlotPies

### Description

Plot comparison with other clustering

### Usage

    PlotPies(
      fsom,
      cellTypes,
      colorPalette = grDevices::colorRampPalette(c("white", "#00007F", "blue", "#007FFF",
        "cyan", "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000")),
      ...
    )

### Arguments

`fsom` | FlowSOM object, as generated by `FlowSOM`
`cellTypes` | Array of factors indicating the celltypes
`colorPalette` | Color palette to use.
`...` | Additional arguments to pass to `PlotFlowSOM`

### Details

Plot FlowSOM grid or tree, with pies indicating another clustering or manual gating result

### Value

Ggplot plot

### See Also

`PlotStars`, `PlotVariable`, `PlotFlowSOM`, `PlotLabels`, `PlotNumbers`, `PlotMarker`, `QueryStarPlot`, `PlotSD`

### Examples

    # Identify the files
    fcs_file <- system.file("extdata", "68983.fcs", package = "FlowSOM")
    wsp_file <- 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, wsp_file,
                                    cellTypes = cellTypes)

    # Check the number of cells assigned to each gate
    colSums(gatingResult$matrix)

    # Build a FlowSOM tree
    flowSOM.res <- FlowSOM(fcs_file,
                           scale = TRUE,
                           compensate = TRUE,
                           transform = TRUE,
                           toTransform = 8:18,
                           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)

[Package FlowSOM version 2.2.0 Index]