Communitygithub.com

基因體智能 — DNA 序列模型

透過基因體智能,從 DNA 序列直接預測調控特徵、基因結構與表現量。

基因體智能 — DNA 序列模型 是什麼?

基因體智能(Genomic Intelligence, GI)是一種 AI Agent 技能,可在託管 GPU 上運行 transformer DNA 語言模型,執行六種序列分析任務。使用者只需提供基因符號、基因體區域或 DNA/FASTA 序列,即可獲得結構化預測結果,包括啟動子區域、剪接位點、增強子活性、染色質狀態、表現量(log TPM)與從頭基因註解。此技能無需本地模型權重、GPU 或繁重的 Python 套件,而是作為精簡客戶端連接到託管的版本化推理 API。它支援 MCP(Streamable HTTP)與 REST API 兩種呼叫方式,前者無需 API 金鑰即可在 MCP 主機上使用,後者則需要在環境變數 `GI_API_KEY` 中設定金鑰。此技能特別適合需要從序列進行模型推論的場景,不適用於本地序列比對或變異體識別。開發者應注意每個任務有各自的最小/最大序列長度限制、封閉的選項物件與獨特的請求結構,特別是表現量預測任務需要精確的 TSS 索引與細胞類型描述。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/genomic-intelligence

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

基因體智能 — DNA 序列模型 是做什麼的?

基因體智能(GI)在託管 GPU 上運行 transformer DNA 語言模型,處理六種序列分析任務。提供基因符號、基因體區域或 DNA/FASTA 序列,它將回傳結構化預測結果 — 啟動子區域、剪接位點、增強子活性、染色質狀態、表現量(log TPM)以及從頭基因註解。無需在本機執行任何操作:不需要模型權重、GPU 或繁重的 Python 套件。它是針對託管、有版本管理的推理 API 的精簡客戶端。

官方文件: docs.genomicintelligence.ai · REST 合約位於 api.genomicintelligence.ai/v1/openapi.json · 託管 MCP 伺服器位於 https://mcp.genomicintelligence.ai/mcp

何時使用此技能

當使用者擁有 DNA 且需要模型預測時,請使用 GI:

  • 尋找啟動子 在基因體區域中 (promoter)
  • 預測剪接 供體/受體位點 (splice)
  • 評分增強子活性 — 發育型與看家型 (enhancer)
  • 註解染色質狀態 跨越數百條追蹤 (chromatin)
  • 預測表現量 以 log(TPM+1) 形式,從序列與細胞類型上下文得出 (expression)
  • 從頭註解基因/轉錄本,無需參考基因組 (annotation)
  • 找出區域中的基因並預測每個基因的表現量(複合)

不適用於本地比對、變異體識別或檔案 I/O — 請使用本地工具(BioPython,bcftools)處理這些作業。GI 是用於從序列進行模型推論。

研究與開發用途。不適用於臨床或診斷決策。

兩種呼叫 GI 的方式

託管 MCP 伺服器(無金鑰;在 MCP 主機上較佳)

GI 在 https://mcp.genomicintelligence.ai/mcp(Streamable HTTP)託管了一個 MCP 伺服器。當您的 Agent 主機支援 MCP 時,建議使用此方式:它在無金鑰的情況下,針對有速率和並發限制的公開試用層級運作,而選用的 gi_ bearer 金鑰可提高這些限制。它公開了獲取工具,可回傳序列控制代碼(sequence_ref)以及接收該控制代碼的 predict_* 工具,因此大型序列不會佔用上下文。請參閱下方的 MCP 工作流程 和 references/mcp.md。

REST API(通用)

使用 requests 透過 HTTP 與 https://api.genomicintelligence.ai/v1 通訊。REST 路徑需要 GI_API_KEY(一個 gi_ bearer 金鑰)。在任何主機上、腳本中,或當您需要原始封包時使用它。請參閱核心 REST 工作流程。

存取與驗證

  1. 託管 MCP 試用版本無需金鑰 — 不設定任何東西即可試用。
  2. REST /v1 API 需要金鑰,以 Authorization: Bearer <key> 的形式發送。 請透過 [email protected] 申請。
  3. 切勿將金鑰寫死在程式碼中。 從 GI_API_KEY 環境變數讀取(或透過 python-dotenv 從 .env 讀取)。切勿提交金鑰。
