Agent skill

FBA Flux Analyzer

by aiming-lab in aiming-lab/AutoResearchClaw

Turns raw flux balance analysis output and a COBRApy model into gene essentiality maps, phenotypic phase planes, flux sampling results, pathway summaries and secretion predictions.

MITAuto-check passedResearch & Science

Install FBA Flux Analyzer

skills CLI
$ npx skills add aiming-lab/AutoResearchClaw --skill flux-analyzer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aiming-lab/AutoResearchClaw flux-analyzer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aiming-lab/AutoResearchClaw.git skills-src && mkdir -p .claude/skills && cp -r skills-src/external/agents/Biology-Agent/skills/flux-analyzer .claude/skills/flux-analyzer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
flux-analyzer
GitHub stars
15k
Token cost
~2.3k tokens
SKILL.md length
387 words
Files
1
Skills in repo
34
Repo updated
First seen
Licence
MIT

At a glance

Turns raw flux balance analysis output and a COBRApy model into gene essentiality maps, phenotypic phase planes, flux sampling results, pathway summaries and secretion predictions.

  • Works in 7 steps: Load Model and FBA Results → Gene Essentiality Analysis → Reaction Essentiality Analysis → …
  • Finding which genes or reactions are essential in a metabolic model
  • SKILL.md covers Overview, Workflow and Key Conventions
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill works directly on FBA result files and a COBRApy model through a seven-step workflow. It loads the model and results with cobra and cobra.io, then runs single and double gene essentiality analysis using single_gene_deletion and double_gene_deletion, treating a gene as essential when its deletion drops growth below 5% of wild-type, a widely used lethality threshold. Reaction essentiality follows the same pattern with single_reaction_deletion.

A phenotypic phase plane step uses production_envelope to map growth rate over a 2D grid of two nutrient uptake rates, such as glucose against oxygen, revealing phase transitions like aerobic growth versus mixed-acid fermentation. Flux sampling explores the feasible steady-state flux space with the OptGP Markov-chain Monte Carlo sampler, to show which reactions have wide or narrow feasible ranges. The remaining steps group reactions by metabolic subsystem to total flux per pathway as a proxy for pathway activity, and scan exchange reactions for positive flux at optimal growth to predict secretion products and by-products. It also produces publication-quality figures.

When your agent uses it

  • Finding which genes or reactions are essential in a metabolic model
  • Mapping a phenotypic phase plane across two nutrient uptake rates
  • Sampling the feasible flux space of an FBA model to see which reactions vary most
  • Predicting which metabolites a model secretes at its optimal growth rate

Example prompts

  • “Run gene essentiality analysis on this COBRApy model and show me the essential genes.”
  • “Build a phenotypic phase plane for glucose versus oxygen uptake on this model.”
  • “Sample 1000 flux distributions from this model and show which reactions vary most.”
  • “Predict the secretion products at optimal growth for this metabolic model.”

Requirements

  • Python with COBRApy

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Load Model and FBA Results
  2. Gene Essentiality Analysis
  3. Reaction Essentiality Analysis
  4. Phenotypic Phase Plane (PPP)
  5. Flux Sampling
  6. Pathway-Level Flux Aggregation
  7. Secretion Product Prediction

What it can do on your machine

Read from SKILL.md and the folder at commit be4ba47. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

FBA Flux Analyzer loads about 2.3k tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 387 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from aiming-lab/AutoResearchClaw at commit be4ba47, republished under its MIT licence (© aiming-lab). 387 words, ~2,253 tokens.

