systems-biology/community-metabolic-modeling/SKILL.md
Builds and simulates multi-species metabolic community models from member genome-scale models, using MICOM for abundance-weighted steady-state community FBA and cooperative tradeoff, SMETANA for cross-feeding and competition scoring, and SteadyCom/COMETS for common-growth-rate and dynamic simulation. Use when modeling a microbiome or co-culture, predicting cross-feeding and competition, abundance-weighting members from metagenomics, choosing steady-state vs dynamic community modeling, avoiding the compartment-pooling artifact, or judging how member-model quality and namespace propagate into community predictions.
npx skillsauth add GPTomics/bioSkills bio-systems-biology-community-metabolic-modelingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reference examples tested with: MICOM 0.33+, COBRApy 0.29+, Python 3.10+ (SMETANA and COMETS are separate installs)
Before using code patterns, verify installed versions match. If versions differ:
pip show <package> then help(module.function) to check signaturesIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Note: community FBA needs a QP solver for MICOM's cooperative tradeoff (HiGHS/CPLEX/Gurobi). Member models must share a namespace (BiGG vs ModelSEED), reconciled via MetaNetX before combining. SMETANA is a separate CLI (github.com/cdanielmachado/smetana); COMETS uses the cometspy toolbox.
"Model the metabolism of my microbial community" -> Combine member genome-scale models into a community, then predict community growth, individual growth rates, and metabolite exchange (cross-feeding and competition) under a shared medium.
micom.Community(taxonomy).cooperative_tradeoff() (steady-state, abundance-weighted); SMETANA (cross-feeding scores); COMETS (dynamic)Two things dominate whether a community prediction means anything:
A further modeling fork: steady-state community FBA (SteadyCom, MICOM) assumes a stable coexistence with a common community growth rate, while dynamic simulation (COMETS, BacArena) resolves the time course and spatial structure but is expensive and parameter-hungry. Neither predicts the other's regime.
| Goal | Tool | Approach / trade-off | |------|------|----------------------| | Metagenome-scale gut community, abundance-weighted, steady state | MICOM (Python) | community FBA with cooperative tradeoff (community vs individual growth); scales to many taxa from abundances | | Cross-feeding / competition SCORES between members | SMETANA (CLI) | MRO (resource overlap = competition), MIP (interaction potential = cooperation), per-metabolite scores; pairs with CarveMe | | Coexistence at a common community growth rate | SteadyCom | enforces one shared growth rate; elegant steady-state coexistence model | | Time course / spatial dynamics, diffusion | COMETS / BacArena | dynamic (COMETS) or individual-based spatial (BacArena) FBA; realistic but expensive/parameter-hungry |
Do not model a community as one pooled "bag" model; use a tool that keeps members compartmentalized and connects them through a shared extracellular medium.
Goal: Combine member models (weighted by their metagenomic abundance) and predict community and per-member growth under a medium.
Approach: Assemble a taxonomy table (one row per taxon with an id, a model file, and an abundance), build the Community (which compartmentalizes members correctly), and solve with cooperative tradeoff - which finds a community growth optimum while spreading growth across members rather than letting one taxon dominate. Reserve the fraction argument to trade community optimum against individual growth.
from micom import Community
from micom.data import test_taxonomy
# taxonomy: columns id, file (per-taxon SBML), and abundance (from metagenomics). test_taxonomy()
# ships a ready E. coli example community.
taxonomy = test_taxonomy()
community = Community(taxonomy) # builds the compartmentalized multi-species model
solution = community.cooperative_tradeoff(fraction=1.0) # QP; needs HiGHS/CPLEX/Gurobi
print('community growth rate:', solution.growth_rate)
print(solution.members[['growth_rate']]) # per-taxon growth; NaN row is the shared medium
# SMETANA (separate install) scores interactions between member models built by CarveMe:
# pip install smetana # then:
# smetana model1.xml model2.xml -o community --flavor bigg
# Outputs: MRO (metabolic resource overlap = competition for shared nutrients),
# MIP (metabolic interaction potential = potential cooperation/cross-feeding),
# and per-metabolite SMETANA scores (who feeds whom). A high MIP with low MRO
# suggests cooperative cross-feeding; high MRO suggests competition.
# For the time course rather than a steady state, COMETS (cometspy) runs dynamic FBA on a lattice
# with metabolite diffusion. Use when the QUESTION is temporal (succession, diauxie, spatial
# structure), not a coexistence steady state. It is far more expensive and needs kinetic parameters
# (uptake Vmax/Km, initial biomass, diffusion constants) that a steady-state model does not.
| Symptom | Cause | Fix |
|---------|-------|-----|
| Cross-feeding predicted that needs no secretion | compartment pooling (single shared internal pool) | use MICOM/SteadyCom (compartmentalized); connect members only via a shared extracellular medium |
| Members will not exchange metabolites | namespace mismatch (BiGG vs ModelSEED IDs) | reconcile member models via MetaNetX before combining |
| Community growth nonsensical | a member model is broken (bad biomass, energy cycle) | curate each member first; a bad member poisons the community |
| cooperative_tradeoff errors on solver | it is a QP and GLPK cannot solve it | use HiGHS (bundled), CPLEX, or Gurobi |
| One taxon takes all the growth | plain community-max FBA has alternate optima | use cooperative tradeoff (spreads growth) and set abundances from data |
| Dynamic run is impossibly slow | COMETS/BacArena are expensive and parameter-hungry | use a steady-state method unless the question is genuinely temporal/spatial |
tools
End-to-end CLIP-seq pipeline from FASTQ to ENCODE-compliant binding sites, single-nucleotide crosslink maps, annotation, motifs, and (optionally) differential binding. Use when running the full Yeo lab eCLIP / iCLIP / iCLIP2 / iCLIP3 / irCLIP / PAR-CLIP analysis with SMInput control, protocol-specific UMI extraction, ENCODE STAR parameters, CLIPper or Skipper peak calling with stringent log2 FC and -log10 p thresholds, IDR rescue and self-consistency QC, and downstream motif registration with mCross or PEKA.
development
Detect, date, and contextualize whole-genome duplication (WGD / paleopolyploidy) events using wgd v2 (Chen et al 2024), KsRates (Sensalari 2022 substitution-rate-corrected Ks dating), DupGen_finder (Qiao 2019), MAPS (Li 2018 phylogenomic), POInT (Conant 2008 ordered-block), SLEDGe (2024 ML-based), Whale.jl (Bayesian DL+WGD), and synteny-anchored paranome construction. Use when identifying ancient polyploidy from Ks distributions and synteny block analysis, positioning WGD events relative to speciation, distinguishing tandem from segmental from WGD duplications, dating the 2R/3R vertebrate / fish / salmonid WGDs, building paranome and Ks-age mixture models, applying KsRates substitution-rate correction across lineages, or testing alternative biased-fractionation / dosage-balance models post-WGD.
tools
Build whole-genome alignments using Progressive Cactus (Armstrong 2020 reference-free clade-level WGA), Minigraph-Cactus (Hickey 2024 pangenome-aware), LASTZ chain/net (UCSC pipeline), MUMmer4 (Marçais 2018 pairwise), minimap2 -x asm5/10/20 (Li 2018 fast pairwise), AnchorWave (Song 2022 WGD-aware), and Mauve / progressiveMauve (bacterial). Operates the HAL toolkit (Hickey 2013) for downstream extraction including halSynteny, halLiftover, halBranchMutations, and hal2maf. Use when constructing multi-species alignments for comparative-annotation projection (TOGA), synteny detection, conservation analyses (phyloP / PhastCons), or pangenome graph construction; selecting between reference-free (Cactus) and reference-anchored (LASTZ chains/nets) approaches; tuning sensitivity for closely vs distantly related genomes; or producing HAL files for genome-wide downstream tools.
development
Detect syntenic blocks and structural rearrangements between genomes using MCScanX (Wang 2012), JCVI/MCScan (Tang 2008 Python), GENESPACE (Lovell 2022) for orthology-anchored riparian visualization, SyRI for structural variation, AnchorWave for sequence-level synteny, i-ADHoRe 3.0 for highly diverged species, SynNet for synteny networks, and ntSynt for multi-genome macrosynteny. Use when identifying collinear gene blocks across species, distinguishing macrosynteny from microsynteny, detecting inversions/translocations/duplications, anchoring orthology in WGD lineages, producing publication riparian plots, computing synteny block age via Ks (cross-references whole-genome-duplication), or running synteny-aware ortholog inference in polyploids.