Cobrapy
Performs constraint-based metabolic modeling with COBRApy, including FBA, pFBA, FVA...
Install
npx skills add K-Dense-AI/scientific-agent-skills --skill cobrapy -g -a claude-code -y- Repository
- K-Dense-AI/scientific-agent-skills55.7k
- Category
- Marketing
- Updated
- 9d ago
- License
- GPL-2.0 license
- Context cost
- Mediumabout 2,751 tokens
- Runs scripts
- No, instructions only
What it does
Performs constraint-based metabolic modeling with COBRApy, including FBA, pFBA, FVA, gene knockouts, flux sampling, growth media, production envelopes, gap filling, and SBML model validation for systems biology and metabolic engineering.
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.
Record model source/version/checksum, cobra and solver versions, objective,
medium, bounds, tolerances, and any random seed with each analysis. GLPK handles
the examples below; inspect cobra.util.solver.solvers before choosing an
optional solver. Use "hybrid" for its HiGHS/OSQP interface when installed;
the legacy "osqp" alias is deprecated. QP methods require a suitable backend.
Start with processes=1; scripts using multiprocessing need a guarded entry point.
Workflow
1. Load, inspect, and validate a model
from cobra.io import load_model
