NewData: NewData

View source: R/3_buildMST.R

NewDataR Documentation

NewData

Description

Map new data to a FlowSOM grid

Usage

NewData(
  fsom,
  input,
  madAllowed = 4,
  compensate = NULL,
  spillover = NULL,
  transform = NULL,
  toTransform = NULL,
  transformFunction = NULL,
  transformList = NULL,
  scale = NULL,
  scaled.center = NULL,
  scaled.scale = NULL,
  silent = FALSE
)

Arguments

fsom

FlowSOM object

input

A flowFrame, a flowSet or an array of paths to files or directories

madAllowed

A warning is generated if the distance of the new data points to their closest cluster center is too big. This is computed based on the typical distance of the points from the original dataset assigned to that cluster, the threshold being set to median + madAllowed * MAD. Default is 4.

compensate

logical, does the data need to be compensated. If NULL, the same value as in the original FlowSOM call will be used.

spillover

spillover matrix to compensate with. If NULL, the same value as in the original FlowSOM call will be used.

transform

logical, does the data need to be transformed. If NULL, the same value as in the original FlowSOM call will be used.

toTransform

column names or indices that need to be transformed. If NULL, the same value as in the original FlowSOM call will be used.

transformFunction

If NULL, the same value as in the original FlowSOM call will be used.

transformList

If NULL, the same value as in the original FlowSOM call will be used.

scale

Logical, does the data needs to be rescaled. If NULL, the same value as in the original FlowSOM call will be used.

scaled.center

See scale. If NULL, the same value as in the original FlowSOM call will be used.

scaled.scale

See scale. If NULL, the same value as in the original FlowSOM call will be used.

silent

Logical. If TRUE, print progress messages. Default = FALSE.

Details

New data is mapped to an existing FlowSOM object. The input is similar to the ReadInput function. A new FlowSOM object is created, with the same grid, but a new mapping, node sizes and mean values. The same preprocessing steps (compensation, transformation and scaling) will happen to this file as was specified in the original FlowSOM call. The scaling parameters from the original grid will be used.

Value

A new FlowSOM object

See Also

FlowSOMSubset if you want to get a subset of the current data instead of a new dataset

Examples

 # Build FlowSom result
 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()))
   flowSOM.res <- FlowSOM(ff[1:1000, ], 
                          scale = TRUE, 
                          colsToUse = c(9, 12, 14:18),
                          nClus = 10)
   
   # Map new data
   fSOM2 <- NewData(flowSOM.res, ff[1001:2000, ])


saeyslab/FlowSOM documentation built on April 15, 2024, 1:03 p.m.