If you're doing metabolic modeling or systems biology work, this is the standard Python library for constraint-based analysis. It handles genome-scale models in SBML format, runs flux balance analysis (FBA), flux variability analysis (FVA), and gene knockout screens. The skill covers loading bundled models like E. coli core or pulling from BiGG, running optimizations with different solvers (GLPK comes bundled, CPLEX and Gurobi are optional), and doing flux sampling for uncertainty analysis. Gapfilling support helps fix infeasible models. It uses optlang under the hood for the LP solver interface, so switching between GLPK and commercial solvers is straightforward. Solid for metabolic engineering and predicting cellular phenotypes.
- skills.sh installs
- 2K
- GitHub stars
- 56.6K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add k-dense-ai/scientific-agent-skills --skill cobrapy --agent claude-codeInstalls into .claude/skills of the current project.
Files
COBRApy - Constraint-Based Reconstruction and Analysis
When to use
Use for loading/building metabolic networks, optimizing their steady-state fluxes, knockout screens, medium design, feasible-space sampling, and gap-filling hypotheses. FBA is a constraint-based prediction; it does not infer kinetic rates or establish experimental growth, thermodynamic feasibility, or flux identifiability.
Setup and reproducibility
Targets cobra 0.32.1 (import cobra), checked against its released source and
current documentation.
uv pip install "cobra==0.32.1"
# Optional SciPy support for MATLAB I/O and array operations:
uv pip install "cobra[array]==0.32.1"
Plotting examples additionally require matplotlib, pandas, and seaborn. The
cobra[chrr] extra supplies hopsy for the new CHRR sampler; that optional backend
was documentation-reviewed, not executed in this refresh. In 0.32.1, sample()
defaults to method="auto" (CHRR when hopsy is installed, otherwise OptGP).
Choose the method explicitly to avoid environment-dependent changes.
Sponsors
Details
- Repository
- github.com/k-dense-ai/scientific-agent-skills
- Categories
- AI & Agent Building, Go, Generative Media
- First seen
- Jun 3, 2026
