cobrapy

Perform constraint-based metabolic modeling and FBA/FVA analyses in Python.

6|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/pur3v4d3r/pur3-pkb-codebase --skill cobrapy-pur3v4d3r
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cobrapy
Source: https://github.com/pur3v4d3r/pur3-pkb-codebase/tree/main/.claude/skills/__scientific-skills/cobrapy
Command: npx skills add https://github.com/pur3v4d3r/pur3-pkb-codebase --skill cobrapy-pur3v4d3r

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

COBRApy provides a Python toolkit to build, analyze, and simulate constraint-based metabolic models, enabling researchers to predict cellular behavior from genome-scale networks.

Core Features & Use Cases

  • Model management: load SBML, JSON, and YAML models; inspect and manipulate reactions, metabolites, and genes.
  • Analyses: perform Flux Balance Analysis (FBA), Flux Variability Analysis (FVA), gene deletion studies, and flux sampling.
  • Advanced workflows: production envelopes, gapfilling, and model construction from scratch; supports safe experimentation with context management.
  • Real-world use: optimize growth, engineer metabolic pathways, and explore network feasibility under varying conditions.

Quick Start

Use COBRApy to load an E. coli model and run a basic FBA to obtain a growth rate and flux distribution.

Frequently Asked Questions about cobrapy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform flux balance analysis on a genome-scale metabolic model in Python?

You can perform flux balance analysis (FBA) by loading an SBML model into a Python environment with COBRApy, then running the FBA solver to obtain predicted cellular growth rates and metabolic flux distributions.

What is flux variability analysis and how does it help with metabolic modeling?

Flux variability analysis (FVA) calculates the range of possible fluxes for each reaction in a metabolic model while maintaining optimal growth, helping researchers explore network feasibility and identify alternative pathways.

Can I simulate gene deletions in an SBML metabolic model using Python?

Yes, you can simulate gene deletions by loading your SBML model with COBRApy and applying context management to safely knock out specific genes, allowing you to observe the resulting changes in growth rates and fluxes.

How do I run production envelope analysis for metabolic pathway engineering?

Production envelope analysis is performed by loading your model in COBRApy, then systematically varying the flux of a target reaction to map the trade-off between cellular growth and the production of a desired metabolite.

Do I need a specific Python environment to load and curate SBML metabolic models?

You need a Python environment with COBRApy installed to load SBML, JSON, or YAML models, enabling you to inspect reactions, metabolites, and genes for genome-scale metabolic network curation and gapfilling.