Skip to contents

This function processes gating decisions based on given markers and their states, managing data from a root node to determine optimal gating paths based on entropy and enrichment calculations. It handles decision-making at each node of a gating tree, determining whether to continue subdividing or to terminate based on statistical thresholds and data availability.

Usage

general_node_rule(
  currentNode,
  root_data,
  sampledef,
  neg_gate,
  expr_group,
  ctrl_group,
  total_cell_per_file,
  usedmarkers,
  min_cell_num = 25
)

Arguments

currentNode

A list representing the current node in the gating tree, including markers used, current node indices, and gating history.

root_data

A data frame containing the complete dataset for analysis.

sampledef

A data frame specifying sample definitions and group assignments.

neg_gate

A list containing thresholds for negative gating decisions.

expr_group

The name of the experimental group within `sampledef`.

ctrl_group

The name of the control group within `sampledef`.

total_cell_per_file

A data frame mapping file names to total cell counts per file.

usedmarkers

A vector of markers that have already been used in previous steps of gating.

available_markers

A character vector of markers that are still available for gating.

Value

A list structure describing the outcomes at the current node, including any child nodes created, or indicators if the node processing leads to termination.

Examples

# Assuming the function is part of a larger framework and dependencies are met:
if (FALSE) { # \dontrun{
result <- general_node_rule(currentNode, markers, root_data, sampledef, neg_gate, 
expr_group, ctrl_group, total_cell_per_file, usedmarkers)
} # }