This function calculates the log2-ratio of the sum of percentages normalized by group size between an experimental group and a control group. It adds a small constant to avoid division by zero.
Usage
calculate_enrichment(
df,
percentage_data = "node_percentage",
expr_group = NULL,
ctrl_group = NULL
)Arguments
- percentage_data
A character to specify the column name for the percentage data.
- expr_group
The name of the experimental group as a single string which must match exactly with one of the groups in `sampledef`.
- ctrl_group
The name of the control group as a single string which must match exactly with one of the groups in `sampledef`.
Value
A single numeric value representing the log2-transformed ratio of normalized sums of percentages between the experimental and control groups.
See also
Other GatingTree:
ExtractGatingTree(),
GatingTreeToDF(),
PlotDeltaEnrichment(),
PlotDeltaEnrichmentPrunedTree(),
PruneGatingTree(),
addChildNode(),
add_prune(),
apply_gating_conditions(),
baseline_entropy(),
calculate_entropy(),
collect_all_enrichment(),
collect_all_entropy(),
collect_history(),
collect_leaf_enrichment(),
collect_markers(),
count_nodes(),
createChildNode(),
createGatingTreeObject(),
findNodeByPath(),
find_and_update_nodes(),
gating_entropy(),
general_node_rule(),
generate_marker_names(),
getNode(),
prune_tree(),
recursiveAddChildNode(),
update_nodes_by_paths()
Examples
if (FALSE) { # \dontrun{
percentage <- c(0.1, 0.2, 0.15, 0.05)
calculate_enrichment(df, "exp", "ctrl")
} # }