PlotFlowSOM {FlowSOM} | R Documentation |
Base layer to plot a FlowSOM result
PlotFlowSOM( fsom, view = "MST", nodeSizes = fsom$map$pctgs, maxNodeSize = 1, refNodeSize = max(nodeSizes), equalNodeSize = FALSE, backgroundValues = NULL, backgroundColors = NULL, backgroundLim = NULL, title = NULL )
fsom |
FlowSOM object, as created by |
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 |
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 |
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
, ...
A ggplot object with the base layer of a FlowSOM plot
PlotStars
, PlotVariable
,
PlotMarker
, PlotLabels
,
PlotNumbers
, PlotPies
,
QueryStarPlot
, PlotSD
# 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")