PlotFlowSOM {FlowSOM}R Documentation

PlotFlowSOM

Description

Base layer to plot a FlowSOM result

Usage

PlotFlowSOM(
  fsom,
  view = "MST",
  nodeSizes = fsom$map$pctgs,
  maxNodeSize = 1,
  refNodeSize = max(nodeSizes),
  equalNodeSize = FALSE,
  backgroundValues = NULL,
  backgroundColors = NULL,
  backgroundLim = NULL,
  title = NULL
)

Arguments

fsom

FlowSOM object, as created by FlowSOM

view

Preferred view, options: "MST", "grid" or "matrix" with a matrix/dataframe consisting of coordinates given in coords. Default = "MST"

nodeSizes

A vector containing nodesizes. These will automatically be scaled between 0 and maxNodeSize and transformed with a sqrt. Default = fsom$MST$sizes

maxNodeSize

Determines the maximum nodesize. Default is 1.

refNodeSize

Reference for nodesize against which the nodeSizes will be scaled. Default = max(nodeSizes)

equalNodeSize

If TRUE, the nodes will be equal to maxNodeSize. If FALSE (default), the nodes will be scaled to the number of cells in each cluster

backgroundValues

Values to be used for background coloring, either numerical values or something that can be made into a factor (e.g. a clustering)

backgroundColors

Colorpalette to be used for the background coloring. Can be either a function or an array specifying colors.

backgroundLim

Only used when backgroundValues are numerical. Defaults to min and max of the backgroundValues.

title

Title of the plot

Details

Base layer of the FlowSOM plot, where you can choose layout (MST, grid or coordinates of your own choosing), background colors and node size. Can then be extended by e.g. AddStars, AddLabels, AddPies, ...

Value

A ggplot object with the base layer of a FlowSOM plot

See Also

PlotStars, PlotVariable, PlotMarker, PlotLabels, PlotNumbers, PlotPies, QueryStarPlot, PlotSD

Examples

# Locate file on file system
fcs_file <- system.file("extdata", "68983.fcs", package = "FlowSOM")

# Build FlowSOM model
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 with background coloring
PlotFlowSOM(flowSOM.res,
            backgroundValues = flowSOM.res$metaclustering)

# Own layout
mfis <- GetClusterMFIs(flowSOM.res)[,GetChannels(flowSOM.res, c("CD3", "CD4"))]
PlotFlowSOM(flowSOM.res,
            view = mfis,
            maxNodeSize = 0.1,
            backgroundValues = flowSOM.res$metaclustering)
            
# Adapted node sizes
PlotFlowSOM(flowSOM.res,
              nodeSizes = 1:100,
              view = "grid")


[Package FlowSOM version 2.0.0 Index]