Skip to contents

This function prunes a gating tree by applying various statistical thresholds to the nodes based on entropy, enrichment, and average proportion metrics. Nodes that do not meet the specified criteria are pruned from the tree. Additionally, p-values are adjusted for multiple comparisons.

Usage

PruneGatingTree(
  x,
  max_entropy = 0.9,
  min_enrichment = 0.1,
  min_average_proportion = 0.001,
  p_adjust_method = "BY",
  theta = 0
)

Arguments

x

An object, expected to be of class 'FlowObject', containing gating tree data and metadata.

max_entropy

Maximum allowable entropy for a node to remain in the gating tree.

min_enrichment

Minimum enrichment required for a node to remain in the gating tree.

min_average_proportion

Minimum average proportion of cells required for a node to remain in the gating tree.

p_adjust_method

A character string indicating the method to be used for adjusting p-values for multiple comparisons. Defaults to 'BY' (Benjamini-Yekutieli).

theta

A numeric threshold added to the enrichment values for each node. This threshold is used to enforce a criterion where only nodes showing a steady increase in enrichment, greater than this threshold, can be considered for retention in the pruned gating tree. The default is zero.

Value

Returns the modified object 'x' with the gating tree pruned according to the specified parameters. The function also attaches the pruned gating tree and a data frame containing node statistics to the object.

Details

The function first identifies nodes that meet specified entropy and enrichment criteria, computes statistical metrics for these nodes, and then prunes the gating tree based on these metrics and average proportion criteria. Adjusted p-values are calculated to account for multiple testing.

Examples

if (FALSE) { # \dontrun{
  updated_object <- PruneGatingTree(x, min_enrichment = 0.5,max_entropy =0.5)
} # }