AddAnnotation {FlowSOM} | R Documentation

## AddAnnotation

### Description

Add annotation to a FlowSOM plot

### Usage

    AddAnnotation(
      p,
      fsom,
      layout = fsom$MST$l,
      cl = NULL,
      mcl = NULL,
      clCustomLabels = NULL,
      mclCustomLabels = NULL,
      hjust = 0.5,
      ...
    )

### Arguments

`p` | Plot to add annotation to. When using type = "stars", please use plot = FALSE in `PlotFlowSOM`.
`fsom` | FlowSOM object that goes with the plot
`layout` | Layout to use. Default fsom$MST$l
`cl` | Clusters to annotate. If cl = "all", all clusters will be annotated
`mcl` | Metaclusters to annotate. If mcl = "all", all metaclusters will be annotated
`clCustomLabels` | Cluster labels to use for annotation
`mclCustomLabels` | Metacluster labels to use for annotation
`hjust` | Label adjustment. Default = 0.5
`...` | Arguments passed to geom_text_repel

### Value

The updated plot

### Examples

    #' # Identify the files
    fcs <- flowCore::read.FCS(system.file("extdata", "68983.fcs",
                                          package = "FlowSOM"))
    # Build a FlowSOM object
    flowSOM.res <- FlowSOM(fcs,
                           scale = TRUE,
                           compensate = TRUE,
                           transform = TRUE,
                           toTransform = 8:18,
                           colsToUse = c(9, 12, 14:18),
                           nClus = 10,
                           seed = 1)

    p <- PlotStars(flowSOM.res, backgroundValues = flowSOM.res$metaclustering,
                   list_insteadof_ggarrange = TRUE)
    AddAnnotation(p, flowSOM.res, cl = c(1, 2), mcl = c(3, 4))

[Package FlowSOM version 2.2.0 Index]