export GI_API_KEY="gi_yourkeyhere"     # MCP 選用;REST 必要
export GI_BASE_URL="https://api.genomicintelligence.ai"   # 用於覆蓋測試環境

金鑰範圍限定於合作夥伴層級,具有並發和每分鐘限制。429 表示已達到限制 — 請退避並重試,或要求 GI 提高您的層級。

六項任務

每項任務都是其自身已發布的操作,具有自己的請求結構、自己的最小長度以及自己的封閉 options 物件 — POST /v1/tasks/promoter/predict、/v1/tasks/splice/predict、/v1/tasks/enhancer/predict、/v1/tasks/chromatin/predict、/v1/tasks/annotation/predict、/v1/tasks/expression/predict。每個路徑都是一個字面字串,因此無需建構任何東西,也沒有共享的 PredictRequest 結構。請求本體為 {sequence, sequence_name?, model?, options?},回傳 {data, meta} 封包。各任務的差異如下:

任務建議模式接受長度context_window_bp備註
promoter同步300–500,000 bp2,000 bp滑動視窗啟動子區域
splice同步100–500,000 bp15,000 bp供體/受體位點(長上下文 BigBird);限制鏈 — 提交轉錄本方向
enhancer同步50–500,000 bp249 bp發育 + 看家評分(DeepSTARR,果蠅)
chromatin同步200–500,000 bp1,000 bp數百條追蹤(DeepSEA)
expression同步9,198–500,000 bp無 (trained_window_bp 9,198)log(TPM+1);需要 tss_index 除非剛好 9,198 bp,加上細胞類型 description
annotation非同步1,000–500,000 bp無從頭轉錄本;提交 + 輪詢;高於 200,000 bp 的同步請求回傳 413 sync_too_large

建議模式 是指導而非限制 — 每項任務皆接受兩種模式。省略 Prefer 以獲得同步 200;發送 Prefer: respond-async 以獲得 202 加上 GET /v1/tasks/jobs/{job_id}。唯一強制限制是按操作劃分:在 /v1/openapi.json 中,若 POST 上發布了 x-sync-limit-bp,則超過該長度的同步請求會回傳 413 sync_too_large — 截至 info.version 2026.09.10.1,annotation 為 200,000 bp,複合工作流程為 50,000 bp。請讀取該欄位,而非記住數字;其他預測任務目前沒有此限制。

最小值是准入控制,而非運作模式。 高於下限但短於所選模型 bio_spec.context_window_bp 的請求會被接受並評分 — 針對補齊至上下文視窗的視窗進行評分。Enhancer 是明顯案例:下限為 50 bp,但上下文視窗為 249 bp,因此 50–248 bp 主要根據補齊進行評分。請將您的長度與來自 GET /v1/tasks/{task}/models 的 context_window_bp 進行比較,以了解模型是否看到了真實序列。長於上下文的輸入沒問題 — 掃描器一次移動一個預測視窗,僅補齊最後一個部分視窗。

低於下限和高於 500,000 bp 上限的請求都會在 loc ["body","sequence"] 處回傳 422 validation_failed;過長不是 413。所有長度都是在移除空白字元後測量,因此可以逐字貼上換行的 FASTA 主體(> 標題行仍會導致字母檢查失敗)。

options 是類型化且封閉的(additionalProperties: false),按任務區分 — 未知金鑰會是硬性的 422 validation_failed,並帶有 type: "extra_forbidden",絕不會被忽略:

任務options 金鑰
promoterthreshold (0–1,預設 0.5)
splicethreshold (0–1,預設 0.5),site_types (["donor","acceptor"] 的子集,預設兩者)
enhancer(無)
chromatinthreshold (0–1,預設 0.5)
annotationbatch_size (1–128,預設 8),shift_coordinates,reverse_complement (預設 true)
expressiondescription — 必要,且為唯一金鑰

Prefer: respond-async 是在所有六個預測操作以及複合操作上宣告的標頭,不僅限於 annotation — 請參閱非同步。

