TestOutliers: Test if any cells are too far from their cluster centers

Description Usage Arguments Value See Also Examples

View source: R/3_buildMST.R

Description

For every cluster, the distance from the cells to the cluster centers is used to label cells which deviate too far as outliers. The threshold is chosen as the median distance + mad_allowed times the median absolute deviation of the distances.

Usage

1
2
3
4
5
6
7
TestOutliers(
  fsom,
  mad_allowed = 4,
  fsom_reference = NULL,
  plot = FALSE,
  img_file = "testOutliers.pdf"
)

Arguments

fsom

FlowSOM object

mad_allowed

Number of median absolute deviations allowed. Default = 4.

fsom_reference

FlowSOM object to use as reference. If NULL (default), the original fsom object is used.

plot

Should a plot be generated showing the distribution of the distances. Default is FALSE.

img_file

If plot is TRUE, the output will be written to this file. Default is "testOutliers.pdf"

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 # Build FlowSom result
 fileName <- system.file("extdata", "68983.fcs", package="FlowSOM")
 ff <- flowCore::read.FCS(fileName)
 flowSOM.res <- FlowSOM(ff,
                        compensate = TRUE, transform = TRUE, scale = TRUE,
                        colsToUse = c(9, 12, 14:18),
                        maxMeta = 10)
   
 # Map new data
 outlier_report <- TestOutliers(flowSOM.res)

FlowSOM documentation built on Nov. 8, 2020, 6:40 p.m.