
COBRApy 0.31 API 速查与实践指南面向代谢建模与通量分析的编程参考手册【免费下载链接】scientific-agent-skillsTurn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 190,000 scientists worldwide. 165 ready-to-use validated skills plus 100 scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard.项目地址: https://gitcode.com/GitHub_Trending/cl/scientific-agent-skills本指南以 api_quick_reference.md 为骨架面向基于 cobra 0.31.1 的约束型代谢重建与分析COBRA编程场景系统整理模型读写、结构访问、FBA/FVA、基因与反应删除、通量采样、培养基设计、模型编辑与上下文管理等高频 API 的签名、默认值与返回值约定。读者按此手册可快速上手基因组规模代谢模型GEM的仿真与代谢工程分析并结合仓库内的 SKILL.md 与 workflows.md 获得可直接运行的综合工作流模板。COBRApy 是 Python 生态中最常用的约束型代谢建模库用于对基因组规模代谢网络执行通量平衡分析FBA、通量可变性分析FVA、基因敲除模拟、通量采样与模型补全gapfilling。本文档的所有签名与默认值均以cobra 0.31.1为准import cobra并保留其原有章节结构供速查。一、模型读写Model I/O1. 加载模型COBRApy 提供多种来源与格式的模型加载入口。按数据来源可分为「本地内置模型」「远端数据库模型」「本地文件模型」三类。from cobra.io import load_model, read_sbml_model, load_json_model, load_yaml_model, load_matlab_model # Bundled locally (cobra.data): textbook, iJO1366, salmonella model load_model(textbook) # e_coli_core (95 reactions) model load_model(e_coli_core) # same as textbook model load_model(iJO1366) # genome-scale E. coli model load_model(salmonella) # iYS1720 # BiGG / BioModels (network disk cache) model load_model(iML1515) # From files model read_sbml_model(filename, f_replace{}, **kwargs) model load_json_model(filename) model load_yaml_model(filename) model load_matlab_model(filename, variable_nameNone)需要特别说明的版本事实对应 cobra 0.31.1与 workflows.md 中记载一致load_model(textbook)与load_model(e_coli_core)指向同一个大肠杆菌核心模型95 个反应常用于快速教程与探索性实验load_model(iJO1366)、load_model(salmonella)随 cobra.data 本地捆绑无需网络即可加载load_model(iML1515)属于远端 BiGG/BioModels 数据源首次获取需要网络随后写入磁盘缓存旧版本习惯load_model(ecoli)与load_model(universal)在 cobra 0.31.1 中已不可用应改用上述模型 IDMATLAB 格式读写需安装可选依赖cobra[array]见 SKILL.md 的安装小节。2. 保存模型from cobra.io import write_sbml_model, save_json_model, save_yaml_model, save_matlab_model write_sbml_model(model, filename, f_replace{}, **kwargs) save_json_model(model, filename, prettyFalse, **kwargs) save_yaml_model(model, filename, **kwargs) save_matlab_model(model, filename, **kwargs)格式选型建议源自 SKILL.md 的 Best Practices长期存储与模型交换优先 SBMLJSON 格式便于与 Escher 等可视化工具衔接YAML 人读性好。当需要批量导出 CSV/图片类产物时遵循 workflows.md 的要求先将输出路径写入用户批准的OUTDIR。二、模型结构Model Structure1. 核心类COBRA 模型由Model、Reaction、Metabolite、Gene四个核心类构成支持从零建模。from cobra import Model, Reaction, Metabolite, Gene # Create model model Model(id_or_modelNone, nameNone) # Create metabolite metabolite Metabolite( idNone, formulaNone, name, chargeNone, compartmentNone ) # Create reaction reaction Reaction( idNone, name, subsystem, lower_bound0.0, upper_boundNone ) # Create gene gene Gene(idNone, name, functionalTrue)要点说明Metabolite的compartment使用单字符胞室标识如c表示胞质、e表示胞外formula需为合法的化学式字符串以便后续质量平衡检查Reaction默认不可逆lower_bound0.0upper_boundNone时通常由模型或求解器环境按惯例设定默认上限如 1000Gene.functional表示基因是否具备功能活性knock_out()会将其置为 False。2. 模型属性component 容器与特殊反应列表# Component access (DictList objects) model.reactions # DictList of Reaction objects model.metabolites # DictList of Metabolite objects model.genes # DictList of Gene objects # Special reaction lists model.exchanges # Exchange reactions (external transport) model.demands # Demand reactions (metabolite sinks) model.sinks # Sink reactions model.boundary # All boundary reactions # Model properties model.objective # Current objective (read/write) model.objective_direction # max or min model.medium # Growth medium (dict of exchange: bound) model.solver # Optimization solver语义区分exchanges位于系统边界负责代谢物与环境的交换demands用于胞内代谢物的“汇”移除多余物sinks是胞内可双向的“交换池”boundary为上述三类边界反应的合集。3. DictList 查询方法reactions/metabolites/genes返回的都是DictList对象行为上同时近似“列表”和“字典”。# Access by index item model.reactions[0] # Access by ID item model.reactions.get_by_id(PFK) # Query by string (substring match) items model.reactions.query(atp) # Case-insensitive search items model.reactions.query(lambda x: x.subsystem Glycolysis) # List comprehension items [r for r in model.reactions if r.lower_bound 0] # Check membership PFK in model.reactions说明query(str)执行不区分大小写的子串匹配query(callable)则以谓词函数逐项过滤由于DictList兼具下标访问与__contains__PFK in model.reactions这类成员判断可直接使用 ID 字符串。三、优化Optimization1. 基础优化与 Solution 对象# Full optimization (returns Solution object) solution model.optimize() # Attributes of Solution solution.objective_value # Objective function value solution.status # Optimization status (optimal, infeasible, etc.) solution.fluxes # Pandas Series of reaction fluxes solution.shadow_prices # Pandas Series of metabolite shadow prices solution.reduced_costs # Pandas Series of reduced costs # Fast optimization (returns float only) objective_value model.slim_optimize() # Change objective model.objective ATPM model.objective model.reactions.ATPM model.objective {model.reactions.ATPM: 1.0} # Change optimization direction model.objective_direction max # or min实践提示与 SKILL.md 一致slim_optimize()只返回目标函数数值float当仅需目标值时性能更优例如批量扫描前获取 baseline分析前务必先检查solution.status optimal避免把不可行/非最优解当作有效结果model.objective可接受 ID 字符串、Reaction对象或{reaction: coefficient}字典三种写法目标方向可用objective_direction显式设置为max或min。2. 求解器配置SolverCOBRApy 通过 [optlang] 抽象底层求解器GLPK 由swiglpk自动随包安装为默认求解器。# Check available solvers from cobra.util.solver import solvers print(solvers) # typically includes glpk; CPLEX/Gurobi if installed # Change solver model.solver glpk # default via swiglpk # model.solver hybrid # HIGHS/OSQP for large MILPs/QPs (0.29) # model.solver cplex # or gurobi with licenses installed # OSQP: deprecated as standalone LP solver; routes through hybrid in 0.29 # Solver-specific configuration model.solver.configuration.timeout 60 # seconds model.solver.configuration.verbosity 1 model.solver.configuration.tolerances.feasibility 1e-9版本相关的求解器注意点cobra 0.29 引入hybrid求解器内部组合 HIGHS/OSQP适合大规模 MILP/QP对大型 MILP/QP 建模优先设置model.solver hybridOSQP 已不再作为独立的 LP 求解器推荐0.29 中设置osqp会路由到 hybrid未来版本对纯 LP 可能直接报错故优先使用hybrid求解器层面可配置timeout秒、verbosity与各类tolerances如可行性容差。四、通量分析Flux Analysis1. 通量平衡分析FBA 变体from cobra.flux_analysis import pfba, geometric_fba # Parsimonious FBA solution pfba(model, fraction_of_optimum1.0, **kwargs) # Geometric FBA solution geometric_fba(model, epsilon1e-06, max_tries200)pFBAParsimonious FBA在保持最优目标默认fraction_of_optimum1.0的前提下最小化总绝对通量得到唯一性更好的通量分布geometric FBA在最优面内求“居中”解epsilon 为收敛判据max_tries为最大尝试次数。2. 通量可变性分析FVAfrom cobra.flux_analysis import flux_variability_analysis fva_result flux_variability_analysis( model, reaction_listNone, # List of reaction IDs or None for all looplessFalse, # Eliminate thermodynamically infeasible loops fraction_of_optimum1.0, # Optimality fraction (0.0-1.0) pfba_factorNone, # Optional pFBA constraint processes1 # Number of parallel processes ) # Returns DataFrame with columns: minimum, maximum用法速记fraction_of_optimum0.9表示在“不低于最优值 90%”的解空间中求每个反应的最小/最大通量是考察代谢冗余度的常用设置looplessTrue会剔除热力学上不可行循环但计算明显更慢workflows.md 提示在基因组规模模型上应谨慎使用返回DataFrame行索引为反应 ID列为minimum、maximum可通过maximum - minimum计算通量柔性区间。3. 基因与反应删除分析from cobra.flux_analysis import ( single_gene_deletion, single_reaction_deletion, double_gene_deletion, double_reaction_deletion ) # Single deletions results single_gene_deletion( model, gene_listNone, # None for all genes processes1, **kwargs ) results single_reaction_deletion( model, reaction_listNone, # None for all reactions processes1, **kwargs ) # Double deletions results double_gene_deletion( model, gene_list1None, gene_list2None, processes1, **kwargs ) results double_reaction_deletion( model, reaction_list1None, reaction_list2None, processes1, **kwargs ) # Returns DataFrame with columns: ids, growth, status # For double deletions, index is MultiIndex of gene/reaction pairs说明gene_listNone/reaction_listNone表示扫描模型中的全部基因/反应返回值是含growth目标通量与status的 DataFrame双删除结果使用 (对象1, 对象2) 的 MultiIndex可用index.get_level_values(0)取出第一维用于后续分析双删除组合数随规模平方级增长workflows.md 建议在基因组规模模型上通过gene_list1子集、processes1控制计算量合成致死筛选等完整流程见该文件 Workflow 1。4. 通量采样Flux Samplingfrom cobra.sampling import sample, OptGPSampler, ACHRSampler # Simple interface samples sample( model, n, # Number of samples methodoptgp, # or achr thinning100, # Thinning factor (sample every n iterations) processes1, # Parallel processes (OptGP only) seedNone # Random seed ) # Advanced interface with sampler objects sampler OptGPSampler(model, processes4, thinning100) sampler ACHRSampler(model, thinning100) # Generate samples samples sampler.sample(n) # Validate samples validation sampler.validate(sampler.samples) # Returns array of v (valid), l (lower bound violation), # u (upper bound violation), e (equality violation) # Batch sampling sampler.batch(n_samples, n_batches)要点两种采样算法OptGP默认支持processes并行与ACHR人工中心 hit-and-run不可并行thinning为抽稀因子表示每迭代多少步抽取一个样本用于降低样本间自相关validate()返回逐样本校验结果字符数组v表示落在可行域内l/u/e分别表示违反下界、上界与等式约束正常时应当全部为vSKILL.md 建议在基因组规模模型上从小n、processes1起步采样结果可与 FVA 边界叠加绘图观察通量分布见 workflows.md Workflow 3。5. 生产包络线Production Envelopefrom cobra.flux_analysis import production_envelope envelope production_envelope( model, reactions, # List of 1-2 reaction IDs objectiveNone, # Objective reaction ID (None uses model objective) carbon_sourcesNone, # Carbon source for yield calculation points20, # Number of points to calculate threshold0.01 # Minimum objective value threshold ) # Returns DataFrame with columns: # - First reaction flux # - Second reaction flux (if provided) # - objective_minimum, objective_maximum # - carbon_yield_minimum, carbon_yield_maximum (if carbon source specified) # - mass_yield_minimum, mass_yield_maximum用途当指定 1 个反应时绘制“表型相平面”上的通量-目标曲线当指定 2 个反应如葡萄糖摄取与氧摄取时得到二维相平面用于考察底物配比对产物与生物量权衡的影响。carbon_sources传入碳源交换反应 ID 后可额外计算碳收率区间典型参数见 SKILL.md 中reactions[EX_glc__D_e, EX_o2_e]与carbon_sourcesEX_glc__D_e的用法。6. 模型补全Gapfillingfrom cobra.flux_analysis import gapfill # Basic gapfilling solution gapfill( model, universalNone, # Universal model with candidate reactions lower_bound0.05, # Minimum objective flux penaltiesNone, # Dict of reaction: penalty demand_reactionsTrue, # Add demand reactions if needed exchange_reactionsFalse, iterations1 ) # Returns list of Reaction objects to add # Multiple solutions solutions [] for i in range(5): sol gapfill(model, universal, iterations1) solutions.append(sol) # Prevent finding same solution by increasing penalties说明universal是需要外部提供的候选反应全集模型SBML/JSONcobra 0.31 不再内置 universal 模型须自行准备返回值是建议补充的 Reaction 对象列表若希望枚举多套补全方案可迭代调用并通过递增penalties惩罚已找到的反应来避免重复先用with model配合remove_reactions人为制造缺口再补全的验证套路见 SKILL.md 的 gapfilling 示例。7. 其他分析函数from cobra.flux_analysis import ( find_blocked_reactions, find_essential_genes, find_essential_reactions ) # Blocked reactions (cannot carry flux) blocked find_blocked_reactions( model, reaction_listNone, zero_cutoff1e-9, open_exchangesFalse ) # Essential genes/reactions essential_genes find_essential_genes(model, threshold0.01) essential_reactions find_essential_reactions(model, threshold0.01)find_blocked_reactions识别在给定条件下无法承载任何通量的反应zero_cutoff定义“零通量”的判定阈值open_exchangesTrue会先放开全部交换反应再判断结构性阻断必需基因/反应essential通常以“删除后目标通量低于threshold倍基线”判定。五、培养基与边界条件Media and Boundary Conditions1. 培养基管理Mediummodel.medium返回一个以交换反应 ID 为键、以上界为值的字典对应各底物的最大摄取速率。修改时必须整体重新赋值整个字典。# Get current medium (returns dict) medium model.medium # Set medium (must reassign entire dict) medium model.medium medium[EX_glc__D_e] 10.0 medium[EX_o2_e] 20.0 model.medium medium # Alternative: individual modification with model: model.reactions.EX_glc__D_e.lower_bound -10.0约定速记交换反应正值表示分泌、负值表示摄取model.medium中的数值为各交换反应允许的最大摄取量的相反数语义即以正数给出摄取上限。逐条修改更推荐放入with model上下文配合 workflows.md Workflow 2 可完成好氧/厌氧培养基对比与限制性营养元素鉴定。2. 最小培养基计算Minimal Mediumfrom cobra.medium import minimal_medium min_medium minimal_medium( model, min_objective_value0.1, # Minimum growth rate minimize_componentsFalse, # If True, uses MILP (slower) open_exchangesFalse, # Open all exchanges before optimization exportsFalse, # Allow metabolite export penaltiesNone # Dict of exchange: penalty ) # Returns Series of exchange reactions with fluxes返回按交换反应索引的 Series值为其所需通量min_objective_value为目标生长的下限可传入baseline * fraction按比例取目标如model.slim_optimize() * 0.5minimize_componentsTrue时以 MILP 最小化组分数更慢否则默认最小化总摄取通量open_exchangesTrue会先把所有交换反应打开再求解可用于排查“是否培养基限制导致不可行”跨生长目标的最小培养基对比脚本见 workflows.md Workflow 2。3. 边界反应Boundary Reactions# Add boundary reaction model.add_boundary( metabolite, typeexchange, # or demand, sink reaction_idNone, # Auto-generated if None lbNone, ubNone, sbo_termNone ) # Access boundary reactions exchanges model.exchanges # System boundary demands model.demands # Intracellular removal sinks model.sinks # Intracellular exchange boundaries model.boundary # All boundary reactions自建模型时可用add_boundary(metabolite, typeexchange)为代谢物开交换反应、typedemand为代谢物开需求反应对应 SKILL.md Model Building 示例中的model.add_boundary(atp_c, typeexchange)。六、模型编辑Model Manipulation1. 添加组分# Add reactions model.add_reactions([reaction1, reaction2, ...]) model.add_reaction(reaction) # Add metabolites reaction.add_metabolites({ metabolite1: -1.0, # Consumed (negative stoichiometry) metabolite2: 1.0 # Produced (positive stoichiometry) }) # Add metabolites to model model.add_metabolites([metabolite1, metabolite2, ...]) # Add genes (usually automatic via gene_reaction_rule) model.genes [gene1, gene2, ...]注意add_metabolites中负系数表示被消耗、正系数表示被生成基因通常无需手动添加——设置reaction.gene_reaction_ruleGPR 布尔串后COBRApy 会自动创建对应的Gene对象并建立关联。2. 删除组分# Remove reactions model.remove_reactions([reaction1, reaction2, ...]) model.remove_reactions([PFK, FBA]) # Remove metabolites (removes from reactions too) model.remove_metabolites([metabolite1, metabolite2, ...]) # Remove genes (usually via gene_reaction_rule) model.genes.remove(gene)删除反应既支持对象列表也支持 ID 字符串列表删除代谢物会同步将其从涉及的反应化学计量中移除。3. 修改反应# Set bounds reaction.bounds (lower, upper) reaction.lower_bound 0.0 reaction.upper_bound 1000.0 # Modify stoichiometry reaction.add_metabolites({metabolite: 1.0}) reaction.subtract_metabolites({metabolite: 1.0}) # Change gene-reaction rule reaction.gene_reaction_rule (gene1 and gene2) or gene3 # Knock out reaction.knock_out() gene.knock_out()最佳实践来自 SKILL.md Key Concepts设置上下界时优先通过.bounds一次性赋值同时修改下界与上界避免先后赋值导致中间态的不一致knock_out()等价于把下界与上界同时置 0。4. 模型复制与子模型抽取# Deep copy (independent model) model_copy model.copy() # Copy specific reactions new_model Model(subset) reactions_to_copy [model.reactions.PFK, model.reactions.FBA] new_model.add_reactions(reactions_to_copy)model.copy()生成相互独立的深拷贝适合在模拟实验中隔离修改需要从大模型中抽取特定通路时可新建Model后把目标反应对象整体add_reactions过去关联的代谢物与基因会自动纳入。七、上下文管理Context Managementwith model:是 COBRApy 处理“临时修改后自动还原”的官方机制可避免手工保存/恢复模型状态的繁琐与出错。# Changes automatically revert after with block with model: model.objective ATPM model.reactions.EX_glc__D_e.lower_bound -5.0 model.genes.b0008.knock_out() solution model.optimize() # Model state restored here # Multiple nested contexts with model: model.objective ATPM with model: model.genes.b0008.knock_out() # Both modifications active # Only objective change active # Context management with reactions with model: model.reactions.PFK.knock_out() # Equivalent to: reaction.lower_bound reaction.upper_bound 0语义说明退出with块后期间对 objective、反应边界、基因活性等的全部修改自动回滚嵌套上下文支持作用域叠加内层块退出后其修改回滚外层块的修改仍生效当需要批量对比“同一模型 多条件”时如多个敲除、多个培养基只需将每种条件包进独立的with model:块即可详见下文“常见模式”。八、反应与代谢物属性Reaction and Metabolite Properties1. Reaction 属性与方法reaction.id # Unique identifier reaction.name # Human-readable name reaction.subsystem # Pathway/subsystem reaction.bounds # (lower_bound, upper_bound) reaction.lower_bound reaction.upper_bound reaction.reversibility # Boolean (lower_bound 0) reaction.gene_reaction_rule # GPR string reaction.genes # Set of associated Gene objects reaction.metabolites # Dict of {metabolite: stoichiometry} # Methods reaction.reaction # Stoichiometric equation string reaction.build_reaction_string() # Same as above reaction.check_mass_balance() # Returns imbalances or empty dict reaction.get_coefficient(metabolite_id) reaction.add_metabolites({metabolite: coeff}) reaction.subtract_metabolites({metabolite: coeff}) reaction.knock_out()reaction.reaction与build_reaction_string()返回类似atp_c h2o_c -- adp_c pi_c h_e的化学计量方程文本check_mass_balance()返回元素不平衡字典空字典{}表示质量平衡非空时各元素对应的不平衡量可用于定位问题反应get_coefficient(metabolite_id)按代谢物 ID 取化学计量系数。2. Metabolite 属性与方法metabolite.id # Unique identifier metabolite.name # Human-readable name metabolite.formula # Chemical formula metabolite.charge # Charge metabolite.compartment # Compartment ID metabolite.reactions # FrozenSet of associated reactions # Methods metabolite.summary() # Print production/consumption metabolite.copy()reactions返回该代谢物参与反应的FrozenSet可用于计算某代谢物的“生产反应数/消耗反应数”以识别死端代谢物参见 workflows.md Workflow 5 的 Dead-end 检查summary()打印该代谢物的生成与消耗概况。3. Gene 属性与方法gene.id # Unique identifier gene.name # Human-readable name gene.functional # Boolean activity status gene.reactions # FrozenSet of associated reactions # Methods gene.knock_out()gene.reactions可用于排查孤儿基因未关联任何反应的基因len(gene.reactions) 0这类基因是模型验证报告中的常见提示项。九、模型验证Model Validation1. 一致性检查from cobra.manipulation import check_mass_balance, check_metabolite_compartment_formula # Check all reactions for mass balance unbalanced {} for reaction in model.reactions: balance reaction.check_mass_balance() if balance: unbalanced[reaction.id] balance # Check metabolite formulas are valid check_metabolite_compartment_formula(model)说明逐反应check_mass_balance()汇总得到质量不平衡反应清单workflows.md Workflow 5 给出了完整的质量/电荷平衡审计流程check_metabolite_compartment_formula用于校验各代谢物公式与胞室标签是否自洽。2. 模型统计信息# Basic stats print(fReactions: {len(model.reactions)}) print(fMetabolites: {len(model.metabolites)}) print(fGenes: {len(model.genes)}) # Advanced stats print(fExchanges: {len(model.exchanges)}) print(fDemands: {len(model.demands)}) # Blocked reactions from cobra.flux_analysis import find_blocked_reactions blocked find_blocked_reactions(model) print(fBlocked reactions: {len(blocked)}) # Essential genes from cobra.flux_analysis import find_essential_genes essential find_essential_genes(model) print(fEssential genes: {len(essential)})维度速览建议加载模型后首先输出反应/代谢物/基因三要素规模再结合阻断反应数与必需基因数形成基线画像可在 workflows.md Workflow 5 中一键生成模型验证报告 CSV。十、摘要方法Summary Methods# Model summary model.summary() # Overall model info # Metabolite summary model.metabolites.atp_c.summary() # Reaction summary model.reactions.PFK.summary() # Summary with FVA model.summary(fva0.95) # Include FVA at 95% optimality无参调用将打印基于当前通常是刚优化过的解的模型总览对Model/Metabolite/Reaction均可在内部做 FBA 后输出面向文本终端的友好摘要便于快速汇报model.summary(fva0.95)额外给出 95% 最优性下的通量区间信息是折中精度与速度的展示选项。十一、常见分析模式Common Patterns三种贯穿各类研究问题的高频代码骨架均以with model保证状态隔离与自动回滚。1. 批量条件分析模式results [] for condition in conditions: with model: # Apply condition setup_condition(model, condition) # Analyze solution model.optimize() # Store result results.append({ condition: condition, growth: solution.objective_value, status: solution.status }) df pd.DataFrame(results)2. 系统化敲除扫描模式knockout_results [] for gene in model.genes: with model: gene.knock_out() solution model.optimize() knockout_results.append({ gene: gene.id, growth: solution.objective_value if solution.status optimal else 0, status: solution.status }) df pd.DataFrame(knockout_results)该模式可直接替换为封装好的single_gene_deletion(model)二者结果等价SKILL.md Workflow 2 给出了基于返回 DataFrame 筛选必需基因growth 0.01与中性基因growth 0.9 * baseline的判据完整“单敲除分类 双敲除合成致死 可视化”流水线见 workflows.md Workflow 1。3. 参数扫描模式以葡萄糖摄取为变量parameter_values np.linspace(0, 20, 21) results [] for value in parameter_values: with model: model.reactions.EX_glc__D_e.lower_bound -value solution model.optimize() results.append({ glucose_uptake: value, growth: solution.objective_value, acetate_secretion: solution.fluxes[EX_ac_e] }) df pd.DataFrame(results)该骨架可扩展用于培养基组分滴定、碳/氮源切换对副产物分泌的影响、不同目标方向生长 vs 产物下的权衡分析等。环境前提与配套资源Python 与安装cobra 0.30 已放弃 Python 3.8需Python 3.9推荐uv pip install cobra0.31.1如需 MATLAB 模型读写则安装uv pip install cobra[array]0.31.1本技能skill的测试依赖亦按tests/skill-requirements.toml声明为cobra、matplotlib、pandas、seaborn许可证与文件输出纪律本技能以 GPL-2.0 授权凡调用to_csv/savefig的工作流应先将OUTDIR设定为经用户批准的路径详见 workflows.md性能提示双删除、loopless FVA 与大规模通量采样在基因组规模模型上可能耗时以小时计探索阶段优先使用textbook95 反应的核心模型或通过reaction_list/gene_list1子集、调低n与processes控制成本workflows.md 对此有明确提示速查定位本手册用于函数签名与参数默认值速查配套的完整操作示例请参考同目录 workflows.md综合工作流与 SKILL.md能力总览、安装与最佳实践。【免费下载链接】scientific-agent-skillsTurn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 190,000 scientists worldwide. 165 ready-to-use validated skills plus 100 scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard.项目地址: https://gitcode.com/GitHub_Trending/cl/scientific-agent-skills创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考