Agent skill

Genome-Scale Metabolic Model Validator

by aiming-lab in aiming-lab/AutoResearchClaw

Runs quality control on a COBRApy genome-scale metabolic model before flux analysis, checking mass and charge balance, biomass feasibility, dead ends, thermodynamic loops and GPR rules.

MITAuto-check passedResearch & Science

Install Genome-Scale Metabolic Model Validator

skills CLI
$ npx skills add aiming-lab/AutoResearchClaw --skill gsmm-validator -a claude-code

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

GitHub CLI
$ gh skill install aiming-lab/AutoResearchClaw gsmm-validator --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/gsmm-validator .claude/skills/gsmm-validator && 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
gsmm-validator
GitHub stars
15k
Token cost
~2k tokens
SKILL.md length
283 words
Files
1
Skills in repo
34
Repo updated
First seen
Licence
MIT

At a glance

Runs quality control on a COBRApy genome-scale metabolic model before flux analysis, checking mass and charge balance, biomass feasibility, dead ends, thermodynamic loops and GPR rules.

  • Works in 8 steps: Load the Model → Mass and Charge Balance Check → Biomass Producibility (FBA Feasibility) → …
  • Checking a genome-scale metabolic model for errors before running flux analysis
  • 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 exists because an invalid metabolic model silently produces biologically meaningless flux results, so it validates the model first across six categories: mass and charge balance per reaction, feasibility and biomass production through flux balance analysis, dead-end metabolites, stoichiometric consistency, thermodynamic loop detection, and gene-protein-reaction rule integrity.

Its workflow loads the model with cobra.io, then walks through each check in order: computing elemental balance per reaction to catch the most common modeling errors, running model.optimize() to confirm biomass is actually producible, and flagging a metabolite as a dead end when it is produced by some reaction but consumed by none, or the reverse, since dead ends create infeasibility elsewhere in the network. The result is a structured validation report listing errors and warnings by category rather than a single pass or fail verdict.

When your agent uses it

  • Checking a genome-scale metabolic model for errors before running flux analysis
  • Finding dead-end metabolites that would make parts of a model infeasible
  • Validating GPR rule formatting and stoichiometric consistency in a COBRApy model

Example prompts

  • “Validate this COBRApy model before I run flux balance analysis on it.”
  • “Check this metabolic model for dead-end metabolites and mass balance errors.”
  • “Run the GPR rule and thermodynamic loop checks on my genome-scale model.”

Requirements

  • Python with COBRApy

Workflow steps

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

  1. Load the Model
  2. Mass and Charge Balance Check
  3. Biomass Producibility (FBA Feasibility)
  4. Dead-End Metabolite Detection
  5. Blocked Reaction Detection
  6. Thermodynamic Loop Detection (Loopless FBA)
  7. GPR Rule Validation
  8. Write Validation Report

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

Genome-Scale Metabolic Model Validator loads about 2k tokens when it runs. Until then it costs about 68 tokens; SKILL.md has 283 words of instructions outside code blocks.

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

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). 283 words, ~2,005 tokens.

