flux-analyzer
하는 일
스킬은 플럭스 시뮬레이션의 출력을 해석해 읽기 쉬운 결과와 그림을 만듭니다. 시뮬레이션 숫자가 무엇을 뜻하는지 설명해야 하는 연구자를 위한 스킬입니다.
사용하는 경우
- ✓플럭스 결과가 있고, 어떤 유전자가 필수적인지 알고 싶을 때.
- ✓위상 평면 그림이나 플럭스 샘플링 요약을 원할 때.
- ✓논문을 위해 경로 수준이나 생성물 분비 요약이 필요한 경우.
스킬 링크
https://github.com/aiming-lab/AutoResearchClaw/blob/main/external/agents/Biology-Agent/skills/flux-analyzer/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“모델에서 필수 유전자를 찾고, 산소 대 포도당의 위상 평면을 그려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 모델과 플럭스 결과를 불러오고, 유전자를 하나씩 제거해 성장이 어떻게 바뀌는지 보며, 설정한 기준 아래로 성장을 떨어뜨리는 유전자를 표시하고, 그림과 요약 표를 만듭니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Overview
The flux-analyzer skill transforms raw FBA output into actionable biological
knowledge. It operates on FBA result files and the COBRApy model to produce
gene essentiality maps, phenotypic phase planes (PPP), flux sampling
distributions, pathway-level summaries, and product secretion profiles.
This skill is the metabolic-modelling analogue of event reconstruction and phenomenology summary stage in the ColliderAgent pipeline: it turns numbers into biology.
Workflow
Step 1 — Load Model and FBA Results
import cobra
import cobra.io
import cobra.flux_analysis
import cobra.sampling
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
model = cobra.io.load_json_model("my_model.json")
fba_fluxes = pd.read_csv("fba_fluxes.csv", index_col=0)["flux_mmol_gDW_h"]
wt_growth = model.optimize().objective_value
print(f"Wild-type growth: {wt_growth:.4f} h^-1")
Step 2 — Gene Essentiality Analysis
Essential genes are those whose deletion reduces growth to below 5% of wild-type — a widely used lethality criterion.
from cobra.flux_analysis import single_gene_deletion, double_gene_deletion
# --- Single gene essentiality ---
sg_deletion = single_gene_deletion(model)
sg_deletion.columns = ["growth", "status"]
sg_deletion["is_essential"] = sg_deletion["growth"] < 0.05 * wt_growth
sg_deletion["growth_fraction"] = sg_deletion["growth"] / wt_growth
essential_genes = sg_deletion[sg_deletion["is_essential"]]
print(f"Essential genes: {len(essential_genes)} / {len(model.genes)}")
sg_deletion.to_csv("gene_essentiality.csv")
# --- Double gene essentiality (synthetic lethality) ---
# Limit to a focused gene set to reduce compute time
target_genes = list(model.genes)[:50] # adjust as needed
dg_deletion = double_gene_deletion(model, target_genes, target_genes)
dg_deletion.columns = ["growth", "status"]
dg_deletion["is_synthetic_lethal"] = dg_deletion["growth"] < 0.05 * wt_growth
dg_deletion.to_csv("double_gene_essentiality.csv")
Step 3 — Reaction Essentiality Analysis
from cobra.flux_analysis import single_reaction_deletion
sr_deletion = single_reaction_deletion(model)
sr_deletion.columns = ["growth", "status"]
sr_deletion["is_essential"] = sr_deletion["growth"] < 0.05 * wt_growth
essential_rxns = sr_deletion[sr_deletion["is_essential"]]
print(f"Essential reactions: {len(essential_rxns)} / {len(model.reactions)}")
sr_deletion.to_csv("reaction_essentiality.csv")
Step 4 — Phenotypic Phase Plane (PPP)
The PPP maps growth rate over a 2D grid of two nutrient uptake rates, revealing metabolic phase transitions (aerobic growth, mixed-acid fermentation, etc.).
from cobra.flux_analysis import production_envelope
# Phase plane: glucose uptake vs. oxygen uptake
ppp = production_envelope(
model,
["EX_glc__D_e", "EX_o2_e"], # x and y axes
objective=model.reactions.get_by_id("BIOMASS_Ec_iJO1366_core_53p95M"),
points=20,
)
print(ppp.head())
# Plot heatmap
fig, ax = plt.subplots(figsize=(8, 6))
pivot = ppp.pivot_table(
index="EX_o2_e", columns="EX_glc__D_e", values="flux_maximum"
)
im = ax.imshow(pivot.values, aspect="auto", origin="lower",
cmap="viridis",
extent=[ppp["EX_glc__D_e"].min(), ppp["EX_glc__D_e"].max(),
ppp["EX_o2_e"].min(), ppp["EX_o2_e"].max()])
plt.colorbar(im, ax=ax, label="Growth rate (h$^{-1}$)")
ax.set_xlabel("Glucose uptake (mmol/gDW/h)")
ax.set_ylabel("O$_2$ uptake (mmol/gDW/h)")
ax.set_title("Phenotypic Phase Plane")
fig.tight_layout()
fig.savefig("phenotypic_phase_plane.pdf", dpi=300)
fig.savefig("phenotypic_phase_plane.png", dpi=150)
plt.close(fig)
print("PPP saved to phenotypic_phase_plane.pdf")
Step 5 — Flux Sampling
Flux sampling explores the full space of feasible steady-state flux distributions, revealing which reactions have wide vs. narrow feasible ranges.
# OptGP sampler: Markov-chain Monte Carlo in flux cone
samples = cobra.sampling.sample(model, n=1000, method="optgp",
thinning=100, processes=4)
# samples is a DataFrame: rows = samples, columns = reaction IDs
samples.to_csv("flux_samples.csv", index=False)
# Violin plot for key central metabolism reactions
KEY_REACTIONS = ["PFK", "PGI", "PDH", "CS", "AKGDH",
"EX_glc__D_e", "EX_ac_e", "EX_co2_e"]
key_data = samples[[r for r in KEY_REACTIONS if r in samples.columns]]
fig, ax
자주 묻는 질문
유전자가 필수적이라고 어떻게 판단하나요?
그 유전자를 제거했을 때 성장이 야생형 성장 속도의 5퍼센트 아래로 떨어지면 필수 유전자로 봅니다.
위상 평면이란 무엇인가요?
두 입력을 바꿀 때 가능한 최대 성장이 어떻게 변하는지 보여 주는 그림입니다.
그림에는 어떤 도구를 쓰나요?
matplotlib을 쓰며, 화면 표시 없이 그림을 저장하도록 설정됩니다.
상세 정보
작성자의 원본 설명
Analyse FBA flux distributions to extract biological insights. Covers gene essentiality, phenotypic phase planes, flux sampling, pathway-level aggregation, secretion product prediction, and production of publication- quality figures.
인기도
- GitHub 스타
- 15k
- 순위
- #11054
- 라이선스
- 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을 출력하도록 돕습니다.