preprocessing

Generated: validation needed. Description:

Model preprocessing functions for reversible-to-irreversible model conversion. Pipeline always produces a closed irreversible model with boundary reactions zeroed and reversible reactions split into forward/backward pairs.

Classes

IrreversibleModelMode(value)

Generated: validation needed. Description: Strategy for splitting reversible reactions into irreversible forward/backward pairs. - SAFE: Standard cobrapy methods, index rebuilt after each rename. - FAST: Batch rename with temporary no-op ID hook, single rebuild, slim bound setter.

ModelPreprocessingResult

Generated: validation needed. Description: Output container for model preprocessing stage. Holds the closed irreversible model and the index mapping used downstream. :Parameters: * irreversible_model (cobra.Model) -- Closed irreversible cobra model (boundary reactions zeroed, reversible reactions split into _f/_r pairs). * rev2irrev (list[list[int]]) -- Mapping from original reaction index (1-based) to one or two irreversible reaction indices.

Functions

create_irreversible_model(cobra_model[, mode])

Generated: validation needed. Description: Convert a cobra model to irreversible form by splitting every reaction with lb < 0 and ub > 0 into forward (_f) and backward (_r) sub-reactions. Returns the transformed model and a rev2irrev index mapping. Two modes available: - SAFE: Standard cobrapy methods, index rebuilt after each rename. - FAST: Batch rename with temporary no-op ID hook, single index rebuild, and context-scoped slim bounds setter. :Parameters: * cobra_model (cobra.Model) -- Source model. Will be mutated in-place. * mode (IrreversibleModelMode) -- Splitting strategy. Default SAFE.

preprocess_model(cobra_model, config[, mode])

Generated: validation needed. Description: Preprocess a cobra model into closed irreversible form ready for the VmaxBuilder pipeline. Steps in order: 1. Make a copy if config.make_copy is True. 2. Close all boundary reactions (bounds set to (0.0, 0.0)). 3. Split reversible reactions into forward (_f) and backward (_r) pairs. :Parameters: * cobra_model (cobra.Model) -- Source cobra model. * config (ModelConfig) -- Model configuration with make_copy flag. * mode (IrreversibleModelMode) -- Splitting strategy. Default SAFE.