fba-simulator
하는 일
스킬은 COBRApy 라이브러리로 세포 대사를 제약 기반으로 시뮬레이션합니다. 예측된 성장과 플럭스 값이 필요한 대사 모델링 연구자를 위한 스킬입니다.
사용하는 경우
- ✓대사 모델이 있고 그 성장률을 예측하고 싶을 때.
- ✓모델에서 유전자나 반응 결실을 시험하고 싶을 때.
- ✓플럭스 분포를 CSV 파일로 내보내야 하는 경우.
스킬 링크
https://github.com/aiming-lab/AutoResearchClaw/blob/main/external/agents/Biology-Agent/skills/fba-simulator/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“E. coli 모델에 플럭스 균형 분석을 실행하고, 유전자를 하나씩 결실시킨 뒤 성장 결과를 저장해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 검증된 모델을 불러오고, 바이오매스 같은 목적 함수를 최대화하는 플럭스 패턴을 풀며, 결실이나 플럭스 변동성 분석 같은 변형을 실행합니다. 각 변경은 나중에 되돌려지므로 모델은 원래대로 복원됩니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Overview
The fba-simulator skill executes constraint-based metabolic simulations on
a validated COBRApy model. FBA solves a linear program to find the flux
distribution that maximizes (or minimizes) the objective function subject to
stoichiometric and thermodynamic constraints.
This skill sits between model construction (gsmm-builder) and biological
interpretation (flux-analyzer). All simulations are non-destructive: COBRApy
context managers restore model state after each perturbation.
Workflow
Step 1 — Load Validated Model
import cobra
import cobra.io
import cobra.flux_analysis
import pandas as pd
model = cobra.io.load_json_model("my_model.json")
print(f"Model: {model.id} Solver: {model.solver}")
Step 2 — Standard FBA
FBA maximizes the objective (typically biomass) subject to stoichiometric
steady-state constraints: S·v = 0, lb ≤ v ≤ ub.
# Run FBA
solution = model.optimize()
print(f"Status : {solution.status}")
print(f"Growth rate : {solution.objective_value:.4f} h^-1")
print(f"Glucose uptake : "
f"{solution.fluxes['EX_glc__D_e']:.4f} mmol/gDW/h")
print(f"O2 uptake : "
f"{solution.fluxes.get('EX_o2_e', 0):.4f} mmol/gDW/h")
print(f"Acetate sec. : "
f"{solution.fluxes.get('EX_ac_e', 0):.4f} mmol/gDW/h")
# Save full flux distribution
solution.fluxes.to_csv("fba_fluxes.csv", header=["flux_mmol_gDW_h"])
Step 3 — Parsimonious FBA (pFBA)
pFBA first maximizes growth, then minimizes total absolute flux, producing the most "economical" solution consistent with maximum growth. This avoids biologically unrealistic high-flux split cycles.
pfba_solution = cobra.flux_analysis.pfba(model)
print(f"pFBA growth rate : {pfba_solution.objective_value:.4f} h^-1")
print(f"Total flux norm : {pfba_solution.fluxes.abs().sum():.2f}")
pfba_solution.fluxes.to_csv("pfba_fluxes.csv", header=["flux_mmol_gDW_h"])
Step 4 — Flux Variability Analysis (FVA)
FVA computes the minimum and maximum flux each reaction can carry while
maintaining at least fraction_of_optimum of the maximum growth rate. This
reveals which fluxes are uniquely determined vs. flexible.
from cobra.flux_analysis import flux_variability_analysis
# FVA at 90% of maximum growth
fva_result = flux_variability_analysis(
model,
fraction_of_optimum=0.90,
processes=4, # parallel workers
)
# fva_result is a DataFrame with columns "minimum" and "maximum"
print(fva_result.head(10))
# Identify rigidly constrained reactions (min ≈ max)
TOLERANCE = 1e-6
rigid = fva_result[
(fva_result["maximum"] - fva_result["minimum"]).abs() < TOLERANCE
]
print(f"\nRigid reactions (min=max): {len(rigid)}")
fva_result.to_csv("fva_result.csv")
Step 5 — Loopless FBA
Standard FBA may route flux through thermodynamically infeasible energy- generating cycles. Loopless FBA enforces thermodynamic feasibility.
loopless_sol = cobra.flux_analysis.loopless_solution(model)
print(f"Loopless growth : {loopless_sol.objective_value:.4f} h^-1")
loopless_sol.fluxes.to_csv("loopless_fluxes.csv",
header=["flux_mmol_gDW_h"])
Step 6 — Gene Knockout Simulations
# Single gene knockout (context manager — model is restored after)
gene_id = "b0720" # pgi in E. coli iJO1366
with model:
model.genes.get_by_id(gene_id).knock_out()
ko_solution = model.optimize()
print(f"KO {gene_id} growth: {ko_solution.objective_value:.4f} h^-1")
# Batch single gene deletions
from cobra.flux_analysis import single_gene_deletion
deletion_results = single_gene_deletion(model)
# Returns DataFrame: index = frozenset({gene_id}), columns = [growth, status]
deletion_results.to_csv("gene_deletions.csv")
# Essential genes: growth < 5% of wild-type
wt_growth = model.optimize().objective_value
essential = deletion_results[
deletion_results["growth"] < 0.05 * wt_growth
]
print(f"\nEssential genes: {len(essential)}")
print(essential.head())
Step 7 — Reaction Knockout Simulations
from cobra.flux_analysis import single_reaction_deletion
rxn_deletion_results = single_reaction_deletion(model)
rxn_deletion_results.to_csv("reaction_deletions.csv")
essential_rxns = rxn_deletion_results[
rxn_deletion_results["growth"] < 0.05 * wt_growth
]
print(f"Essential reactions: {len(essential_rxns)}")
Step 8 — Carbon Source Swapping
CARBON_SOURCES = {
"glucose": ("EX_glc_
자주 묻는 질문
플럭스 분포란 무엇인가요?
특정 조건에서 세포 모델이 예측하는 반응 속도의 집합입니다.
모델을 바꾸나요?
아니요. 스킬은 각 변경 후 모델을 복원하는 컨텍스트 매니저를 씁니다.
어떤 라이브러리를 쓰나요?
COBRApy이며, 제약 기반 모델링을 위한 Python 라이브러리입니다.
상세 정보
작성자의 원본 설명
Run Flux Balance Analysis (FBA) and related constraint-based simulations using COBRApy. Covers standard FBA, parsimonious FBA (pFBA), Flux Variability Analysis (FVA), loopless FBA, gene/reaction knockouts, and carbon source swapping. Outputs flux distributions and CSV files.
인기도
- GitHub 스타
- 15k
- 순위
- #11053
- 라이선스
- MIT
- 업데이트
- 2026. 8. 19.
댓글
- …
이 저장소의 다른 스킬
a-evolve
15k반복 실행에 걸쳐 실패를 진단하고, 오류 패턴에서 맞춤 스킬을 만들고, 나중에 쓸 교훈을 기록해 에이전트가 나아지도록 돕습니다.
biology-biopython
15kBiopython으로 DNA, RNA, 단백질 서열을 다루도록 에이전트를 돕습니다. 파일 파싱, 서열 계산, BLAST 검색, 데이터베이스 접근을 포함합니다.
chemistry-rdkit
15kRDKit으로 SMILES 문자열로 된 분자를 분석하도록 에이전트를 돕습니다. 기술자, 지문, 유사도, 부분 구조 검색을 포함합니다.
hypothesis-formulation
15k관찰 내용을 검증 가능한 가설로 바꾸도록 에이전트를 돕습니다. 경쟁하는 설명과, 가설이 틀렸음을 보여 줄 수 있는 명확한 예측을 포함합니다.
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.