Download SKILL.mdSave it as .claude/skills/flux-analyzer/SKILL.md (or your agent's skills folder).
name
flux-analyzer
description
Analyse FBA flux distributions to extract biological insights. Covers gene essentiality, phenotypic phase planes, flux sampling, pathway-level aggregation, secretion product prediction, and production of publication- quality figures.
metadata.category
domain
metadata.trigger-keywords
metabolic,flux analysis,gene essentiality,synthetic lethality,production envelope,phase plane,flux sampling,secretion,yield,metabolic engineering
metadata.applicable-stages
9,10,12,13,14,15,16,17,20
metadata.priority
1

Overview

The flux-analyzer skill transforms raw FBA output into actionable biological knowledge. It operates on FBA result files and the COBRApy model to produce gene essentiality maps, phenotypic phase planes (PPP), flux sampling distributions, pathway-level summaries, and product secretion profiles.

This skill is the metabolic-modelling analogue of event reconstruction and phenomenology summary stage in the ColliderAgent pipeline: it turns numbers into biology.


Workflow

Step 1 — Load Model and FBA Results
python
import cobra
import cobra.io
import cobra.flux_analysis
import cobra.sampling
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt

model = cobra.io.load_json_model("my_model.json")
fba_fluxes = pd.read_csv("fba_fluxes.csv", index_col=0)["flux_mmol_gDW_h"]
wt_growth = model.optimize().objective_value
print(f"Wild-type growth: {wt_growth:.4f} h^-1")
Step 2 — Gene Essentiality Analysis

Essential genes are those whose deletion reduces growth to below 5% of wild-type — a widely used lethality criterion.

python
from cobra.flux_analysis import single_gene_deletion, double_gene_deletion

# --- Single gene essentiality ---
sg_deletion = single_gene_deletion(model)
sg_deletion.columns = ["growth", "status"]
sg_deletion["is_essential"] = sg_deletion["growth"] < 0.05 * wt_growth
sg_deletion["growth_fraction"] = sg_deletion["growth"] / wt_growth

essential_genes = sg_deletion[sg_deletion["is_essential"]]
print(f"Essential genes: {len(essential_genes)} / {len(model.genes)}")
sg_deletion.to_csv("gene_essentiality.csv")

# --- Double gene essentiality (synthetic lethality) ---
# Limit to a focused gene set to reduce compute time
target_genes = list(model.genes)[:50]   # adjust as needed
dg_deletion = double_gene_deletion(model, target_genes, target_genes)
dg_deletion.columns = ["growth", "status"]
dg_deletion["is_synthetic_lethal"] = dg_deletion["growth"] < 0.05 * wt_growth
dg_deletion.to_csv("double_gene_essentiality.csv")
Step 3 — Reaction Essentiality Analysis
python
from cobra.flux_analysis import single_reaction_deletion

sr_deletion = single_reaction_deletion(model)
sr_deletion.columns = ["growth", "status"]
sr_deletion["is_essential"] = sr_deletion["growth"] < 0.05 * wt_growth
essential_rxns = sr_deletion[sr_deletion["is_essential"]]
print(f"Essential reactions: {len(essential_rxns)} / {len(model.reactions)}")
sr_deletion.to_csv("reaction_essentiality.csv")
Step 4 — Phenotypic Phase Plane (PPP)

The PPP maps growth rate over a 2D grid of two nutrient uptake rates, revealing metabolic phase transitions (aerobic growth, mixed-acid fermentation, etc.).

python
from cobra.flux_analysis import production_envelope

# Phase plane: glucose uptake vs. oxygen uptake
ppp = production_envelope(
    model,
    ["EX_glc__D_e", "EX_o2_e"],   # x and y axes
    objective=model.reactions.get_by_id("BIOMASS_Ec_iJO1366_core_53p95M"),
    points=20,
)

print(ppp.head())

# Plot heatmap
fig, ax = plt.subplots(figsize=(8, 6))
pivot = ppp.pivot_table(
    index="EX_o2_e", columns="EX_glc__D_e", values="flux_maximum"
)
im = ax.imshow(pivot.values, aspect="auto", origin="lower",
               cmap="viridis",
               extent=[ppp["EX_glc__D_e"].min(), ppp["EX_glc__D_e"].max(),
                       ppp["EX_o2_e"].min(),    ppp["EX_o2_e"].max()])
plt.colorbar(im, ax=ax, label="Growth rate (h$^{-1}$)")
ax.set_xlabel("Glucose uptake (mmol/gDW/h)")
ax.set_ylabel("O$_2$ uptake (mmol/gDW/h)")
ax.set_title("Phenotypic Phase Plane")
fig.tight_layout()
fig.savefig("phenotypic_phase_plane.pdf", dpi=300)
fig.savefig("phenotypic_phase_plane.png", dpi=150)
plt.close(fig)
print("PPP saved to phenotypic_phase_plane.pdf")
Step 5 — Flux Sampling

Flux sampling explores the full space of feasible steady-state flux distributions, revealing which reactions have wide vs. narrow feasible ranges.

python
# OptGP sampler: Markov-chain Monte Carlo in flux cone
samples = cobra.sampling.sample(model, n=1000, method="optgp",
                                thinning=100, processes=4)
# samples is a DataFrame: rows = samples, columns = reaction IDs
samples.to_csv("flux_samples.csv", index=False)

# Violin plot for key central metabolism reactions
KEY_REACTIONS = ["PFK", "PGI", "PDH", "CS", "AKGDH",
                 "EX_glc__D_e", "EX_ac_e", "EX_co2_e"]
key_data = samples[[r for r in KEY_REACTIONS if r in samples.columns]]

fig, ax = plt.subplots(figsize=(10, 5))
ax.violinplot([key_data[c].values for c in key_data.columns],
              positions=range(len(key_data.columns)),
              showmedians=True)
ax.set_xticks(range(len(key_data.columns)))
ax.set_xticklabels(key_data.columns, rotation=45, ha="right")
ax.set_ylabel("Flux (mmol/gDW/h)")
ax.set_title("Flux Sampling Distribution (n=1000)")
fig.tight_layout()
fig.savefig("flux_sampling_violin.pdf", dpi=300)
plt.close(fig)
print("Flux sampling violin plot saved.")
Step 6 — Pathway-Level Flux Aggregation

Group reactions by metabolic subsystem and compute total absolute flux per pathway — a proxy for pathway activity.

python
pathway_flux = {}

for rxn in model.reactions:
    subsystem = rxn.subsystem or "Unknown"
    flux_val = abs(fba_fluxes.get(rxn.id, 0.0))
    pathway_flux[subsystem] = pathway_flux.get(subsystem, 0.0) + flux_val

pathway_df = (pd.Series(pathway_flux, name="total_abs_flux")
              .sort_values(ascending=False)
              .reset_index()
              .rename(columns={"index": "subsystem"}))

pathway_df.to_csv("pathway_flux_summary.csv", index=False)

# Bar chart of top 15 pathways
top15 = pathway_df.head(15)
fig, ax = plt.subplots(figsize=(10, 6))
ax.barh(top15["subsystem"][::-1], top15["total_abs_flux"][::-1],
        color="steelblue")
ax.set_xlabel("Sum of |flux| (mmol/gDW/h)")
ax.set_title("Top 15 Pathway Activities (FBA)")
fig.tight_layout()
fig.savefig("pathway_activity.pdf", dpi=300)
plt.close(fig)
print("Pathway activity chart saved.")
Step 7 — Secretion Product Prediction

Identify exchange reactions carrying positive flux (secretion) at optimal growth — these are by-products and potential products of interest.

python
secretion = {}

for rxn in model.exchanges:
    flux = fba_fluxes.get(rxn.id, 0.0)
    if flux > 1e-6:   # positive = secretion
        met = list(rxn.metabolites)[0]
        secretion[rxn.id] = {
            "metabolite": met.name,
            "formula": met.formula,
            "flux_mmol_gDW_h": flux,
        }

sec_df = pd.DataFrame(secretion).T.sort_values("flux_mmol_gDW_h",
                                                ascending=False)
print("\nSecreted products:")
print(sec_df.to_string())
sec_df.to_csv("secretion_profile.csv")

Key Conventions

AnalysisLethality ThresholdStandard Reference
Single gene deletiongrowth < 5% WTJoyce & Palsson, 2006
Double gene deletion (synthetic lethal)growth < 5% WTDeutscher et al., 2008
Reaction deletiongrowth < 5% WTConsistent with gene deletion
PPP nutrient grid0–20 mmol/gDW/h, 50 stepsCOBRApy default
Flux sampling (OptGP)n = 1000, thinning = 100Megchelenbrink et al., 2014
Show full SKILL.md (134 more words)Show less
Output File Conventions
FileContent
gene_essentiality.csvPer-gene growth fraction and essentiality flag
double_gene_essentiality.csvPairwise synthetic lethality matrix
reaction_essentiality.csvPer-reaction growth fraction and essentiality flag
phenotypic_phase_plane.pdf2D heatmap of growth vs. two nutrients
flux_samples.csvRaw 1000-sample flux matrix
flux_sampling_violin.pdfViolin plot of key reaction distributions
pathway_flux_summary.csvTotal absolute flux per metabolic subsystem
pathway_activity.pdfBar chart of top 15 active pathways
secretion_profile.csvAll secreted by-products at optimal growth
Common Failure Modes
  • PPP returns all zeros: objective reaction ID does not match model; check model.objective.expression for correct reaction ID.
  • Flux sampling ACHR crashes: optgp (default) is more stable for large models; for models with >5000 reactions use processes=1 to debug.
  • No secretion products: model may be forced to be strictly aerobic with all carbon converted to CO2; verify exchange bounds allow secretion (ub = 1000 on exchange reactions).

© aiming-lab, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in external/agents/Biology-Agent/skills/flux-analyzer of aiming-lab/AutoResearchClaw.

Open the folder on GitHubat commit be4ba47

Compare with similar skills

FBA Flux Analyzer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

FBA Flux Analyzer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
FBA Flux Analyzer this skillaiming-lab/AutoResearchClaw15k—~2.3kAutomated safety check: PassMIT
deepTools NGS Toolkitdavila7/claude-code-templates32k13 repos~4.5kAutomated safety check: PassMIT
Bio Copy Number Cnv Visualizationmajiayu000/claude-skill-registry6661 repos~2kAutomated safety check: PassMIT
Bio Metagenomics VisualizationGPTomics/bioSkills1.2k1 repos~3.7kAutomated safety check: PassMIT
Bio Phylo Tree ManipulationGPTomics/bioSkills1.2k1 repos~5kAutomated safety check: PassMIT
Bio Proteomics Differential AbundanceGPTomics/bioSkills1.2k1 repos~5.7kAutomated safety check: PassMIT

Similar skills

  • deepTools NGS Toolkit

    davila7/claude-code-templates

    Guides use of deepTools on sequencing data: BAM to bigWig conversion, QC, sample correlation, and heatmaps or profiles around TSS and peaks for ChIP-seq, RNA-seq and ATAC-seq.

    32k GitHub starsUsed in 13 repos~4.5k tokens
    Research & ScienceAuto-check passed
  • Bio Copy Number Cnv Visualization

    majiayu000/claude-skill-registry

    Visualize copy number profiles, segments, and compare across samples.

    666 GitHub starsUsed in 1 repo~2k tokens
    Research & ScienceAuto-check passed
  • Turns a shotgun profiler table (MetaPhlAn relative abundance, Bracken counts, HUMAnN function tables) into honest figures and defensible community statistics with phyloseq, vegan, microViz, and…

    1.2k GitHub starsUsed in 1 repo~3.7k tokens
    Data & AnalyticsAuto-check passed
  • Bio Phylo Tree Manipulation

    GPTomics/bioSkills

    Edit phylogenetic tree structure with Biopython Bio.Phylo, and treat rooting as a separate statistical inference rather than a display choice.

    1.2k GitHub starsUsed in 1 repo~5k tokens
    Research & ScienceAuto-check passed
  • Tests for differentially abundant proteins between conditions with limma/DEqMS empirical-Bayes moderation, proDA/msqrob2/MSstats missingness modeling, and Python Welch+BH alternatives.

    1.2k GitHub starsUsed in 1 repo~5.7k tokens
    Data & AnalyticsAuto-check passed
  • Experiment Lab

    Citrus-bit/Anaxa

    A skill your agent uses whenever the user wants reproducible CS/AI experiments, model evaluation, regression/classification/clustering analyses, bioinformatics workflows, QC, differential…

    120 GitHub stars~2.1k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed

More from aiming-lab/AutoResearchClaw

All 34 skills in this repo
  • A-Evolve Agent Improvement

    aiming-lab/AutoResearchClaw

    Diagnoses where an agent failed across runs and turns the findings into new skills, system prompt patches and knowledge entries, using the A-Evolve loop.

    15k GitHub stars~1.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Metabolic Study Planner

    aiming-lab/AutoResearchClaw

    Turns a broad metabolic modelling topic into a concrete, paper-shaped plan with organism, model, perturbations, metrics and figures before any FBA code is written.

    15k GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • MFA Pipeline Orchestrator

    aiming-lab/AutoResearchClaw

    Runs a metabolic flux analysis from model loading to phenotype prediction and figures by handing work to four sub-agents in sequence.

    15k GitHub stars~923 tokensUpdated 1 mo ago
    Auto-check passed
  • Qiskit 2.x Quantum ML Reference

    aiming-lab/AutoResearchClaw

    Reference patterns for writing qiskit 2.x code for variational quantum machine learning: feature maps, VQC training, VQE for chemistry, MPS circuits and noise models.

    15k GitHub stars~4.7k tokensUpdated 1 mo ago
    Auto-check passed
  • Genome-Scale Metabolic Model Builder

    aiming-lab/AutoResearchClaw

    Builds or loads a genome-scale metabolic model in COBRApy, sets its growth medium and objective, and exports it as a validated JSON file for flux analysis.

    15k GitHub stars~1.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Biopython Bioinformatics

    aiming-lab/AutoResearchClaw

    Quick reference for Biopython work: sequence operations, SeqIO file parsing, BLAST searches, Entrez queries, phylogenetic trees and PDB structure analysis.

    15k GitHub stars~810 tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about FBA Flux Analyzer

What does FBA Flux Analyzer do?

Turns raw flux balance analysis output and a COBRApy model into gene essentiality maps, phenotypic phase planes, flux sampling results, pathway summaries and secretion predictions. The skill works directly on FBA result files and a COBRApy model through a seven-step workflow.io, then runs single and double gene essentiality analysis using single_gene_deletion and double_gene_deletion, treating a gene as essential when its deletion drops growth below 5% of wild-type, a widely used lethality threshold.

When should I use FBA Flux Analyzer?

FBA Flux Analyzer fits situations like: finding which genes or reactions are essential in a metabolic model; mapping a phenotypic phase plane across two nutrient uptake rates; sampling the feasible flux space of an FBA model to see which reactions vary most; predicting which metabolites a model secretes at its optimal growth rate.

How do I install FBA Flux Analyzer in Claude Code?

Run `npx skills add aiming-lab/AutoResearchClaw --skill flux-analyzer -a claude-code`. Or copy the skill folder (external/agents/Biology-Agent/skills/flux-analyzer in aiming-lab/AutoResearchClaw) into .claude/skills/flux-analyzer in your project. Claude Code loads it when a task matches its description.

How do I install FBA Flux Analyzer in Codex?

Run `npx skills add aiming-lab/AutoResearchClaw --skill flux-analyzer -a codex`. Or copy the skill folder (external/agents/Biology-Agent/skills/flux-analyzer in aiming-lab/AutoResearchClaw) into .agents/skills/flux-analyzer in your project. Codex loads it when a task matches its description.

Can I use FBA Flux Analyzer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aiming-lab/AutoResearchClaw --skill flux-analyzer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/flux-analyzer, .gemini/skills/flux-analyzer, .github/skills/flux-analyzer and .opencode/skills/flux-analyzer in your project.

What does FBA Flux Analyzer need to run?

SKILL.md names no scripts, command-line tools or credentials: FBA Flux Analyzer is instructions for the agent only. Our summary lists: Python with COBRApy.

Does FBA Flux Analyzer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is FBA Flux Analyzer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does FBA Flux Analyzer use?

FBA Flux Analyzer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does FBA Flux Analyzer use?

About 2.3k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to FBA Flux Analyzer?

Skills that share tags, products or a category with FBA Flux Analyzer: deepTools NGS Toolkit (davila7/claude-code-templates, 32k stars), Bio Copy Number Cnv Visualization (majiayu000/claude-skill-registry, 666 stars), Bio Metagenomics Visualization (GPTomics/bioSkills, 1.2k stars) and Bio Phylo Tree Manipulation (GPTomics/bioSkills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains FBA Flux Analyzer?

aiming-lab (a GitHub organization) maintains it in aiming-lab/AutoResearchClaw, which has 14,595 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on August 19, 2026.

Source: aiming-lab/AutoResearchClaw on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.