cobrapy
Skill by davila7
Runs constraint-based metabolic modeling in Python with COBRApy. It covers flux balance and variability analysis, gene knockouts and flux sampling. It is built for systems biology and metabolic engineering analysis.
Install cobrapy
Built from the published package, never by AI.
git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/claude-code-templates && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-templates/cli-tool/components/skills/scientific/cobrapy ~/.claude/skills/cobrapyRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/claude-code-templates && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/claude-code-templates/cli-tool/components/skills/scientific/cobrapy ~/.gemini/antigravity-cli/skills/cobrapyAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
COBRApy is a Python library for constraint-based reconstruction and analysis (COBRA) of metabolic models. It loads and saves models in SBML, JSON and YAML formats, and gives access to reactions, metabolites and genes. It supports flux balance analysis, parsimonious and geometric FBA, and flux variability analysis, including loopless FVA.
The library also covers gene and reaction knockout studies, minimal growth media, flux sampling with OptGP and ACHR, production envelopes and gapfilling. Users can also build models from scratch with reactions and metabolites. The skill is aimed at systems biology and metabolic engineering analysis. Worked examples include a gene knockout screen and media optimization.
Written from the project's SKILL.md and checked against it.
What it can do
- Model loading and savingReads and writes models in SBML, JSON and YAML formats.
- Flux balance analysisRuns FBA, parsimonious FBA and geometric FBA on a model.
- Flux variability analysisFinds flux ranges for reactions, including loopless FVA.
- Gene and reaction deletionsRuns single and double knockout analyses and manual knockouts.
- Minimal mediaCalculates minimal growth media for a model.
- Flux samplingSamples the feasible flux space using OptGP or ACHR.
- Production envelopesCalculates phenotype phase planes for production analysis.
- GapfillingAdds reactions from a universal model to make a model feasible.
- Model buildingCreates metabolites, reactions and models from scratch.
What you need
- Python
- A linear programming solver such as GLPK, CPLEX or Gurobi (optional, for solver changes)
Try asking
- Load the E. coli model and run FBA to report its growth rate.
- Run a single gene knockout screen on the E. coli model and list essential genes.
- Compute the minimal medium for 50% of maximum growth in E. coli.
Good to know
- Minimal media with minimize_components=True uses MILP and is slower.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: cli-tool/components/skills/scientific/cobrapy/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md12 KB -
references/api_quick_reference.md16 KB -
references/workflows.md21 KB
Alternatives to cobrapy
All alternatives →Searches arXiv for scientific papers and preprints, extracts their metadata and abstracts, and downloads PDF or HTML full text. Suited to users who need research papers, literature or specific arXiv IDs.
Downloads AlphaFold predicted structures and PAE matrices for a UniProt ID, then reports pLDDT confidence, domain boundaries and disorder. Built for users who already have a UniProt accession.
Queries the QuickGO and Evidence & Conclusion Ontology REST API to map genes to Gene Ontology terms. Built for researchers doing functional annotation and GO hierarchy exploration.
Connects an AI assistant to Peloton to browse fitness classes, check live and archived schedules, and manage workouts. Built for Peloton users who want to plan rides from their assistant.
Queries NCBI Gene through the E-utilities and Datasets API. It helps researchers search genes by symbol or ID, retrieve gene details, and run batch lookups for annotation and functional analysis.
Prepares and launches nf-core/pacsomatic runs for matched tumor-normal PacBio HiFi data starting from unaligned BAM files. It generates samplesheets and pinned launch artifacts, then runs locally or submits to a scheduler.
Compare with literature-search-arxiv, alphafold-database-fetch-and-analyze or quickgo-database
cobrapy: common questions
What does cobrapy do?
It is a Python library for constraint-based metabolic modeling. It covers FBA, FVA, gene knockouts and flux sampling.
Which model formats does cobrapy read and write?
It reads and writes SBML, JSON and YAML. The source says SBML is preferred for model exchange and long-term storage.
Can cobrapy use different solvers?
Yes. The troubleshooting section says solvers such as GLPK, CPLEX and Gurobi can be set via model.solver.
How do I install cobrapy?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is cobrapy free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is cobrapy safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to cobrapy?
Similar skills: literature-search-arxiv, alphafold-database-fetch-and-analyze, quickgo-database, peloton.
