Recursively processes nested brackets in module definitions to calculate pathway completeness or abundance scores. Handles complex pathway structures with multiple nesting levels.
process_module_brackets(
module_abundance = sub_Sample_KO_pathway,
module_steps_str = module_steps_str,
bracket_count = 1,
step_count = 1,
module_name = "Module",
raw_module_steps = module_steps_str,
plus_scale_method,
comma_scale_method,
abundance_log = list()
)A list with two components:
data: Data frame containing processed abundance values with:
- Rows for each bracket level and final step
- Consistent sample columns as input
log: A character vector of timestamped log messages.
Data frame containing KO abundance data for the module
String representation of module steps/structure
Counter for tracking nested bracket levels
Counter for tracking processing steps
Name of the module being processed
Original unprocessed module steps string
Scaling method for plus-separated KOs ("mean", "min", or "max")
Scaling method for comma-separated KOs ("sum" or "max")
A character vector of timestamped log messages