[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EG0NX6E14J415RW4MMD5BZ":3,"skill-same:01M7EG0NX6E14J415RW4MMD5BZ":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EG0NX6E14J415RW4MMD5BZ","bio-systems-biology-gene-essentiality",null,"Performs in-silico single and double gene deletions, condition-dependent essentiality, and synthetic-lethality screens on genome-scale metabolic models with COBRApy, evaluating gene-protein-reaction rules and comparing FBA re-optimization against MOMA\u002FROOM minimal-adjustment. Use when predicting essential genes, finding synthetic-lethal pairs for drug targets, choosing a growth cutoff, deciding FBA vs MOMA vs ROOM for a knockout, making essentiality medium-specific to match an experiment, or validating predictions against Keio\u002FTn-seq\u002FCRISPR screens with MCC.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-systems-biology-gene-essentiality\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-systems-biology-gene-essentiality\ndescription: Performs in-silico single and double gene deletions, condition-dependent essentiality, and synthetic-lethality screens on genome-scale metabolic models with COBRApy, evaluating gene-protein-reaction rules and comparing FBA re-optimization against MOMA\u002FROOM minimal-adjustment. Use when predicting essential genes, finding synthetic-lethal pairs for drug targets, choosing a growth cutoff, deciding FBA vs MOMA vs ROOM for a knockout, making essentiality medium-specific to match an experiment, or validating predictions against Keio\u002FTn-seq\u002FCRISPR screens with MCC.\ntool_type: python\nprimary_tool: cobrapy\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"systems-biology\u002Fgene-essentiality\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: COBRApy 0.29+, Python 3.10+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\nNote: `single_gene_deletion` \u002F `double_gene_deletion` spawn worker processes, so call them inside `if __name__ == '__main__':` (or pass `processes=1`) or a spawn platform will recurse. `delete_model_genes` is deprecated since 0.25; use `knock_out_model_genes` \u002F `remove_genes`.\n\n# Gene Essentiality Analysis\n\n**\"Which genes are essential for growth in my organism?\"** -> Delete each gene (via its GPR rule), re-solve the model, and call a gene essential when its knockout drops predicted growth below a chosen cutoff - always relative to a specific model and medium.\n- Python: `cobra.flux_analysis.single_gene_deletion()`, `double_gene_deletion()`, `moma()`, `room()` (COBRApy)\n\n## The governing principle: essentiality is a model-and-medium prediction, not a gene property\n\nAn in-silico knockout answers \"can THIS network still make biomass on THIS medium after this perturbation?\" Everything else follows from taking that literally:\n\n- A gene knockout is NOT a reaction knockout. Genes map to reactions through the gene-protein-reaction (GPR) rule: AND = protein complex (all subunits needed), OR = isozymes (any one suffices). A gene in an OR with a viable partner does nothing when deleted - isozyme masking is the dominant source of false non-essential calls and the reason synthetic lethals exist. Always delete GENES and let the GPR decide which reactions close; deleting reactions directly is a different, usually wrong, analysis.\n- The essential\u002Fnon-essential CUTOFF is a policy choice, not a library default. COBRApy returns raw knockout growth rates; there is no `growth_cutoff` argument. The cutoff (commonly \u003C1-10% of wild type) moves the essential set in the \"sick but alive\" tail. It should be reported and swept (1\u002F2\u002F5\u002F10%); genes whose call flips are low-confidence hypotheses.\n- Essentiality is medium-dependent. Rich vs minimal media give different essential sets (a gene for a biosynthetic pathway is essential on minimal medium but dispensable when the product is supplied). To compare to an experiment, set the SAME medium the experiment used (LB vs M9), or the comparison is meaningless.\n- Predictions have a ceiling (~85-93% accuracy on E. coli metabolic genes). False essentials come from a missing bypass\u002Fisozyme in the model; false non-essentials come from biology FBA cannot see (regulation, toxicity, essential non-metabolic or structural roles). Report MCC, not accuracy - essential genes are the minority class, so accuracy is inflated by the true-negative pile.\n\n## Decision: which knockout method, which order\n\n| Goal | Method | Assumption \u002F when |\n|------|--------|-------------------|\n| Essential genes, evolved\u002Fadapted strain, or only hard lethality | FBA `single_gene_deletion` | mutant re-optimizes to max growth; cheapest; lethality calls agree with MOMA anyway |\n| Immediate\u002Ffresh transposon or CRISPR mutant (one growth cycle) | MOMA `moma` | mutant stays closest in flux space to wild type (QP); fits fresh-mutant fluxes better |\n| Fresh mutant where response is a few regulatory on\u002Foff switches | ROOM `room` | minimizes the NUMBER of significantly changed fluxes (MILP); recovers short bypasses |\n| Synthetic-lethal PAIRS | `double_gene_deletion` on viable singles | both single KOs viable, double lethal; O(n^2), restrict the gene list |\n| Higher-order lethal sets (triples\u002Fquads) | Fast-SL (flux-support pruning) | brute-force O(n^3+) infeasible; Fast-SL prunes by flux support |\n| Condition\u002Fmedium contrast | per-medium `single_gene_deletion` in `with model:` | essentiality re-computed under each defined medium |\n\nMOMA\u002FROOM classify lethality similarly to FBA; they differ mainly on the quantitative growth of sick-but-alive mutants. Match the method to the timescale of the actual experiment.\n\n## Single-Gene Deletion Screen\n\n**Goal:** Rank every gene by the growth defect of its knockout and flag essential and growth-reducing genes.\n\n**Approach:** Take wild-type growth once, then `single_gene_deletion` clamps each gene's reactions to zero through the GPR, re-optimizes, and returns a DataFrame with columns `ids` (a set holding the deleted gene id(s)), `growth`, and `status`. The caller applies the cutoff.\n\n```python\nimport cobra\nfrom cobra.flux_analysis import single_gene_deletion\n\nmodel = cobra.io.load_model('textbook')\nwt_growth = model.slim_optimize()\n\nresults = single_gene_deletion(model)          # DataFrame: ids (set of gene ids), growth, status\nresults['gene'] = results['ids'].apply(lambda s: list(s)[0])   # ids elements are gene-id STRINGS\nresults['relative'] = results['growth'] \u002F wt_growth\n\nESSENTIAL_CUTOFF = 0.01                          # KO grows \u003C 1% of WT -> essential (policy, not a default)\nessential = results[results['relative'] \u003C ESSENTIAL_CUTOFF]\nprint(f'Essential genes: {len(essential)} \u002F {len(model.genes)} on this medium')\n```\n\n## Classify with a threshold sweep (report low-confidence calls)\n\n```python\ndef classify_essentiality(results, wt_growth, cutoffs=(0.01, 0.02, 0.05, 0.10)):\n    '''Classify genes and report how many calls flip across cutoffs (the sick-tail sensitivity).'''\n    rel = results['growth'] \u002F wt_growth\n    calls = {c: set(results.loc[rel \u003C c, 'gene']) for c in cutoffs}\n    core = set.intersection(*calls.values())     # essential at every cutoff -> high confidence\n    boundary = set.union(*calls.values()) - core # call depends on the cutoff -> low confidence\n    return core, boundary\n```\n\n## MOMA \u002F ROOM: the immediate, non-re-optimized mutant\n\n```python\nfrom cobra.flux_analysis import moma, room\n\n# FBA assumes the mutant re-optimizes; a fresh knockout has not re-wired its regulation yet.\n# MOMA keeps mutant flux closest (Euclidean) to wild type; ROOM minimizes the count of changed\n# fluxes. Both need a wild-type reference solution and a QP\u002FMILP-capable solver.\nfrom cobra.util.solver import linear_reaction_coefficients\nbiomass = list(linear_reaction_coefficients(model))[0]   # the objective (biomass) reaction\nwt = model.optimize()\nwith model:\n    model.genes.get_by_id('b2276').knock_out()   # context-aware; reverts on block exit\n    moma_sol = moma(model, solution=wt, linear=True)      # linear=True = fast LP approximation (lMOMA)\n    # moma_sol.objective_value is the MINIMIZED ADJUSTMENT, not growth; read the biomass flux.\n    print('MOMA mutant growth:', moma_sol.fluxes[biomass.id])\n```\n\n## Synthetic Lethality (double deletions + epistasis)\n\n**Goal:** Find gene PAIRS that are viable singly but lethal together - redundant pathways and isozymes, and candidate combination drug targets.\n\n**Approach:** Restrict to genes whose single knockout is viable (a synthetic lethal requires both singles viable), run pairwise `double_gene_deletion`, and keep pairs whose double-KO growth falls below the cutoff. Cost is O(n^2), so subset the gene list. Score interactions against the multiplicative neutral expectation (independent effects on an exponential growth rate).\n\n```python\nfrom cobra.flux_analysis import double_gene_deletion\n\nviable = list(results.loc[results['relative'] > ESSENTIAL_CUTOFF, 'gene'])[:60]   # cap the O(n^2) sweep\ndbl = double_gene_deletion(model, gene_list1=viable, gene_list2=viable)\ndbl['n'] = dbl['ids'].apply(len)\nsl_pairs = dbl[(dbl['n'] == 2) & (dbl['growth'] \u002F wt_growth \u003C ESSENTIAL_CUTOFF)]\nprint(f'Synthetic-lethal pairs: {len(sl_pairs)}')\n# Genome-scale and higher-order (triple\u002Fquad) sets: use Fast-SL flux-support pruning (Pratapa 2015),\n# not brute force.\n```\n\n## Condition-Specific Essentiality (match the experiment's medium)\n\n**Goal:** Compare essential-gene sets across defined media to separate core-essential genes from condition-specific ones.\n\n**Approach:** Apply each medium inside a `with model:` block (so it reverts), run the deletion screen, and take intersections\u002Fdifferences of the essential sets. Define media with real functions, not lambdas (a lambda cannot contain an assignment).\n\n```python\ndef aerobic(m):\n    m.reactions.EX_o2_e.lower_bound = -20\n\ndef anaerobic(m):\n    m.reactions.EX_o2_e.lower_bound = 0\n\ndef essential_set(model, setup):\n    with model:\n        setup(model)\n        wt = model.slim_optimize()\n        res = single_gene_deletion(model)\n        return set(res.loc[res['growth'] \u002F wt \u003C ESSENTIAL_CUTOFF, 'ids'].apply(lambda s: list(s)[0]))\n\nsets = {name: essential_set(model, fn) for name, fn in [('aerobic', aerobic), ('anaerobic', anaerobic)]}\ncore = set.intersection(*sets.values())\ncondition_specific = {k: v - core for k, v in sets.items()}\n```\n\n## Validate against experiment (MCC, matched medium)\n\n```python\n# Compare predicted essentials to an experimental set (Keio single-KO, Tn-seq, or CRISPR fitness),\n# on the SAME medium. Use MCC, not accuracy: essential genes are a minority class, so accuracy is\n# inflated by the large true-negative pile.\nfrom sklearn.metrics import matthews_corrcoef\n\ndef score(predicted_essential, experimental_essential, all_genes):\n    y_pred = [g in predicted_essential for g in all_genes]\n    y_true = [g in experimental_essential for g in all_genes]\n    return matthews_corrcoef(y_true, y_pred)\n```\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| Central gene predicted non-essential | it has an isozyme (OR in the GPR) that stays open | expected; that gene is a synthetic-lethal candidate, not truly dispensable |\n| Deleting a reaction gives different results than deleting its gene | reaction KO ignores GPR; a gene may map to several reactions or share them | delete GENES (`single_gene_deletion` \u002F `gene.knock_out()`), not reactions |\n| `TypeError: 'set' object ... .id` | `ids` column holds sets of gene-id STRINGS, not gene objects | `list(s)[0]` gives the id string directly; no `.id` |\n| Essential set disagrees with the paper | medium mismatch (LB vs M9) or a different cutoff | set the experiment's medium; report and sweep the cutoff |\n| Script recurses \u002F spawns endlessly | deletion functions parallelize; no `__main__` guard | wrap in `if __name__ == '__main__':` or pass `processes=1` |\n| `AttributeError: delete_model_genes` | deprecated since cobra 0.25 | use `knock_out_model_genes` \u002F `remove_genes`, or `gene.knock_out()` |\n| High accuracy but poor agreement on real essentials | accuracy inflated by true negatives (minority class) | report MCC and sensitivity, not accuracy |\n\n## Related Skills\n\n- systems-biology\u002Fflux-balance-analysis - The FBA\u002Fmedium\u002Fobjective foundation these knockouts rest on\n- systems-biology\u002Fmodel-curation - Missing isozymes\u002Fbypasses cause false essentials; curate before trusting calls\n- systems-biology\u002Fstrain-design - Growth-coupling designs build on knockout logic\n- crispr-screens\u002Fhit-calling - Experimental essentiality screens to validate predictions\n- pathway-analysis\u002Fgo-enrichment - Functional enrichment of predicted essential-gene sets\n\n## References\n\n- Orth JD, Thiele I, Palsson BO. 2010. What is flux balance analysis? *Nat Biotechnol* 28(3):245-248.\n- Segre D, Vitkup D, Church GM. 2002. Analysis of optimality in natural and perturbed metabolic networks. *PNAS* 99(23):15112-15117. (MOMA)\n- Shlomi T, Berkman O, Ruppin E. 2005. Regulatory on\u002Foff minimization of metabolic flux changes after genetic perturbations. *PNAS* 102(21):7695-7700. (ROOM)\n- Segre D, DeLuna A, Church GM, Kishony R. 2005. Modular epistasis in yeast metabolism. *Nat Genet* 37(1):77-83. (epistasis scoring, multiplicative expectation)\n- Pratapa A, Balachandran S, Raman K. 2015. Fast-SL: an efficient algorithm to identify synthetic lethal sets in metabolic networks. *Bioinformatics* 31(20):3299-3305.\n- Baba T, Ara T, Hasegawa M, et al. 2006. Construction of Escherichia coli K-12 in-frame, single-gene knockout mutants: the Keio collection. *Mol Syst Biol* 2:2006.0008.\n- Monk JM, Lloyd CJ, Brunk E, et al. 2017. iML1515, a knowledgebase that computes Escherichia coli traits. *Nat Biotechnol* 35(10):904-908.\n","## Version Compatibility\n\nReference examples tested with: COBRApy 0.29+, Python 3.10+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\nNote: `single_gene_deletion` \u002F `double_gene_deletion` spawn worker processes, so call them inside `if __name__ == '__main__':` (or pass `processes=1`) or a spawn platform will recurse. `delete_model_genes` is deprecated since 0.25; use `knock_out_model_genes` \u002F `remove_genes`.\n\n# Gene Essentiality Analysis\n\n**\"Which genes are essential for growth in my organism?\"** -> Delete each gene (via its GPR rule), re-solve the model, and call a gene essential when its knockout drops predicted growth below a chosen cutoff - always relative to a specific model and medium.\n- Python: `cobra.flux_analysis.single_gene_deletion()`, `double_gene_deletion()`, `moma()`, `room()` (COBRApy)\n\n## The governing principle: essentiality is a model-and-medium prediction, not a gene property\n\nAn in-silico knockout answers \"can THIS network still make biomass on THIS medium after this perturbation?\" Everything else follows from taking that literally:\n\n- A gene knockout is NOT a reaction knockout. Genes map to reactions through the gene-protein-reaction (GPR) rule: AND = protein complex (all subunits needed), OR = isozymes (any one suffices). A gene in an OR with a viable partner does nothing when deleted - isozyme masking is the dominant source of false non-essential calls and the reason synthetic lethals exist. Always delete GENES and let the GPR decide which reactions close; deleting reactions directly is a different, usually wrong, analysis.\n- The essential\u002Fnon-essential CUTOFF is a policy choice, not a library default. COBRApy returns raw knockout growth rates; there is no `growth_cutoff` argument. The cutoff (commonly \u003C1-10% of wild type) moves the essential set in the \"sick but alive\" tail. It should be reported and swept (1\u002F2\u002F5\u002F10%); genes whose call flips are low-confidence hypotheses.\n- Essentiality is medium-dependent. Rich vs minimal media give different essential sets (a gene for a biosynthetic pathway is essential on minimal medium but dispensable when the product is supplied). To compare to an experiment, set the SAME medium the experiment used (LB vs M9), or the comparison is meaningless.\n- Predictions have a ceiling (~85-93% accuracy on E. coli metabolic genes). False essentials come from a missing bypass\u002Fisozyme in the model; false non-essentials come from biology FBA cannot see (regulation, toxicity, essential non-metabolic or structural roles). Report MCC, not accuracy - essential genes are the minority class, so accuracy is inflated by the true-negative pile.\n\n## Decision: which knockout method, which order\n\n| Goal | Method | Assumption \u002F when |\n|------|--------|-------------------|\n| Essential genes, evolved\u002Fadapted strain, or only hard lethality | FBA `single_gene_deletion` | mutant re-optimizes to max growth; cheapest; lethality calls agree with MOMA anyway |\n| Immediate\u002Ffresh transposon or CRISPR mutant (one growth cycle) | MOMA `moma` | mutant stays closest in flux space to wild type (QP); fits fresh-mutant fluxes better |\n| Fresh mutant where response is a few regulatory on\u002Foff switches | ROOM `room` | minimizes the NUMBER of significantly changed fluxes (MILP); recovers short bypasses |\n| Synthetic-lethal PAIRS | `double_gene_deletion` on viable singles | both single KOs viable, double lethal; O(n^2), restrict the gene list |\n| Higher-order lethal sets (triples\u002Fquads) | Fast-SL (flux-support pruning) | brute-force O(n^3+) infeasible; Fast-SL prunes by flux support |\n| Condition\u002Fmedium contrast | per-medium `single_gene_deletion` in `with model:` | essentiality re-computed under each defined medium |\n\nMOMA\u002FROOM classify lethality similarly to FBA; they differ mainly on the quantitative growth of sick-but-alive mutants. Match the method to the timescale of the actual experiment.\n\n## Single-Gene Deletion Screen\n\n**Goal:** Rank every gene by the growth defect of its knockout and flag essential and growth-reducing genes.\n\n**Approach:** Take wild-type growth once, then `single_gene_deletion` clamps each gene's reactions to zero through the GPR, re-optimizes, and returns a DataFrame with columns `ids` (a set holding the deleted gene id(s)), `growth`, and `status`. The caller applies the cutoff.\n\n```python\nimport cobra\nfrom cobra.flux_analysis import single_gene_deletion\n\nmodel = cobra.io.load_model('textbook')\nwt_growth = model.slim_optimize()\n\nresults = single_gene_deletion(model)          # DataFrame: ids (set of gene ids), growth, status\nresults['gene'] = results['ids'].apply(lambda s: list(s)[0])   # ids elements are gene-id STRINGS\nresults['relative'] = results['growth'] \u002F wt_growth\n\nESSENTIAL_CUTOFF = 0.01                          # KO grows \u003C 1% of WT -> essential (policy, not a default)\nessential = results[results['relative'] \u003C ESSENTIAL_CUTOFF]\nprint(f'Essential genes: {len(essential)} \u002F {len(model.genes)} on this medium')\n```\n\n## Classify with a threshold sweep (report low-confidence calls)\n\n```python\ndef classify_essentiality(results, wt_growth, cutoffs=(0.01, 0.02, 0.05, 0.10)):\n    '''Classify genes and report how many calls flip across cutoffs (the sick-tail sensitivity).'''\n    rel = results['growth'] \u002F wt_growth\n    calls = {c: set(results.loc[rel \u003C c, 'gene']) for c in cutoffs}\n    core = set.intersection(*calls.values())     # essential at every cutoff -> high confidence\n    boundary = set.union(*calls.values()) - core # call depends on the cutoff -> low confidence\n    return core, boundary\n```\n\n## MOMA \u002F ROOM: the immediate, non-re-optimized mutant\n\n```python\nfrom cobra.flux_analysis import moma, room\n\n# FBA assumes the mutant re-optimizes; a fresh knockout has not re-wired its regulation yet.\n# MOMA keeps mutant flux closest (Euclidean) to wild type; ROOM minimizes the count of changed\n# fluxes. Both need a wild-type reference solution and a QP\u002FMILP-capable solver.\nfrom cobra.util.solver import linear_reaction_coefficients\nbiomass = list(linear_reaction_coefficients(model))[0]   # the objective (biomass) reaction\nwt = model.optimize()\nwith model:\n    model.genes.get_by_id('b2276').knock_out()   # context-aware; reverts on block exit\n    moma_sol = moma(model, solution=wt, linear=True)      # linear=True = fast LP approximation (lMOMA)\n    # moma_sol.objective_value is the MINIMIZED ADJUSTMENT, not growth; read the biomass flux.\n    print('MOMA mutant growth:', moma_sol.fluxes[biomass.id])\n```\n\n## Synthetic Lethality (double deletions + epistasis)\n\n**Goal:** Find gene PAIRS that are viable singly but lethal together - redundant pathways and isozymes, and candidate combination drug targets.\n\n**Approach:** Restrict to genes whose single knockout is viable (a synthetic lethal requires both singles viable), run pairwise `double_gene_deletion`, and keep pairs whose double-KO growth falls below the cutoff. Cost is O(n^2), so subset the gene list. Score interactions against the multiplicative neutral expectation (independent effects on an exponential growth rate).\n\n```python\nfrom cobra.flux_analysis import double_gene_deletion\n\nviable = list(results.loc[results['relative'] > ESSENTIAL_CUTOFF, 'gene'])[:60]   # cap the O(n^2) sweep\ndbl = double_gene_deletion(model, gene_list1=viable, gene_list2=viable)\ndbl['n'] = dbl['ids'].apply(len)\nsl_pairs = dbl[(dbl['n'] == 2) & (dbl['growth'] \u002F wt_growth \u003C ESSENTIAL_CUTOFF)]\nprint(f'Synthetic-lethal pairs: {len(sl_pairs)}')\n# Genome-scale and higher-order (triple\u002Fquad) sets: use Fast-SL flux-support pruning (Pratapa 2015),\n# not brute force.\n```\n\n## Condition-Specific Essentiality (match the experiment's medium)\n\n**Goal:** Compare essential-gene sets across defined media to separate core-essential genes from condition-specific ones.\n\n**Approach:** Apply each medium inside a `with model:` block (so it reverts), run the deletion screen, and take intersections\u002Fdifferences of the essential sets. Define media with real functions, not lambdas (a lambda cannot contain an assignment).\n\n```python\ndef aerobic(m):\n    m.reactions.EX_o2_e.lower_bound = -20\n\ndef anaerobic(m):\n    m.reactions.EX_o2_e.lower_bound = 0\n\ndef essential_set(model, setup):\n    with model:\n        setup(model)\n        wt = model.slim_optimize()\n        res = single_gene_deletion(model)\n        return set(res.loc[res['growth'] \u002F wt \u003C ESSENTIAL_CUTOFF, 'ids'].apply(lambda s: list(s)[0]))\n\nsets = {name: essential_set(model, fn) for name, fn in [('aerobic', aerobic), ('anaerobic', anaerobic)]}\ncore = set.intersection(*sets.values())\ncondition_specific = {k: v - core for k, v in sets.items()}\n```\n\n## Validate against experiment (MCC, matched medium)\n\n```python\n# Compare predicted essentials to an experimental set (Keio single-KO, Tn-seq, or CRISPR fitness),\n# on the SAME medium. Use MCC, not accuracy: essential genes are a minority class, so accuracy is\n# inflated by the large true-negative pile.\nfrom sklearn.metrics import matthews_corrcoef\n\ndef score(predicted_essential, experimental_essential, all_genes):\n    y_pred = [g in predicted_essential for g in all_genes]\n    y_true = [g in experimental_essential for g in all_genes]\n    return matthews_corrcoef(y_true, y_pred)\n```\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| Central gene predicted non-essential | it has an isozyme (OR in the GPR) that stays open | expected; that gene is a synthetic-lethal candidate, not truly dispensable |\n| Deleting a reaction gives different results than deleting its gene | reaction KO ignores GPR; a gene may map to several reactions or share them | delete GENES (`single_gene_deletion` \u002F `gene.knock_out()`), not reactions |\n| `TypeError: 'set' object ... .id` | `ids` column holds sets of gene-id STRINGS, not gene objects | `list(s)[0]` gives the id string directly; no `.id` |\n| Essential set disagrees with the paper | medium mismatch (LB vs M9) or a different cutoff | set the experiment's medium; report and sweep the cutoff |\n| Script recurses \u002F spawns endlessly | deletion functions parallelize; no `__main__` guard | wrap in `if __name__ == '__main__':` or pass `processes=1` |\n| `AttributeError: delete_model_genes` | deprecated since cobra 0.25 | use `knock_out_model_genes` \u002F `remove_genes`, or `gene.knock_out()` |\n| High accuracy but poor agreement on real essentials | accuracy inflated by true negatives (minority class) | report MCC and sensitivity, not accuracy |\n\n## Related Skills\n\n- systems-biology\u002Fflux-balance-analysis - The FBA\u002Fmedium\u002Fobjective foundation these knockouts rest on\n- systems-biology\u002Fmodel-curation - Missing isozymes\u002Fbypasses cause false essentials; curate before trusting calls\n- systems-biology\u002Fstrain-design - Growth-coupling designs build on knockout logic\n- crispr-screens\u002Fhit-calling - Experimental essentiality screens to validate predictions\n- pathway-analysis\u002Fgo-enrichment - Functional enrichment of predicted essential-gene sets\n\n## References\n\n- Orth JD, Thiele I, Palsson BO. 2010. What is flux balance analysis? *Nat Biotechnol* 28(3):245-248.\n- Segre D, Vitkup D, Church GM. 2002. Analysis of optimality in natural and perturbed metabolic networks. *PNAS* 99(23):15112-15117. (MOMA)\n- Shlomi T, Berkman O, Ruppin E. 2005. Regulatory on\u002Foff minimization of metabolic flux changes after genetic perturbations. *PNAS* 102(21):7695-7700. (ROOM)\n- Segre D, DeLuna A, Church GM, Kishony R. 2005. Modular epistasis in yeast metabolism. *Nat Genet* 37(1):77-83. (epistasis scoring, multiplicative expectation)\n- Pratapa A, Balachandran S, Raman K. 2015. Fast-SL: an efficient algorithm to identify synthetic lethal sets in metabolic networks. *Bioinformatics* 31(20):3299-3305.\n- Baba T, Ara T, Hasegawa M, et al. 2006. Construction of Escherichia coli K-12 in-frame, single-gene knockout mutants: the Keio collection. *Mol Syst Biol* 2:2006.0008.\n- Monk JM, Lloyd CJ, Brunk E, et al. 2017. iML1515, a knowledgebase that computes Escherichia coli traits. *Nat Biotechnol* 35(10):904-908.\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","python","2026-09-20","systems-biology\u002Fgene-essentiality\u002FSKILL.md","cobrapy","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-systems-biology-gene-essentiality","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-systems-biology-gene-essentiality",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-systems-biology-gene-essentiality",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-systems-biology-gene-essentiality","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-systems-biology-gene-essentiality\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fgene_essentiality.py","SCRIPT","脚本",2777,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-systems-biology-gene-essentiality\u002Fexamples\u002Fgene_essentiality.py",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",5037,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-systems-biology-gene-essentiality\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]