Download SKILL.mdSave it as .claude/skills/gsmm-validator/SKILL.md (or your agent's skills folder).
name
gsmm-validator
description
Validate a COBRApy genome-scale metabolic model for mass/charge balance, stoichiometric consistency, biomass producibility, dead-end metabolites, thermodynamic loops, and GPR rule formatting. Outputs a structured validation report with errors and warnings.
metadata.category
domain
metadata.trigger-keywords
metabolic,COBRApy,model validation,mass balance,charge balance,dead-end metabolites,biomass growth,thermodynamic loops,GPR
metadata.applicable-stages
9,10,12,13,14,20
metadata.priority
2

Overview

The gsmm-validator skill performs rigorous quality control on a COBRApy Model before it enters any flux analysis pipeline. An invalid model silently produces biologically meaningless fluxes; validation catches structural errors early.

Validation covers six categories: (1) mass/charge balance, (2) feasibility and biomass production, (3) dead-end metabolites, (4) stoichiometric consistency, (5) thermodynamic loop detection, and (6) GPR rule integrity.


Workflow

Step 1 — Load the Model
python
import cobra
import cobra.io

model = cobra.io.load_json_model("my_model.json")
print(f"Loaded: {model.id} ({len(model.reactions)} reactions)")
Step 2 — Mass and Charge Balance Check

Unbalanced reactions are among the most common modelling errors. COBRApy computes elemental balance per reaction.

python
errors = []
warnings = []

print("=== Mass/Charge Balance ===")
for rxn in model.reactions:
    # Returns dict like {"C": -1, "H": 2} if imbalanced; empty dict if OK
    imbalance = rxn.check_mass_balance()
    if imbalance:
        # Exchange and demand reactions are expected to be imbalanced
        if rxn.id.startswith(("EX_", "DM_", "SK_", "BIOMASS")):
            warnings.append(f"WARN  [{rxn.id}] boundary reaction imbalanced "
                            f"(expected): {imbalance}")
        else:
            errors.append(f"ERROR [{rxn.id}] mass/charge imbalance: "
                          f"{imbalance}")

for msg in errors + warnings:
    print(msg)
print(f"  {len(errors)} error(s), {len(warnings)} warning(s)")
Step 3 — Biomass Producibility (FBA Feasibility)
python
print("\n=== Biomass Producibility ===")
solution = model.optimize()

if solution.status != "optimal":
    errors.append(f"ERROR Model is {solution.status} — "
                  f"cannot produce biomass under current medium.")
    print(f"  FAIL: {solution.status}")
elif solution.objective_value < 1e-6:
    errors.append("ERROR Growth rate is effectively zero "
                  "(< 1e-6 h^-1). Check medium and objective reaction.")
    print(f"  FAIL: growth = {solution.objective_value:.6f} h^-1")
else:
    print(f"  PASS: growth = {solution.objective_value:.4f} h^-1")
Step 4 — Dead-End Metabolite Detection

A metabolite is a dead-end if it is produced by at least one reaction but consumed by none, or vice versa. Dead-ends create infeasibility in network regions.

python
from cobra.manipulation import find_blocked_reactions

print("\n=== Dead-End Metabolites ===")
dead_end_mets = []

for met in model.metabolites:
    producers = [r for r in met.reactions
                 if r.get_coefficient(met) > 0]
    consumers = [r for r in met.reactions
                 if r.get_coefficient(met) < 0]

    if producers and not consumers:
        dead_end_mets.append((met.id, "produced but never consumed"))
    elif consumers and not producers:
        dead_end_mets.append((met.id, "consumed but never produced"))

if dead_end_mets:
    for met_id, reason in dead_end_mets:
        warnings.append(f"WARN  [{met_id}] dead-end: {reason}")
    print(f"  {len(dead_end_mets)} dead-end metabolite(s) found")
else:
    print("  PASS: no dead-end metabolites")

for msg in warnings[-len(dead_end_mets):]:
    print(f"  {msg}")
Step 5 — Blocked Reaction Detection
python
from cobra.flux_analysis import find_blocked_reactions

print("\n=== Blocked Reactions ===")
blocked = find_blocked_reactions(model, open_exchanges=True)

if blocked:
    warnings.append(f"WARN  {len(blocked)} blocked reaction(s): "
                    f"{blocked[:5]} ...")
    print(f"  {len(blocked)} blocked reactions (cannot carry flux)")
else:
    print("  PASS: no blocked reactions")
Step 6 — Thermodynamic Loop Detection (Loopless FBA)

Energy-generating cycles violate thermodynamics and inflate apparent fluxes.

python
print("\n=== Thermodynamic Loops ===")
try:
    loopless_solution = cobra.flux_analysis.loopless_solution(model)
    standard_solution = model.optimize()

    # Compare objective values; large discrepancy suggests loop inflation
    delta = abs(loopless_solution.objective_value
                - standard_solution.objective_value)
    if delta > 0.01:
        warnings.append(
            f"WARN  Loop detected: standard FBA growth "
            f"{standard_solution.objective_value:.4f} vs loopless "
            f"{loopless_solution.objective_value:.4f} (delta={delta:.4f})"
        )
        print(f"  WARN: possible thermodynamic loops (delta={delta:.4f})")
    else:
        print(f"  PASS: no significant loops (delta={delta:.6f})")
except Exception as exc:
    warnings.append(f"WARN  Loopless FBA failed: {exc}")
    print(f"  SKIP: loopless FBA unavailable ({exc})")
Step 7 — GPR Rule Validation

Gene-Protein-Reaction associations must use valid gene IDs and boolean logic.

python
import re

print("\n=== GPR Rule Integrity ===")
all_gene_ids = {g.id for g in model.genes}
gpr_errors = []

for rxn in model.reactions:
    gpr = rxn.gene_reaction_rule
    if not gpr:
        continue  # spontaneous or non-enzymatic reactions are fine

    # Extract gene IDs referenced in GPR
    referenced = set(re.findall(r"[A-Za-z0-9_\-\.]+", gpr))
    # Remove boolean keywords
    referenced -= {"and", "or", "not", "AND", "OR", "NOT"}

    missing = referenced - all_gene_ids
    if missing:
        gpr_errors.append(f"ERROR [{rxn.id}] GPR references unknown genes: "
                          f"{missing}")

if gpr_errors:
    errors.extend(gpr_errors)
    print(f"  {len(gpr_errors)} GPR error(s)")
else:
    print("  PASS: all GPR rules reference valid gene IDs")
Step 8 — Write Validation Report
python
import json
from datetime import datetime

report = {
    "model_id": model.id,
    "timestamp": datetime.utcnow().isoformat() + "Z",
    "n_reactions": len(model.reactions),
    "n_metabolites": len(model.metabolites),
    "n_genes": len(model.genes),
    "growth_rate": (solution.objective_value
                    if solution.status == "optimal" else None),
    "status": "FAIL" if errors else "PASS",
    "errors": errors,
    "warnings": warnings,
}

with open("validation_report.json", "w") as f:
    json.dump(report, f, indent=2)

print(f"\n=== Summary ===")
print(f"  Status   : {report['status']}")
print(f"  Errors   : {len(errors)}")
print(f"  Warnings : {len(warnings)}")
print("  Report written to validation_report.json")

Key Conventions

CheckFailure ConditionSeverity
Mass balanceNon-exchange reaction has elemental imbalanceERROR
Biomass producibilitysolution.status != "optimal" or growth < 1e-6ERROR
Dead-end metabolitesProduced but never consumed (or vice versa)WARNING
Blocked reactionsReaction carries zero flux under all conditionsWARNING
Thermodynamic loopsStandard FBA growth >> loopless FBA growthWARNING
GPR integrityGPR string references gene IDs not in model.genesERROR
Interpretation Guide
  • ERROR — must fix before proceeding to FBA. These cause incorrect results.
  • WARNING — may indicate incomplete reconstruction; investigate per case.
  • Boundary reactions (EX_, DM_, SK_, BIOMASS) are excluded from mass balance errors because they intentionally have no counter-reaction.
  • A model with only warnings is acceptable for exploratory FBA but should be corrected for publication-quality analysis.

© 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/gsmm-validator of aiming-lab/AutoResearchClaw.

Open the folder on GitHubat commit be4ba47

Compare with similar skills

Genome-Scale Metabolic Model Validator 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.

Genome-Scale Metabolic Model Validator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Genome-Scale Metabolic Model Validator this skillaiming-lab/AutoResearchClaw15k—~2kAutomated safety check: PassMIT
13C Metabolic Flux AnalysisK-Dense-AI/scientific-agent-skills48k1 repos~3.2kAutomated safety check: PassMIT
Alphagenome Single Variant Analysisgoogle-deepmind/science-skills3.2k2 repos~3kAutomated safety check: NotesApache-2.0
Singlecell Qcxuzhougeng/wisp-science1k—~1.6kAutomated safety check: PassAGPL-3.0
Trackplotygidtu/trackplot109—~1.9kAutomated safety check: PassBSD-3-Clause
UniProt Database Accessdavila7/claude-code-templates32k15 repos~1.7kAutomated safety check: PassMIT

Similar skills

  • 13C Metabolic Flux Analysis

    K-Dense-AI/scientific-agent-skills

    Estimates reaction fluxes inside cells from steady-state carbon-13 labeling data with a bundled mfapy-based solver, and reports which fluxes the data pin down.

    48k GitHub starsUsed in 1 repo~3.2k tokens
    Research & ScienceAuto-check passed
  • Alphagenome Single Variant Analysis

    google-deepmind/science-skills

    Analyzes genetic variant effects on gene expression (RNA-seq), chromatin accessibility (DNASE), histone marks (ChIP), and transcription factors using the AlphaGenome API.

    3.2k GitHub starsUsed in 2 repos~3k tokens
    Research & ScienceAuto-check: notes
  • Singlecell Qc

    xuzhougeng/wisp-science

    A skill your agent uses when designing, reviewing, or implementing single-cell RNA-seq QC in Python or R with a human-in-the-loop, data-driven approach.

    1k GitHub stars~1.6k tokensUpdated today
    Research & ScienceAuto-check passed
  • Trackplot

    ygidtu/trackplot

    Generate sashimi-style genome visualization plots (coverage, line, heatmap, IGV read-by-read, HiC, circRNA, motif) from BAM/bigWig/depth/HiC inputs.

    109 GitHub stars~1.9k tokensUpdated 12 days ago
    Research & ScienceAuto-check passed
  • UniProt Database Access

    davila7/claude-code-templates

    Queries the UniProt REST API directly to search proteins, fetch FASTA sequences, map IDs between databases and read Swiss-Prot and TrEMBL entries.

    32k GitHub starsUsed in 15 repos~1.7k tokens
    Research & ScienceAuto-check passed
  • End-to-end 10x Visium spatial transcriptomics analysis workflow with staged execution and human review gates.

    101 GitHub stars~1.4k 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 Genome-Scale Metabolic Model Validator

What does Genome-Scale Metabolic Model Validator do?

Runs quality control on a COBRApy genome-scale metabolic model before flux analysis, checking mass and charge balance, biomass feasibility, dead ends, thermodynamic loops and GPR rules. The skill exists because an invalid metabolic model silently produces biologically meaningless flux results, so it validates the model first across six categories: mass and charge balance per reaction, feasibility and biomass production through flux balance analysis, dead-end metabolites, stoichiometric consistency, thermodynamic loop detection, and gene-protein-reaction rule integrity.

When should I use Genome-Scale Metabolic Model Validator?

Genome-Scale Metabolic Model Validator fits situations like: checking a genome-scale metabolic model for errors before running flux analysis; finding dead-end metabolites that would make parts of a model infeasible; validating GPR rule formatting and stoichiometric consistency in a COBRApy model.

How do I install Genome-Scale Metabolic Model Validator in Claude Code?

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

How do I install Genome-Scale Metabolic Model Validator in Codex?

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

Can I use Genome-Scale Metabolic Model Validator 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 gsmm-validator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gsmm-validator, .gemini/skills/gsmm-validator, .github/skills/gsmm-validator and .opencode/skills/gsmm-validator in your project.

What does Genome-Scale Metabolic Model Validator need to run?

SKILL.md names no scripts, command-line tools or credentials: Genome-Scale Metabolic Model Validator is instructions for the agent only. Our summary lists: Python with COBRApy.

Does Genome-Scale Metabolic Model Validator 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 Genome-Scale Metabolic Model Validator 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 Genome-Scale Metabolic Model Validator use?

Genome-Scale Metabolic Model Validator 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 Genome-Scale Metabolic Model Validator use?

About 2k tokens (SKILL.md is roughly 8k 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 Genome-Scale Metabolic Model Validator?

Skills that share tags, products or a category with Genome-Scale Metabolic Model Validator: 13C Metabolic Flux Analysis (K-Dense-AI/scientific-agent-skills, 48k stars), Alphagenome Single Variant Analysis (google-deepmind/science-skills, 3.2k stars), Singlecell Qc (xuzhougeng/wisp-science, 1k stars) and Trackplot (ygidtu/trackplot, 109 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Genome-Scale Metabolic Model Validator?

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.