PlotFileScatters {FlowSOM}R Documentation

PlotFileScatters

Description

Make a scatter plot per channel for all provided files

Usage

PlotFileScatters(
  input,
  channels = NULL,
  yMargin = NULL,
  yLabel = c("marker"),
  quantiles = NULL,
  names = NULL,
  groups = NULL,
  color = NULL,
  legend = FALSE,
  maxPoints = 50000,
  ncol = NULL,
  nrow = NULL,
  silent = FALSE,
  plotFile = "FileScatters.png"
)

Arguments

input

Either a flowSet, a flowFrame (output from the AggregateFlowFrames function) or a vector of paths pointing to fcs files

channels

Vector of channels or markers that need to be plotted, if NULL (default), all channels from the input will be plotted

yMargin

Optional parameter to specify the margins of the y-axis

yLabel

Determines the label of the y-axis. Can be "marker" and\or "channel". Default = "marker".

quantiles

If provided (default NULL), a numeric vector with values between 0 and 1. These quantiles are indicated on the plot

names

Optional parameter to provide filenames. If NULL (default), the filenames will be numbers. Duplicated filenames will be made unique.

groups

Optional parameter to specify groups of files, should have the same length as the input. Id NULL (default), all files will be plotted in the same color

color

Optional parameter to provide colors. Should have the same lengths as the number of groups (or 1 if groups is NULL)

legend

Logical parameter to specify whether the group levels should be displayed. Default is FALSE

maxPoints

Total number of data points that will be plotted per channel, default is 50000

ncol

Number of columns in the final plot, optional

nrow

Number of rows in the final plot, optional

silent

If FALSE, prints an update every time it starts processing a new file. Default = FALSE.

plotFile

Path to png file, default is "FileScatters.png". If NULL, the output will be a list of ggplots

Value

List of ggplot objects if plot is FALSE, otherwise filePlot with plot is created.

Examples

# Preprocessing
fileName <- system.file("extdata", "68983.fcs", package = "FlowSOM")
ff <- flowCore::read.FCS(fileName)
ff <- flowCore::compensate(ff, flowCore::keyword(ff)[["SPILL"]])
ff <- flowCore::transform(ff,
         flowCore::transformList(colnames(flowCore::keyword(ff)[["SPILL"]]),
                                flowCore::logicleTransform()))

flowCore::write.FCS(ff[1:1000, ], file = "ff_tmp1.fcs")
flowCore::write.FCS(ff[1001:2000, ], file = "ff_tmp2.fcs")
flowCore::write.FCS(ff[2001:3000, ], file = "ff_tmp3.fcs")
 
# Make plot
PlotFileScatters(input = c("ff_tmp1.fcs", "ff_tmp2.fcs", "ff_tmp3.fcs"),
                 channels = c("Pacific Blue-A", 
                              "Alexa Fluor 700-A", 
                              "PE-Cy7-A"), 
                 maxPoints = 1000)


[Package FlowSOM version 2.2.0 Index]