ncbi-datasets-api
Access genomes, genes, and taxonomy data via NCBI Datasets v2 API
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Access genomes, genes, and taxonomy data via NCBI Datasets v2 API
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
公司金融实证研究的"漏斗式选题查找器"。互动开场先后询问 (1) 研究方向、(2) 候选标题数量 N, 再扫描全球文献(已出版英文学术期刊 + SSRN working paper + 全球高校 department seminar 1 年内日程),基于 Edmans (2024) "1000 Rejections" 红线生成 N 个候选标题,**通过并行 subagent(Agent 工具)批量生成计划书 + 查新;每个 subagent 必须强制调用 Skill 工具加载 econfin-proposal 与 novelty-check 两个预设 skill 完成各自模块**,**只有当 novelty score >= 9 时(即 JF/JFE/RFS 顶刊层次),subagent 才把 proposal + 查新报告合并的 md 写入 F:\Dropbox\CC\选题大全\<研究方向短名>\(以"简短选题名称-分数"命名,子文件夹名由 Step 0 从用户输入的研究方向派生);< 9 分的选题在 subagent 内部直接丢弃,绝不写盘、绝不输出**。当用户说"找选题"、"帮我找选题"、"想做 X 方向"、 "empirical CF idea search"、"批量生成研究计划书"、"100 ideas"、"econfin-idea-finder" 时触发。
Create and compile beautiful Beamer presentations following the Rhetoric of Decks philosophy. Use when making slides, creating decks, or compiling .tex presentation files.
Scaffold a new research project with standard directory structure, CLAUDE.md template, and documented README. Use this at the start of every new project to ensure consistent organization.
Download, split, and deeply read academic PDFs. Use when asked to read, review, or summarize an academic paper. Splits PDFs into 4-page chunks, reads them in small batches, and produces structured reading notes — avoiding context window crashes and shallow comprehension.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
| name | ncbi-datasets-api |
| description | Access genomes, genes, and taxonomy data via NCBI Datasets v2 API |
| metadata | {"openclaw":{"emoji":"🧬","category":"domains","subcategory":"biomedical","keywords":["NCBI","genome data","gene data","taxonomy","RefSeq","GenBank"],"source":"https://www.ncbi.nlm.nih.gov/datasets/"}} |
NCBI Datasets is the modern API for accessing NCBI's genomic, gene, and taxonomic data — replacing older E-utilities for sequence data retrieval. It provides clean REST endpoints for genome assemblies, gene records, taxonomy trees, and sequence downloads. Covers all organisms in NCBI's databases including RefSeq and GenBank. Free, no authentication required.
https://api.ncbi.nlm.nih.gov/datasets/v2
# Search genome assemblies by organism
curl "https://api.ncbi.nlm.nih.gov/datasets/v2/genome/taxon/9606?page_size=5"
# Get assembly by accession
curl "https://api.ncbi.nlm.nih.gov/datasets/v2/genome/accession/GCF_000001405.40"
# Download genome package
curl -o genome.zip \
"https://api.ncbi.nlm.nih.gov/datasets/v2/genome/accession/GCF_000001405.40/download?\
include_annotation_type=GENOME_FASTA,GENOME_GFF"
# Search genes by symbol
curl "https://api.ncbi.nlm.nih.gov/datasets/v2/gene/symbol/TP53/taxon/human"
# Get gene by NCBI Gene ID
curl "https://api.ncbi.nlm.nih.gov/datasets/v2/gene/id/7157"
# Search genes by keyword
curl "https://api.ncbi.nlm.nih.gov/datasets/v2/gene/search?query=BRCA&taxon=9606&page_size=20"
# Download gene data package
curl -o gene.zip \
"https://api.ncbi.nlm.nih.gov/datasets/v2/gene/id/7157/download?include_annotation_type=FASTA_GENE"
# Get taxonomy info
curl "https://api.ncbi.nlm.nih.gov/datasets/v2/taxonomy/taxon/9606"
# Search taxonomy by name
curl "https://api.ncbi.nlm.nih.gov/datasets/v2/taxonomy/name_report?taxon_query=Homo+sapiens"
# Get taxonomy tree (subtree)
curl "https://api.ncbi.nlm.nih.gov/datasets/v2/taxonomy/taxon/9443/subtree"
| Parameter | Description | Example |
|---|---|---|
page_size | Results per page | page_size=20 |
page_token | Pagination token | From previous response |
include_annotation_type | Download content | GENOME_FASTA, GENOME_GFF, PROT_FASTA |
filters.assembly_level | Assembly quality | complete_genome, chromosome |
filters.refseq_only | RefSeq assemblies | true |
{
"genes": [
{
"gene": {
"gene_id": 7157,
"symbol": "TP53",
"description": "tumor protein p53",
"taxname": "Homo sapiens",
"tax_id": 9606,
"type": "PROTEIN_CODING",
"chromosomes": ["17"],
"genomic_ranges": [
{
"accession_version": "NC_000017.11",
"range": [{"begin": 7668402, "end": 7687550, "orientation": "minus"}]
}
],
"nomenclature": {
"symbol": "TP53",
"name": "tumor protein p53"
},
"annotations": [
{"release_date": "2024-03-15", "release_name": "GRCh38.p14"}
]
}
}
]
}
import requests
import zipfile
import io
BASE_URL = "https://api.ncbi.nlm.nih.gov/datasets/v2"
def search_genes(query: str, taxon: str = "human",
page_size: int = 20) -> list:
"""Search NCBI genes by keyword."""
resp = requests.get(
f"{BASE_URL}/gene/search",
params={"query": query, "taxon": taxon,
"page_size": page_size},
)
resp.raise_for_status()
data = resp.json()
results = []
for item in data.get("genes", []):
gene = item.get("gene", {})
results.append({
"gene_id": gene.get("gene_id"),
"symbol": gene.get("symbol"),
"description": gene.get("description"),
"type": gene.get("type"),
"chromosomes": gene.get("chromosomes", []),
"taxname": gene.get("taxname"),
})
return results
def get_gene(gene_id: int) -> dict:
"""Get detailed gene information."""
resp = requests.get(f"{BASE_URL}/gene/id/{gene_id}")
resp.raise_for_status()
genes = resp.json().get("genes", [])
return genes[0].get("gene", {}) if genes else {}
def search_genomes(taxon: str, refseq_only: bool = True,
page_size: int = 10) -> list:
"""Search genome assemblies by organism."""
params = {"page_size": page_size}
if refseq_only:
params["filters.refseq_only"] = "true"
resp = requests.get(
f"{BASE_URL}/genome/taxon/{taxon}",
params=params,
)
resp.raise_for_status()
data = resp.json()
results = []
for report in data.get("reports", []):
assembly = report.get("assembly_info", {})
stats = report.get("assembly_stats", {})
results.append({
"accession": report.get("accession"),
"name": assembly.get("assembly_name"),
"level": assembly.get("assembly_level"),
"organism": report.get("organism", {}).get("organism_name"),
"total_length": stats.get("total_sequence_length"),
"contig_n50": stats.get("contig_n50"),
})
return results
# Example: search cancer-related genes
genes = search_genes("tumor suppressor", taxon="human")
for g in genes[:5]:
print(f"{g['symbol']} (ID: {g['gene_id']}): {g['description']}")
print(f" Type: {g['type']} | Chr: {', '.join(g['chromosomes'])}")
# Example: find reference genomes
genomes = search_genomes("Mus musculus", refseq_only=True)
for g in genomes[:3]:
print(f"{g['accession']}: {g['name']} ({g['level']})")
print(f" Length: {g['total_length']:,} bp")
NCBI also provides a command-line tool:
# Install
curl -o datasets "https://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/v2/linux-amd64/datasets"
chmod +x datasets
# Download human genome
./datasets download genome taxon "Homo sapiens" --reference --include genome
# Download gene data
./datasets download gene gene-id 7157 --include gene