ReadInput {FlowSOM} | R Documentation

## Read fcs-files or flowframes

### Description

Take some input and return FlowSOM object containing a matrix with the preprocessed data (compensated, transformed, scaled)

### Usage

    ReadInput(
      input,
      pattern = ".fcs",
      compensate = FALSE,
      spillover = NULL,
      transform = FALSE,
      toTransform = NULL,
      transformFunction = flowCore::logicleTransform(),
      transformList = NULL,
      scale = FALSE,
      scaled.center = TRUE,
      scaled.scale = TRUE,
      silent = FALSE
    )

### Arguments

`input` | a flowFrame, a flowSet or an array of paths to files or directories
`pattern` | if input is an array of file- or directorynames, select only files containing pattern
`compensate` | logical, does the data need to be compensated
`spillover` | spillover matrix to compensate with If `NULL` and compensate = `TRUE`, we will look for `$SPILL` description in fcs file.
`transform` | logical, does the data need to be transformed
`toTransform` | column names or indices that need to be transformed. Will be ignored if `transformList` is given. If `NULL` and transform = `TRUE`, column names of `$SPILL` description in fcs file will be used.
`transformFunction` | Defaults to logicleTransform()
`transformList` | transformList to apply on the samples.
`scale` | logical, does the data needs to be rescaled
`scaled.center` | see `scale`
`scaled.scale` | see `scale`
`silent` | if `TRUE`, no progress updates will be printed. Default = `FALSE`

### Value

FlowSOM object containing the data, which can be used as input for the BuildSOM function

### See Also

`scale`, `BuildSOM`

### Examples

    # Read from file
    fileName <- system.file("extdata", "68983.fcs", package = "FlowSOM")
    flowSOM.res <- ReadInput(fileName, compensate = TRUE, transform = TRUE,
                             scale = TRUE)

    # Or read from flowFrame object
    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 <- ReadInput(ff, scale = TRUE)

    # Build the self-organizing map and the minimal spanning tree
    flowSOM.res <- BuildSOM(flowSOM.res, colsToUse = c(9, 12, 14:18))
    flowSOM.res <- BuildMST(flowSOM.res)

    # Apply metaclustering
    metacl <- MetaClustering(flowSOM.res$map$codes,
                             "metaClustering_consensus", max = 10)

    # Get metaclustering per cell
    flowSOM.clustering <- metacl[flowSOM.res$map$mapping[, 1]]

[Package FlowSOM version 2.2.0 Index]