Skip to contents

Aggregate multiple flow frames in order to analyze them simultaneously. A new FF, which contains about cTotal cells, with ceiling(cTotal/nFiles) cells from each file. Two new columns are added: a column indicating the original file by index, and a noisy version of this, for better plotting opportunities, This function is based on PeacoQC::AggregateFlowframes() where file names inputs have been replaced by a flowSet input.

Usage

aggregateAndSample(
  fs,
  nTotalEvents,
  seed = NULL,
  channels = NULL,
  writeOutput = FALSE,
  outputFile = "aggregate.fcs",
  keepOrder = FALSE
)

Arguments

fs

a flowCore::flowset

nTotalEvents

Total number of cells to select from the input flow frames

seed

seed to be set before sampling for reproducibility. Default NULL does not set any seed.

channels

Channels/markers to keep in the aggregate. Default NULL takes all channels of the first file.

writeOutput

Whether to write the resulting flowframe to a file. Default FALSE

outputFile

Full path to output file. Default "aggregate.fcs"

keepOrder

If TRUE, the random subsample will be ordered in the same way as they were originally ordered in the file. Default = FALSE.

Value

returns a new flowCore::flowFrame

Examples


data(OMIP021Samples)

nCells <- 1000
agg <- aggregateAndSample(
    fs = OMIP021Samples,
    nTotalEvents = nCells)