
Flux Analyzer
Analyse FBA flux distributions to extract biological insights.
Install
npx skills add aiming-lab/AutoResearchClaw --skill flux-analyzer -g -a claude-code -y- Repository
- aiming-lab/AutoResearchClaw14.8k
- Category
- Engineering
- Updated
- 3mo ago
- License
- MIT
- Context cost
- Mediumabout 2,116 tokens
- Runs scripts
- No, instructions only
What it does
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.
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
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.
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")