省略 model,API 會使用該任務的預設值 — 這是建議的呼叫方式。預設模型 ID 故意不在此處文件化:預設值會變更,且已退役的 ID 會硬性失敗,因此切勿硬編碼一個。若要固定一個模型,或選擇非人類的模型(果蠅、酵母和阿拉伯芥模型存在於多項任務中),請在呼叫時使用 GET /v1/tasks/{task}/models(REST)或 list_models(MCP)發現 ID — 並且切勿自行發明一個。每個任務的完整輸出格式請參閱 references/tasks.md。

expression 是六項任務中最嚴格的:單獨其中,其結構要求 options 以及 sequence。它強制執行三項硬性規則 — 每次違規都會回傳 422,不會補齊或限制,且沒有選擇退出標誌、標頭或查詢參數:

  • 它總是對恰好一個 9,198 bp 的 TSS 中心視窗進行評分 — sequence[tss_index-4599 : tss_index+4599]。端點本身接受 9,198–500,000 bp;低於 9,198 bp 的會被直接拒絕。
  • tss_index 是必要的,除非序列剛好是 9,198 bp。 它是 移除空白字元後 序列中 0 為基礎的 TSS 偏移量,範圍限制為 4599 ≤ tss_index ≤ len(sequence) − 4599。在剛好 9,198 bp 時,它預設為 4,599,這是唯一合法的值。因此您可以提交整個基因座(最多 500 kb)並讓伺服器切割視窗 — 但伺服器不會為您發現 TSS(這是複合工作流程的工作),也不會反向互補:請提交基因有意義鏈的序列。
  • options.description — 一個細胞類型/檢測字串(例如 "K562 cells")— 是必要的,且是 expression 在 options 內接受的唯一金鑰。未知的頂層本體欄位也會被拒絕。

注意:合法的 tss_index 範圍很廣,因此一個僅是錯誤的偏移量(在包括換行符的原始 FASTA 字元上計算,或相對於基因座起點而非提交的切片計算)不會引發錯誤 — 它會針對錯誤的視窗回傳一個確定的 200。請斷言回應中的 meta.task_specific_counts.scored_window / .tss_index。您提交的長度是 meta.sequence_length(也在 data.input.submitted_sequence_length 中回顯);評分的寬度始終是 9,198,即 scored_window[1] - scored_window[0]。(data.input.sequence_length 已在合約修訂版 13 中移除。)

兩個 tss_index 違規 — "除非剛好是 9,198 bp,否則為必要"和範圍檢查 — 都來自整個模型的驗證器,因此它們出現在本體層級而非 tss_index 之下。請比對 error.code == "validation_failed" 並僅將訊息用於顯示。此技能中引用的任何 loc 元組僅為該形狀的說明範例,並非合約的一部分:它未在結構中發布,且不應根據它進行分支。

序列獲取

您很少從原始的 9,198 bp 字串開始。請先獲取序列:

  • 從基因符號 → MCP fetch_ensembl_sequence(gene=...);從座標 → fetch_region(region=...)。兩者都擷取公開的 Ensembl 參考序列(無需金鑰)。REST 使用者可以直接查詢 Ensembl REST。(find_genes 是註解任務,而非獲取工具。)
  • 用於 expression → 使用 TSS 中心擷取,使視窗恰好為 9,198 bp。MCP:fetch_gene_for_expression(處理居中)。否則擷取一個更寬的基因座並將 TSS 作為 tss_index 傳遞,以便伺服器切割視窗 — 但請在移除空白字元的核苷酸字串上計算該偏移量,而非在檔案字元上。
  • 從本地 FASTA → MCP store_inline_sequence,或自行讀取檔案以用於 REST。(load_local_fasta 僅存在於本地部署中,不存在於託管伺服器上。)
  • 示範序列 → MCP load_demo_sequence(name=...) 回傳一個立即可用的控制代碼,用於無金鑰的整合測試;name 是必要的。

請參閱 references/sequence-acquisition.md 以了解確切的 Ensembl 呼叫和表現量視窗數學。

核心 REST 工作流程

