wasserCostFunction: wasserCostFunction

Description Usage Arguments Value Examples

View source: R/wasserCostFunction.R

Description

Calculates the similarity distance between elements j and i of a list of partitions.

Usage

1
wasserCostFunction(j, i, cytometries, equal.weights = FALSE)

Arguments

j

An entry of the list of partitions.

i

An entry of the list of partitions.

cytometries

The list of partitions.

equal.weights

If True, weights assigned to every cluster in a partion are uniform (1/number of clusters) when calculating the similarity distance. If False, weights assigned to clusters are the proportions of points in every cluster compared to the total amount of points in the partition.

Value

A double giving the value of the similarity distance.

Examples

1
2
3
4
5
6
7
8
9
# # We construct a simple database selecting only some of the Cytometries and some cell types for simplicity and for a better visualisation.
database <- buildDatabase(
  dataset_names = paste0('Cytometry', c(2:5, 7:9, 12:17, 19, 21)),
    population_ids = c('Monocytes', 'CD4+CD8-', 'Mature SIg Kappa', 'TCRgd-'))

templates.optimalFlow <- optimalFlowTemplates(database = database, templates.number = 5,
cl.paral = 1)
print(wasserCostFunction(1, 2, list(templates.optimalFlow$database.elliptical[[1]],
 templates.optimalFlow$database.elliptical[[2]])))

optimalFlow documentation built on Nov. 8, 2020, 6:59 p.m.