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
- 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`.
- percentage
A numeric vector of percentages for each sample.
- sampledef
A data frame containing at least a column named 'group' which denotes the group assignment of each sample in the `percentage` vector.
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:
GatingTreeToDF()
,
PlotDeltaEnrichment()
,
PruneGatingTree()
,
addChildNode()
,
add_prune()
,
apply_gating_conditions()
,
baseline_entropy()
,
calculate_entropy()
,
collect_all_enrichment()
,
collect_all_entropy()
,
collect_history()
,
collect_leaf_enrichment()
,
collect_markers()
,
convertToDataTree()
,
convert_to_diagrammer()
,
count_nodes()
,
createChildNode()
,
createGatingTreeObject()
,
findNodeByPath()
,
find_and_update_nodes()
,
gating_entropy()
,
general_node_rule()
,
generate_marker_names()
,
getNode()
,
prune_tree()
,
recursiveAddChildNode()
Examples
if (FALSE) { # \dontrun{
percentage <- c(0.1, 0.2, 0.15, 0.05)
sampledef <- data.frame(group = c("exp", "exp", "ctrl", "ctrl"))
calculate_enrichment(df, "exp", "ctrl")
} # }