norm2Filter-class {flowStats} | R Documentation

## Class "norm2Filter"

### Description

Class and constructors for a `filter` that fits a bivariate normal distribution to a data set of paired values and selects data points according to their standard deviation from the fitted distribution.

### Usage

    norm2Filter(x, y, method="covMcd", scale.factor=1, n=50000,
    filterId="defaultNorm2Filter")

### Arguments

`x, y` | Characters giving the names of the measurement parameter on which the filter is supposed to work on. `y` can be missing in which case `x` is expected to be a character vector of length 2 or a list of characters.
`filterId` | An optional parameter that sets the `filterId` slot of this filter. The object can later be identified by this name.
`scale.factor, n` | Numerics of length 1, used to set the `scale.factor` and n slots of the object.
`method` | Character in `covMcd` or `cov.rob`, used to set the `method` slot of the object.

### Details

The filter fits a bivariate normal distribution to the data and selects all events within the Mahalanobis distance multiplied by the `scale.factor` argument. The constructor `norm2Filter` is a convenience function for object instantiation. Evaluating a `curv2Filter` results in an object of class `logicalFilterResult`. Accordingly, `norm2Filters` can be used to subset and to split flow cytometry data sets.

### Value

Returns a `norm2Filter` object for use in filtering `flowFrame`s or other flow cytometry objects.

### Slots

`method`

  One of `covMcd` or `cov.rob` defining method used for computation of covariance matrix.

`scale.factor`

  Numeric vector giving factor of standard deviations used for data selection (all points within `scalefac` standard deviations are selected).

`n`

  Object of class `"numeric"`, the number of events used to compute the covariance matrix of the bivariate distribution.

`filterId`

  Object of class `"character"` referencing the filter.

`parameters`

  Object of class `"ANY"` describing the parameters used to filter the `flowFrame` or `flowSet`.

### Extends

Class `"parameterFilter"`, directly.

Class `"concreteFilter"`, by class `parameterFilter`, distance 2.

Class `"filter"`, by class `parameterFilter`, distance 3.

### Objects from the Class

Objects can be created by calls of the form `new("norm2Filter", ...)` or using the constructor `norm2Filter`. The constructor is the recommended way.

### Methods

%in%

  `signature(x = "flowFrame", table = "norm2Filter")`: The workhorse used to evaluate the filter on data. This is usually not called directly by the user, but internally by calls to the `filter` methods.

show

  `signature(object = "norm2Filter")`: Print information about the filter.

### Note

See the documentation in the `flowViz` package for plotting of `norm2Filters`.

### Author(s)

F. Hahne

### See Also

`cov.rob`, `CovMcd`, `filter` for evaluation of `norm2Filters` and `split` and `Subset`for splitting and subsetting of flow cytometry data sets based on that.

### Examples

    library(flowCore)
    ## Loading example data
    dat <- read.FCS(system.file("extdata","0877408774.B08",
    package="flowCore"))

    ## Create directly. Most likely from a command line
    norm2Filter("FSC-H", "SSC-H", filterId="myCurv2Filter")

    ## To facilitate programmatic construction we also have the following
    n2f <- norm2Filter(filterId="myNorm2Filter", x=list("FSC-H", "SSC-H"),
    scale.factor=2)
    n2f <- norm2Filter(filterId="myNorm2Filter", x=c("FSC-H", "SSC-H"),
    scale.factor=2)

    ## Filtering using norm2Filter
    fres <- filter(dat, n2f)
    fres
    summary(fres)

    ## The result of norm2 filtering is a logical subset
    Subset(dat, fres)

    ## We can also split, in which case we get those events in and those
    ## not in the gate as separate populations
    split(dat, fres)

[Package flowStats version 4.4.0 Index]