Calculates log2 fold change between two groups with proper handling of zero values using a data-driven pseudocount approach.
calculate_log2_fold_change(
mean1,
mean2,
pseudocount = NULL,
reference_values = NULL
)log2(mean2/mean1) with pseudocount protection
Numeric. Mean abundance of group 1 (reference/control)
Numeric. Mean abundance of group 2 (comparison/treatment)
Optional numeric. If NULL, calculated from reference_values
Optional numeric vector for calculating pseudocount
The fold change direction is group2/group1, so: - Positive values indicate higher abundance in group2 - Negative values indicate higher abundance in group1