Abstract
Motivation
Recent advances in analysis of biochemical networks have contributed the identification of their modular structure based on the concept of multi reaction dependencies and kinetic coupling of reaction rates. Existing implementations of the algorithms to study modular structure do not scale well with the size of the networks, prohibiting their application with genome-scale networks.
Results
Here, we introduce COCOA.jl, a multithreaded Julia package for identification of concordant and kinetic modules, with applications in the study of concentration robustness.
Availability
COCOA.jl is implemented in Julia 1.12.6 and is freely available under the MIT license at GitHub (https://github.com/antoniofranky/COCOA.jl) and Zenodo (https://doi.org/10.5281/zenodo.22094185). It runs on Linux, macOS, and Windows; installation is supported via the Julia package manager. COCOA.jl can be called from Python via JuliaCall.
1 Introduction
Constraint-based modelling represents a key tool for genome-scale analysis of cellular metabolism, drug-target discovery, and design of metabolic engineering strategies (Gu et al. 2019, Thiele et al. 2020, Bintener et al. 2023). Classical flux coupling analysis characterizes pairwise dependencies between individual reactions (Burgard et al. 2004, Larhlimi et al. 2012). Recent theoretical advances have enabled the identification of multireaction dependencies and linked them to concentration robustness in biochemical networks endowed with mass-action kinetics.
These methods operate on the complex–reaction decomposition of the stoichiometric matrix, N = YA, where each complex (one side of a reaction) carries an activity equal to the net flux through it. Complexes with zero activity across all feasible steady states are called balanced (Küken et al. 2021, Langary et al. 2023); two non-balanced complexes with a constant activity ratio are concordant (Küken et al. 2022). Concordance partitions non-balanced complexes into concordance modules, which are in turn used to identify kinetic modules–subnetworks whose reactions are kinetically coupled (Langary et al. 2025).
The computational bottleneck in the study of the modularity of metabolic networks based on these concepts is concordance testing, which requires solving four linear programs (LPs) per pair of complexes, with number of pairs growing quadratically [e.g. reaching ≈10⁸ for networks of ≈20 000 complexes after elementary-step expansion (Langary et al. 2025)]. The reference MATLAB implementation (Küken et al. 2021, 2022, Langary et al. 2023, 2025) uses sampling-based candidate filtering but relies on a tensor representation that limits sample sizes (n < 10) and solves pairs sequentially without transitivity pruning.
To address these limitations, we developed COCOA.jl, a Julia implementation that (i) solves LPs in parallel with cached JuMP models, (ii) exploits the transitivity of concordance to skip already-implied pair checks, and (iii) evaluates activity correlations in memory-efficient streaming batches. COCOA.jl builds on COBREXA.jl (Kratochvíl et al. 2025), so models from COBRApy (Ebrahim et al. 2013), the COBRA Toolbox (Heirendt et al. 2019), or COBRA.jl (Heirendt et al. 2017) can be used directly.
2 Implementation
2.1 Workflow
COCOA.jl exposes a four-step pipeline:
(i) Model preparation:
Blocked reactions and orphan metabolites are removed by prepare_model_for_concordance. Because the concentration-robustness arguments of Langary et al. (2025) assume mass-action kinetics, split_into_elementary_reactions optionally expands each enzymatic reaction into elementary steps with either an ordered or a random enzyme-binding mechanism (Segel 1993, Liebermeister and Klipp 2006, Khodayari and Maranas 2016).
(ii) Balanced complexes and trivial dependencies:
The core function activity_concordance_analysis builds the stoichiometric constraints (reversible reactions can be split via concordance_constraints), identifies trivially balanced complexes (Küken et al. 2021) as well as trivially concordant pairs (Küken et al. 2022), and determines the sign of each complex’s activity through activity variability analysis. Activity variability analysis maximizes and minimizes each complex’s activity over the flux polytope, classifying it as strictly positive, strictly negative, or sign-variable. The sign classification reduces the number of Charnes–Cooper-transformed LPs that have to be solved per non-trivial pair.
(iii) Sampling-driven candidate filtering:
Activities of complexes are sampled using artificial-centering hit-and-run on the flux polytope (Kaufman and Smith 1998). A streaming filter retains only candidate pairs whose empirical activity-ratio coefficient of variation is below a user-defined threshold (default CV ≤ 0.01). The retained candidates are tested for concordance by solving the fractional linear programs that compute the minimum and maximum activity ratios; confirmed concordant pairs are merged by union–find, exploiting the equivalence-relation property of concordance to partition complexes into maximal mutually concordant sets. Pairs whose ratio range is non-singleton are added to a non-concordance set so that further candidates involving them can be skipped.
(iv) Kinetic modules and robustness:
Kinetic modules are derived from concordance modules using the four-phase upstream algorithm of Langary et al. (2025): starting from extended modules (the concordance module augmented with the balanced complexes), complexes that violate autonomy (Phase I) or the feeding property (Phases II–IV) are iteratively removed; overlapping upstream sets are merged into the final kinetic modules. Within each kinetic module COCOA.jl then detects (i) metabolites with absolute concentration robustness and (ii) metabolite pairs with absolute concentration ratio robustness (Langary et al. 2025) using differences in complexes participating in a kinetic module.
2.2 Algorithmic optimizations
The improved implementation combines three optimizations. Parallel LP solution with cached JuMP models eliminates the per-pair model-construction overhead that dominates the naive implementation. Dynamic transitivity filtering propagates already-confirmed concordance/non-concordance relations to prune pair checks on the fly. Streaming computation evaluates activity correlations in bounded-size batches, keeping peak memory tractable on networks with >104 complexes. Across the benchmark dataset (Section 3) the candidate filter eliminated >99% of complex pairs before any LP was solved. With these improvements, runtime still scales quadratically with the number of complex pairs, however, reduced by a large constant factor. Across the 62 benchmark runs concordance runtime scales as O(nk) in the number of complexes n, with k ≈ 2.2 (95% CI 1.8–2.6, R2 = 0.72; Fig. 1).
Figure 1.

Scaling of required computational resources. (A) End-to-end COCOA.jl runtime for concordance and kinetic module analysis, log-scaled; (B) peak resident memory as a function of the number of complexes after elementary-step expansion, across the 62 benchmark runs (33 ordered-binding and 29 random-binding models). All runs used 64 CPU cores on an x86_64 Slurm cluster.
3 Benchmark against the reference implementation
3.1 Dataset and protocol
We benchmarked COCOA.jl against the MATLAB Upstream_Algorithm pipeline (github.com/ankueken/Upstream_Algorithm) on the 33 genome-scale models analysed by Langary et al. (2025). For each model the two enzyme-binding variants (ordered and random) were considered, giving 62 (model, variant) runs in total (four models yielded only an ordered-binding variant for the original reference implementation because of its random-variant runtime). All runs used the same pre-balanced elementary-step .mat files as the reference pipeline, so inputs were byte-identical. COCOA.jl and the MATLAB reference were executed with seed 42, sample size 10 000 CV threshold 0.01, and concordance tolerance 10−2; MATLAB output counts were independently cross-checked against Table S1 of Langary et al. (2025). Runs were performed on a shared Slurm cluster with 64 cores and up to 600 GB of memory per job.
3.2 Agreement with the reference implementation
For each model variant, we compared COCOA.jl and the reference implementation on three quantities, that provide possible applications of concordance analysis, previously highlighted by Langary et al. (2025): the size of the giant kinetic module (the largest kinetic module), the set of free metabolites with absolute concentration robustness (ACR), and the set of free metabolite pairs with absolute concentration-ratio robustness (ACRR). The per-model comparison is shown for ordered binding in Fig. S1 and for random binding in Fig. S2.
Across the 62 (model, variant) runs the giant kinetic module differs in both directions, but is predominantly smaller in COCOA.jl, which reports smaller giant kinetic module in 45 runs and larger in 16 (median 27 versus 138 complexes; Figs. S1a and 2a). The sets of ACR free metabolites (Figs. S1b and 2b) track the reference on most networks, with COCOA.jl reporting the same or fewer where they differ; the sets of ACRR free metabolite pairs (Figs. S1c and 2c) differ in both directions, with COCOA.jl reporting more on most networks. These differences are not attributable to the choice of LP solver or to numerical tolerances, which we varied without effect on the reported quantities (Table S1). They arise from two sources: the two implementations sample the steady-state flux cone differently when selecting the candidate complex pairs submitted for concordance testing–the concordance test itself, a coefficient-of-variation pre-filter followed by a Charnes–Cooper-linearized ratio LP, being identical between them–and COCOA.jl now explicitly represents the zero complex ∅ for exchange/boundary reactions in the incidence matrix, to follow standard CRN theory. In the reference implementation by Langary et al. (2025), boundary complexes were never pruned by Phase I of the Upstream Algorithm and were merged into a single kinetic module, leading to differences in the terminal strong linkage classes considered in the Upstream Algorithm. COCOA.jl’s outputs are robust to user-specified settings: the ACR count 0 is invariant and the giant kinetic module is essentially unchanged (4, 40–78 and 106–107 on e_coli_core, iAF1260b and iJR904) across seeds, the concordance and blocked-reaction tolerances (10−2–10−10) and the sample size, while the finer partition composition and the ACRR count vary. Over the full cone the concordance partition is deterministic on e_coli_core and varies only run to run at genome scale–without changing the giant module or ACR–and the ACRR count converges as the flux cone is sampled more densely (Table S1).
3.3 Runtime and memory scaling
We report runtime and peak memory for the concordance-analysis step only, because it is the performance-critical part of the pipeline: in every benchmark run concordance analysis accounted for more than 95% of the wall-clock time and for the peak memory footprint. COCOA.jl completed concordance analysis for every (model, variant) pair in the benchmark, including networks with up to 19 667 complexes after elementary-step expansion. Median concordance wall-clock time was 54 min for ordered binding and 134 min for random binding (Fig. 1A); median peak memory was 48 GB and 202 GB, respectively (Fig. 1B). The higher random-binding footprint reflects the denser connectivity of random-binding elementary-step networks. The reference MATLAB pipeline was unable to complete within the 600 GB/48 h Slurm allocation on the three largest random-binding networks (iAM_Pf480, iAM_Pk459, iAM_Pv461, each >17 000 complexes), which is the main practical motivation for COCOA.jl. Applying the reference implementation at this scale also requires manual intervention: its concordance routine is serial and exposes explicit start and stop indices so that the candidate-pair set can be divided across separately launched jobs, whose partial results the user must then recombine. COCOA.jl distributes the same candidate set across available workers automatically within a single invocation, so genome-scale networks are analysed without manual partitioning or bookkeeping.
4 Conclusion
COCOA.jl is a scalable, open-source Julia package that brings balanced-complex identification, concordance analysis, and kinetic module identification alongside downstream mining for identification of ACR and ACRR properties to genome-scale biochemical networks. It reproduces the published results of Langary et al. (2025) on the ordered-binding elementary-step decompositions of 33 genome-scale models at the level of reaction and complex counts, and extends the analysis to random-binding variants and to networks that were previously intractable. Its integration with the COBREXA.jl ecosystem and its interoperability with Python and MATLAB should make it immediately usable in existing constraint-based workflows.
Supplementary Material
Acknowledgement
We thank Dr. Damoun Langary for helpful discussions.
Contributor Information
Anton Schaffranke, Bioinformatics Department, Institute of Biochemistry and Biology, University of Potsdam, Potsdam, 14476, Germany.
Anika Küken, Bioinformatics Department, Institute of Biochemistry and Biology, University of Potsdam, Potsdam, 14476, Germany.
Zoran Nikoloski, Bioinformatics Department, Institute of Biochemistry and Biology, University of Potsdam, Potsdam, 14476, Germany.
Author contributions
Anton Schaffranke (Data curation [equal], Formal analysis [equal], Investigation [equal], Software [equal], Validation [equal], Visualization [equal], Writing—original draft [equal], Writing—review & editing [equal]), Anika Küken (Conceptualization [equal], Funding acquisition [equal], Methodology [equal], Project administration [equal], Resources [equal], Supervision [equal], Writing—original draft [equal], Writing—review & editing [equal]), and Zoran Nikoloski (Conceptualization [equal], Funding acquisition [equal], Methodology [equal], Project administration [equal], Supervision [equal], Writing—review & editing [equal])
Supplementary material
Supplementary material is available at Bioinformatics online.
Conflict of interests
None declared.
Funding
This work has been supported by funding from the University of Potsdam’s Research Focus Group “Evolutionary Systems Biology” and by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)—SFB 1644/1—512328399.
Data availability
The code and data underlying this article are available at GitHub (https://github.com/antoniofranky/COCOA.jl) and Zenodo (https://doi.org/10.5281/zenodo.22094185). The code for the reference implementation is available at github.com/ankueken/Upstream_Algorithm.
References
- Bintener T, Pacheco MP, Philippidou D et al. Metabolic modelling-based in silico drug target prediction identifies six novel repurposable drugs for melanoma. Cell Death Dis 2023;14:468. 10.1038/s41419-023-05955-1 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Burgard AP, Nikolaev EV, Schilling CH et al. Flux coupling analysis of Genome-Scale metabolic network reconstructions. Genome Res 2004;14:301–12. 10.1101/gr.1926504 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Ebrahim A, Lerman JA, Palsson BO et al. COBRApy: COnstraints-Based reconstruction and analysis for python. BMC Syst Biol 2013;7:74. 10.1186/1752-0509-7-74/FIGURES/2 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Gu C, Kim GB, Kim WJ et al. Current status and applications of Genome-Scale metabolic models. Genome Biol 2019;20:121. 10.1186/S13059-019-1730-3 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Heirendt L, Arreckx S, Pfau T et al. Creation and analysis of biochemical constraint-based models using the COBRA toolbox v.3. Nat Protoc 2019;14:639–702. 10.1038/s41596-018-0098-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Heirendt L, Thiele I, Fleming RMT. DistributedFBA.Jl: high-level, high-performance flux balance analysis in Julia. Bioinformatics 2017;33:1421–3. 10.1093/BIOINFORMATICS/BTW838 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Kaufman DE, Smith RL. Direction choice for accelerated convergence in hit-and-run sampling. Oper Res 1998;46:84–95. 10.1287/OPRE.46.1.84 [DOI] [Google Scholar]
- Khodayari A, Maranas CD. A Genome-Scale Escherichia coli kinetic metabolic model k-Ecoli457 satisfying flux data for multiple mutant strains. Nat Commun 2016;7:13806. 10.1038/ncomms13806 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Kratochvíl M, Wilken SE, Ebenhöh O et al. Cobrexa 2: tidy and scalable construction of complex metabolic models. Bioinformatics 2025;41:btaf056. 10.1093/bioinformatics/btaf056 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Küken A, Langary D, Nikoloski Z. The hidden simplicity of metabolic networks is revealed by multireaction dependencies. Sci Adv 2022;8:eabl6962. 10.1126/sciadv.abl6962 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Küken A, Wendering P, Langary D et al. A structural property for reduction of biochemical networks. Sci Rep 2021;11:17415. 10.1038/s41598-021-96835-1 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Langary D, Küken A, Nikoloski Z. The unraveling of balanced complexes in metabolic networks. Sci Rep 2023;13:5712. 10.1038/s41598-023-32666-6 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Langary D, Küken A, Nikoloski Z. Kinetic modules are sources of concentration robustness in biochemical networks. Sci Adv 2025;11:eads7269. 10.1126/SCIADV.ADS7269/SUPPL_FILE/SCIADV.ADS7269_TABLES_S1_TO_S3.ZIP [DOI] [PMC free article] [PubMed] [Google Scholar]
- Larhlimi A, David L, Selbig J et al. F2C2: a fast tool for the computation of flux coupling in Genome-Scale metabolic networks. BMC Bioinformatics 2012;13:57. 10.1186/1471-2105-13-57 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Liebermeister W, Klipp E. Bringing metabolic networks to life: convenience rate law and thermodynamic constraints. Theor Biol Med Model 2006;3:41. 10.1186/1742-4682-3-41 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Segel IH. Enzyme kinetics: behaviour and analysis of rapid equilibrium and steady-state enzyme systems. In: Enzyme Kinetics. Behavior and Analysis of Rapid Equilibrium and Steady-State Enzyme Systems. 1st edn. New York: John Wiley & Sons, 1993. [Google Scholar]
- Thiele I, Sahoo S, Heinken A et al. Personalized whole-body models integrate metabolism, physiology, and the gut microbiome. Mol Syst Biol 2020;16. 10.15252/msb.20198982 [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
The code and data underlying this article are available at GitHub (https://github.com/antoniofranky/COCOA.jl) and Zenodo (https://doi.org/10.5281/zenodo.22094185). The code for the reference implementation is available at github.com/ankueken/Upstream_Algorithm.
