Skip to contents

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.

Examples

if (FALSE) { # \dontrun{
percentage <- c(0.1, 0.2, 0.15, 0.05)
calculate_enrichment(df, "exp", "ctrl")
} # }