본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트15k · #11054

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/aiming-lab/AutoResearchClaw/blob/main/external/agents/Biology-Agent/skills/flux-analyzer/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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.

repo: aiming-lab/AutoResearchClaw

인기도

GitHub 스타
15k
순위
#11054
라이선스
MIT
업데이트
2026. 8. 19.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