emdEvaluation: emdEvaluation

View source: R/evaluation.R

emdEvaluationR Documentation

emdEvaluation

Description

Evaluate how much files differ by computing the maximum Earth Movers Distance for all markers and cellTypes.

Usage

emdEvaluation(
  files,
  channels,
  transformList = NULL,
  prefix = "^Norm_",
  manual = NULL,
  binSize = 0.1,
  minRange = -100,
  maxRange = 100,
  return_all = FALSE,
  manualThreshold = 2
)

Arguments

files

Full paths of to the fcs files of the control samples.

channels

Channels to evaluate (corresponding with the column names of the flow frame)

transformList

Transformation list to pass to the flowCore transform function. Default NULL

prefix

Prefix present in the files, which will be removed to match the manual list.

manual

A list which contains for every file a factor array. These arrays contain a cell label for every cell in the files. All arrays should have the same levels. Default = NULL, all cells are evaluated together.

binSize

Binsize to approximate distribution. Default = 0.1.

minRange

Minimum to approximate distribution. Default = -100.

maxRange

Maximum to approximate distribution. Default = 100.

return_all

If TRUE, distributions and pairwise distances are returned as well. Default = FALSE.

manualThreshold

Minimum number of cells to calculate the EMD. Default = 2

Value

A matrix in which the rows represent the cell types, the columns reprents the markers and the values represent the maximal earth movers distances for the distributions between all files

Examples

   # Describe file names
   dir <- system.file("extdata",package="CytoNorm")
   fileNames <- c("Gates_PTLG021_Unstim_Control_1.fcs",
                   "Gates_PTLG028_Unstim_Control_1.fcs")
   labels <- c("PTLG021","PTLG028")
   ff <- flowCore::read.FCS(file.path(dir,fileNames[1]))
   channelsToNormalize <- flowCore::colnames(ff)[c(10, 11, 14, 16:35, 37, 39:51)]

   # Build transform list
   transformList <- flowCore::transformList(channelsToNormalize,
                                            cytofTransform)
   emdEvaluation(file.path(dir,fileNames),
                 transformList = transformList,
                 channelsToNormalize)


saeyslab/CytoNorm documentation built on Nov. 2, 2024, 12:39 p.m.