同步呼叫 — 所有任務的預設方式 — 一次預測即為一次呼叫:

import os, requests

BASE = os.environ.get("GI_BASE_URL", "https://api.genomicintelligence.ai")
HEADERS = {"Authorization": f"Bearer {os.environ['GI_API_KEY']}"}

def predict(task, sequence, sequence_name, model=None, options=None, tss_index=None):
    body = {"sequence": sequence, "sequence_name": sequence_name}
    if model:   body["model"] = model
    if options: body["options"] = options
    if tss_index is not None: body["tss_index"] = tss_index   # 僅表現量
    # 每個任務都是其自身已發布的操作,但 URL 字串保持不變。
    r = requests.post(f"{BASE}/v1/tasks/{task}/predict", headers=HEADERS, json=body)
    # 422 validation_failed  — 序列低於任務下限 OR 超過 500,000 bp,
    #                          錯誤的 tss_index,遺失 options.description,
    #                          或 ANY 未知的 body/options 金鑰 (options 是封閉的)
    # 401 無金鑰/金鑰錯誤 · 404 未知任務 · 413 主體超過 16 MiB · 429 速率限制
    r.raise_for_status()
    return r.json()               # {"data": {...}, "meta": {...}}

# Promoter:
out = predict("promoter", seq, "TP53_region")
print(out["data"]["summary"])

# Expression — 一個預先切割的 9,198 bp TSS 中心視窗 (tss_index 預設為 4,599):
out = predict("expression", tss_window_9198bp, "HBB",
              options={"description": "K562 cells"})
print(out["data"]["prediction"]["expression_log_tpm"])

# Expression — 一個完整的基因座;伺服器圍繞您命名的 TSS 切片 ±4,599 bp。
# tss_index 是 0 為基礎的,進入移除空白字元的序列。
out = predict("expression", locus_seq, "HBB",
              options={"description": "K562 cells"}, tss_index=tss_offset_in_locus)
print(out["meta"]["task_specific_counts"]["scored_window"])   # 確認評分的視窗

非同步(任何任務;建議用於註解)

Prefer: respond-async 是在所有六個預測操作和複合操作上宣告的標頭參數。202 攜帶與同步 200 相同的 {data, meta} 封包,並帶有 data = {job_id, status: "accepted", links};任務 ID 也位於 Content-Location 和 X-Job-Id 回應標頭中。非同步僅限 JSON — 與文字 format 結合使用會被拒絕。annotation 是需要它的任務:

import time

r = requests.post(f"{BASE}/v1/tasks/annotation/predict",
                  headers={**HEADERS, "Prefer": "respond-async"},
                  json={"sequence": seq, "sequence_name": "TP53"})
r.raise_for_status()              # 202 Accepted
job_id = r.json()["data"]["job_id"]

while True:
    j = requests.get(f"{BASE}/v1/tasks/jobs/{job_id}", headers=HEADERS)
    if j.status_code == 200:      # 終端:主體為最終的 {data, meta}
        break
    j.raise_for_status()          # 202 = 仍在執行中 (2xx,不會引發異常)
    time.sleep(5)                 # 約 20 kb 約需 20 秒
轉錄本 = j.json()["data"]["transcripts"]

MCP 工作流程(基於控制代碼)

在 MCP 主機上,獲取一個控制代碼,然後對其進行預測 — 序列保持在上下文之外:

# 1. 獲取一個序列控制代碼 (每個都回傳一個 sequence_ref):
load_demo_sequence(name="promoter_tp53")  # 無金鑰整合測試

…

[已為翻譯截斷]

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

adaptyv

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

alphagenome

Look up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.

analytical-method-validation

Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

arbor

Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g.

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

autoskill

Observe the user

benchling-integration

Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.

bgpt-paper-search

Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.

bids

>

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use biopython.

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g.

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

citation-management

Comprehensive citation management for academic research. Search OpenAlex, PubMed, and Google Scholar for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

clinical-decision-support

Prepare and validate research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts. Use for aggregate or synthetic research documentation and traceability—not patient care or live clinical operation.

clinical-reports

Create safety-bounded draft structures and run local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.

相關技能