Communitygithub.com

基因组智能 — DNA序列模型

直接从DNA序列预测调控特征、基因结构和表达水平,基于Genomic Intelligence平台。

基因组智能 — DNA序列模型 是什么?

Genomic Intelligence (GI) 是一个托管式的DNA语言模型推理服务,专为生物信息学与基因组学领域的AI代理设计。它通过一个轻量级客户端,将六种序列分析任务(启动子、剪接位点、增强子、染色质状态、基因表达 log TPM 以及从头基因注释)作为托管的版本化API提供。用户无需在本地安装任何模型权重、GPU或Python依赖——只需提供一个基因符号、基因组区域或DNA/FASTA序列,即可通过REST API或MCP服务器获取结构化的预测结果。该工具特别适合需要高通量序列建模的场景,例如从序列出发的基因发现、调控元件注释和细胞类型特异性表达预测。它支持从Ensembl等公共数据库获取序列,并处理序列获取、窗口切割和异步任务(如注释),确保大型预测不会占用上下文窗口。请注意,GI仅供研究用途,不适用于临床诊断决策。

兼容平台~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序列模型 是做什么的?

Genomic Intelligence (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托管了一个MCP服务器,地址为 https://mcp.genomicintelligence.ai/mcp(Streamable HTTP)。当您的代理主机支持MCP时,优先使用它:它对具有速率和并发限制的公共演示层无密钥工作,可选的 gi_ 承载密钥可提高这些限制。它公开了返回序列句柄 (sequence_ref) 的获取工具和接受该句柄的 predict_* 工具,因此大序列不会占用上下文。请参阅下面的 MCP工作流(基于句柄) 和 references/mcp.md。

REST API(通用)

使用 requests 通过普通HTTP与 https://api.genomicintelligence.ai/v1 通信。REST路径需要 GI_API_KEY(一个 gi_ 承载密钥)。在任何主机、脚本中或需要原始信封时使用它。请参阅 核心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 bpn/a (trained_window_bp 9,198)log(TPM+1);需要 tss_index,除非恰好9,198 bp,外加细胞类型 description
annotation异步1,000–500,000 bpn/a从头转录本;提交+轮询;超过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上限都是 422 validation_failed,位于 loc ["body","sequence"];过长不是 413。所有长度都是在去除空白字符后测量的,因此可以逐字粘贴换行的FASTA主体(> 标头行仍会导致字母表检查失败)。

options 是类型化的并且是封闭的(additionalProperties: false)每个任务 — 未知键是硬性 422 validation_failed,类型为 "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   # expression only
    # Each task is its own published operation, but the URL string is unchanged.
    r = requests.post(f"{BASE}/v1/tasks/{task}/predict", headers=HEADERS, json=body)
    # 422 validation_failed  — sequence under the task floor OR over 500,000 bp,
    #                          bad tss_index, missing options.description,
    #                          or ANY unknown body/options key (options is closed)
    # 401 no/bad key · 404 unknown task · 413 body over 16 MiB · 429 rate limit
    r.raise_for_status()
    return r.json()               # {"data": {...}, "meta": {...}}

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

# Expression — a pre-cut 9,198 bp TSS-centred window (tss_index defaults to 4,599):
out = predict("expression", tss_window_9198bp, "HBB",
              options={"description": "K562 cells"})
print(out["data"]["prediction"]["expression_log_tpm"])

# Expression — a whole locus; the server slices ±4,599 bp around the TSS you name.
# tss_index is 0-based into the whitespace-stripped sequence.
out = predict("expression", locus_seq, "HBB",
              options={"description": "K562 cells"}, tss_index=tss_offset_in_locus)
print(out["meta"]["task_specific_counts"]["scored_window"])   # confirm the window scored

异步(任何任务;注释推荐)

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:      # terminal: body is the final {data, meta}
        break
    j.raise_for_status()          # 202 = still running (2xx, won't raise)
    time.sleep(5)                 # ~20 s typical for ~20 kb
transcripts = j.json()["data"]["transcripts"]

MCP工作流(基于句柄)

在MCP主机上,先获取句柄,然后根据句柄进行预测 — 序列不进入上下文:

# 1. Acquire a sequence handle (each returns a sequence_ref):
load_demo_sequence(name="promoter_tp53")  # keyless smo

…

[为翻译而截断]

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.

相关技能