ワンクリックで
cobrapy
Constraints-Based Reconstruction and Analysis for Python. Used for modeling large-scale metabolic networks in microorganisms.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Constraints-Based Reconstruction and Analysis for Python. Used for modeling large-scale metabolic networks in microorganisms.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Atomic Simulation Environment - a set of tools for setting up, manipulating, running, visualizing, and analyzing atomistic simulations. Acts as a universal interface between Python and numerous quantum chemical and molecular dynamics codes. Use for building atomic structures, geometry optimization, molecular dynamics simulations, transition state searches (NEB), file format conversion (CIF, XYZ, POSCAR, PDB), electronic property calculations (DOS, band structures), and automating simulation workflows with DFT/MD codes like VASP, GPAW, Quantum ESPRESSO, LAMMPS.
The core library for Astronomy and Astrophysics in Python. Provides data structures for coordinates, time, units, FITS files, and cosmological models. Essential for observational data reduction and theoretical astrophysics. Use when working with astronomical coordinates (RA/Dec), physical units, FITS files, time scales, WCS, cosmology, or astronomical tables.
A Python package useful for chemistry (mainly physical/analytical/inorganic chemistry). Features include balancing chemical reactions, chemical kinetics (ODE integration), chemical equilibria, ionic strength calculations, and unit handling. Use when working with chemical equations, reaction balancing, kinetic modeling, equilibrium calculations, speciation, pH calculations, ionic strength, activity coefficients, or chemical formula parsing.
Advanced sub-skill for Dask focused on distributed system performance, memory management, and task graph optimization. Covers cluster tuning, efficient serialization, data skew mitigation, and dashboard-driven debugging.
A flexible library for parallel computing in Python. It scales Python libraries like NumPy, pandas, and scikit-learn to multi-core systems or distributed clusters. Features lazy evaluation and task scheduling for data that exceeds RAM capacity. Use for out-of-core computing, parallel processing, distributed computing, large-scale data analysis, dask.array, dask.dataframe, dask.delayed, dask.bag, task scheduling, lazy evaluation, and scaling beyond memory limits.
Causal inference framework for answering "does X cause Y?" beyond correlation. DoWhy (Microsoft Research) provides the identify-estimate-refute loop: define a causal graph (DAG), identify the causal effect using backdoor/frontdoor/instrumental variable criteria, estimate treatment effects with multiple estimators, and validate results with automated refutation tests. Use when: distinguishing causation from correlation, estimating treatment effects (ATE, ATT, CATE), designing and analyzing A/B tests with confounders, using instrumental variables, performing counterfactual reasoning ("what would have happened if..."), validating causal claims with sensitivity analysis, working with observational data where randomization is impossible, or any analysis where the question is "what is the CAUSAL effect of X on Y" rather than just "how do X and Y relate?"
| name | cobrapy |
| description | Constraints-Based Reconstruction and Analysis for Python. Used for modeling large-scale metabolic networks in microorganisms. |
| version | 0.29 |
| license | LGPL-2.1 |
Models the "metabolism" of a cell as a linear optimization problem. Used to predict bacterial growth under different conditions or design GMO strains.
Optimizes metabolic fluxes to maximize biomass production (or other objectives) subject to stoichiometric constraints.
Genes encode proteins (enzymes) that catalyze reactions. Knockouts affect reaction availability.
Reaction bounds (lower/upper limits) represent enzyme capacity or nutrient availability.
import cobra
from cobra.io import load_model, save_model
# 1. Load model (e.g., E. coli)
model = cobra.io.load_model("iJO1366")
# Or: model = cobra.io.read_sbml_model("model.xml")
# 2. Run Flux Balance Analysis (FBA)
solution = model.optimize()
print(f"Growth rate: {solution.objective_value:.4f}")
print(f"Status: {solution.status}")
# 3. Knockout simulation (Gene essentiality)
with model:
model.genes.get_by_id("b0002").knock_out()
print(f"Growth after knockout: {model.optimize().objective_value:.4f}")
# 4. Change medium (nutrient availability)
model.medium = {
'EX_glc__D_e': 10.0, # Glucose uptake
'EX_o2_e': 1000.0 # Oxygen
}
solution = model.optimize()
with model: to avoid permanent changes.model.validate() to check for common issues.from cobra.flux_analysis import flux_variability_analysis
# Find range of possible fluxes for each reaction
fva_result = flux_variability_analysis(model, model.reactions)
# Test which genes are essential for growth
from cobra.flux_analysis import single_gene_deletion
deletion_results = single_gene_deletion(model)
essential_genes = deletion_results[deletion_results['growth'] < 0.01]
# Add a new reaction to the model
new_reaction = cobra.Reaction("NEW_RXN")
new_reaction.add_metabolites({
model.metabolites.get_by_id("glc__D_c"): -1,
model.metabolites.get_by_id("atp_c"): -1,
model.metabolites.get_by_id("adp_c"): 1,
})
new_reaction.lower_bound = 0
new_reaction.upper_bound = 1000
model.add_reactions([new_reaction])
COBRApy transforms metabolic networks into computable models, enabling researchers to predict and engineer cellular behavior at the systems level.