wasserCostFunction: wasserCostFunction

View source: R/wasserCostFunction.R

wasserCostFunctionR Documentation

wasserCostFunction

Description

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

Usage

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

# # 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]])))


HristoInouzhe/optimalFlow documentation built on April 23, 2023, 5:45 p.m.