View source: R/5_plotFunctions.R
PlotFlowSOM | 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,
backgroundSize = 1.5,
equalBackgroundSize = FALSE,
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. Default = "MST" |
nodeSizes |
A vector containing node sizes. These will automatically be scaled between 0 and maxNodeSize and transformed with a sqrt. Default = fsom$MST$sizes |
maxNodeSize |
Determines the maximum node size. Default is 1. |
refNodeSize |
Reference for node size 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 |
Color palette to be used for the background coloring. Can be either a function or an array specifying colors. |
backgroundSize |
The size of the background. Will be multiplied by the size of the nodes. |
equalBackgroundSize |
If you want the background sizes to be the same size. |
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) %>%
AddLabels(seq(100))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.