Learn R Programming

mclink (version 1.1.1)

process_module_brackets: Process Module Brackets Recursively

Description

Recursively processes nested brackets in module definitions to calculate pathway completeness or abundance scores. Handles complex pathway structures with multiple nesting levels.

Usage

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()
)

Value

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.

Arguments

module_abundance

Data frame containing KO abundance data for the module

module_steps_str

String representation of module steps/structure

bracket_count

Counter for tracking nested bracket levels

step_count

Counter for tracking processing steps

module_name

Name of the module being processed

raw_module_steps

Original unprocessed module steps string

plus_scale_method

Scaling method for plus-separated KOs ("mean", "min", or "max")

comma_scale_method

Scaling method for comma-separated KOs ("sum" or "max")

abundance_log

A character vector of timestamped log messages