compCytof {CATALYST} | R Documentation

## Compensate CyTOF data

### Description

Compensates a mass spectrometry based experiment using a provided spillover matrix & assuming a linear spillover in the experiment.

### Usage

    compCytof(x, y, ...)

    ## S4 method for signature 'flowFrame,matrix'
    compCytof(
      x,
      y,
      out_path = NULL,
      method = "flow",
      isotope_list = CATALYST::isotope_list
    )

    ## S4 method for signature 'flowSet,ANY'
    compCytof(x, y, out_path = NULL, method = "flow")

    ## S4 method for signature 'character,matrix'
    compCytof(x, y, out_path = NULL, method = "flow")

    ## S4 method for signature 'ANY,data.frame'
    compCytof(x, y, out_path = NULL, method = "flow")

### Arguments

`x` | a `flowFrame` OR a character string specifying the location of FCS files that should be compensates.
`y` | a spillover matrix.
`...` | optional arguments.
`out_path` | a character string. If specified, compensated FCS files will be generated in this location. If `x` is a character string, file names will be inherited from uncompensated FCS files and given extension "_comped".
`method` | `"flow"` or `"nnls"`.
`isotope_list` | named list. Used to validate the input spillover matrix. Names should be metals; list elements numeric vectors of their isotopes. See `isotope_list` for the list of isotopes used by default.

### Details

If the spillover matrix (SM) does not contain the same set of columns as the input experiment, it will be adapted according to the following rules:

1. columns present in the SM but not in the input data will be removed from it

2. non-metal columns present in the input but not in the SM will be added such that they do neither receive nor cause spill

3. metal columns that have the same mass as a channel present in the SM will receive (but not emit) spillover according to that channel

4. if an added channel could potentially receive spillover (as it has +/-1M or +16M of, or is of the same metal type as another channel measured), a warning will be issued as there could be spillover interactions that have been missed and may lead to faulty compensation

### Value

Compensates the input `flowFrame` or, if `x` is a character string, all FCS files in the specified location. If `out_path=NULL` (the default), returns a `flowFrame` containing the compensated data. Otherwise, compensated data will be written to the specified location as FCS 3.0 standard files.

### Author(s)

Helena Lucia Crowell helena.crowell@uzh.ch and Vito Zanotelli vito.zanotelli@uzh.ch

### Examples

    # get single-stained control samples
    data(ss_exp)

    # specify mass channels stained for
    bc_ms <- c(139, 141:156, 158:176)

    # debarcode
    re <- assignPrelim(x = ss_exp, y = bc_ms)
    re <- estCutoffs(x = re)
    re <- applyCutoffs(x = re)
    spillMat <- computeSpillmat(x = re)
    compCytof(x = ss_exp, y = spillMat)

[Package CATALYST version 1.10.3 Index]