gene-knowledge-integration

Given a gene symbol (e.g. TPMT), query 3 public databases (ClinGen CAR, PharmGKB, Monarch) to obtain gene registry info, FDA drug labels, clinical annotations, and gene-phenotype associations. Save all results into a JSON file.

Best use case

gene-knowledge-integration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Given a gene symbol (e.g. TPMT), query 3 public databases (ClinGen CAR, PharmGKB, Monarch) to obtain gene registry info, FDA drug labels, clinical annotations, and gene-phenotype associations. Save all results into a JSON file.

Teams using gene-knowledge-integration should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/gene-knowledge-integration/SKILL.md --create-dirs "https://raw.githubusercontent.com/SpectrAI-Initiative/InnoClaw/main/.claude/skills/gene-knowledge-integration/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/gene-knowledge-integration/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How gene-knowledge-integration Compares

Feature / Agentgene-knowledge-integrationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Given a gene symbol (e.g. TPMT), query 3 public databases (ClinGen CAR, PharmGKB, Monarch) to obtain gene registry info, FDA drug labels, clinical annotations, and gene-phenotype associations. Save all results into a JSON file.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Gene Knowledge Integration

## Usage

### 1. Tool Descriptions

This skill chains 3 public genomics/pharmacogenomics database APIs sequentially to build a comprehensive pharmacogenomics profile for a given gene.

**Tool 1: ClinGen CAR — Gene Registry Info**

```tex
Query ClinGen Allele Registry API to get gene registration information.
API: GET https://reg.genome.network/gene?HGNC.symbol={gene_symbol}
Args:
    gene_symbol (str): HGNC gene symbol (e.g. "TPMT")
Return:
    Gene record (dict): Contains @id (GN id), locus (genomic coordinates),
        externalRecords (HGNC id/name/symbol, NCBI gene id, MANE transcripts).
```

**Tool 2: PharmGKB (ClinPGx) — Gene Info, FDA Labels & Clinical Annotations**

```tex
Query PharmGKB ClinPGx API to get pharmacogenomics information.
API (gene):   GET https://api.clinpgx.org/v1/data/gene?symbol={gene_symbol}&view=base
API (labels): GET https://api.clinpgx.org/v1/data/label?source=fda&relatedGenes.symbol={gene_symbol}&view=base
API (clin):   GET https://api.clinpgx.org/v1/data/clinicalAnnotation?location.genes.symbol={gene_symbol}&view=base
Args:
    gene_symbol (str): HGNC gene symbol (e.g. "TPMT")
Return:
    gene: PharmGKB gene record with accession id, alternate names, cross-references.
    labels: FDA drug labels mentioning this gene (drug name, source, testing level).
    clinicalAnnotations: Clinical annotations linking genotype to phenotype
        (level of evidence, related chemicals, phenotype categories).
```

**Tool 3: Monarch Initiative — Gene-Phenotype Associations**

```tex
Query Monarch Initiative API to get gene-to-phenotype associations.
API: GET https://api-v3.monarchinitiative.org/v3/api/entity/{hgnc_id}/biolink:GeneToPhenotypicFeatureAssociation
Args:
    hgnc_id (str): HGNC identifier (e.g. "HGNC:12014" for TPMT)
Return:
    items (list): Each item contains subject (gene), object (phenotype HP term),
                  object_label (phenotype name), evidence_types, publications.
```

### 2. Gene Knowledge Integration

Query 3 databases (ClinGen CAR → PharmGKB → Monarch) for a given gene symbol, then save all results into a single JSON file `{gene_symbol}_knowledge.json`.

```python
import requests
import json
from datetime import datetime

gene_symbol = "TPMT"
results = {"query_gene": gene_symbol, "timestamp": datetime.now().isoformat()}

# ── Step 1: ClinGen CAR — 基因注册信息 ──
# 调用 ClinGen Allele Registry API,获取基因的 GN id、基因组坐标、
# HGNC/NCBI 外部记录和 MANE 转录本信息。
car_url = f"https://reg.genome.network/gene?HGNC.symbol={gene_symbol}"
car_resp = requests.get(car_url, headers={"Accept": "application/json"}, timeout=30)
car = car_resp.json()
results["clingen_car"] = car
hgnc_id = car.get("externalRecords", {}).get("HGNC", {}).get("id", "")
print(f"[ClinGen CAR] 基因={gene_symbol}, GN_id={car.get('@id','')}, HGNC={hgnc_id}")

# ── Step 2a: PharmGKB — 基因信息 ──
# 调用 PharmGKB ClinPGx API,获取基因的药物基因组学基本信息。
pgx_gene_url = f"https://api.clinpgx.org/v1/data/gene?symbol={gene_symbol}&view=base"
pgx_gene_resp = requests.get(pgx_gene_url, timeout=30)
pgx_gene = pgx_gene_resp.json()
results["pharmgkb_gene"] = pgx_gene
print(f"[PharmGKB] 基因信息获取成功")

# ── Step 2b: PharmGKB — FDA 药物标签 ──
# 查询与该基因相关的 FDA 药物标签,了解哪些药物的说明书提到了该基因。
pgx_label_url = (
    f"https://api.clinpgx.org/v1/data/label"
    f"?source=fda&relatedGenes.symbol={gene_symbol}&view=base"
)
pgx_labels_resp = requests.get(pgx_label_url, timeout=30)
pgx_labels = pgx_labels_resp.json()
results["pharmgkb_fda_labels"] = pgx_labels
print(f"[PharmGKB] FDA药物标签获取成功")

# ── Step 2c: PharmGKB — 临床注释 ──
# 查询该基因相关的临床注释,包含基因型-表型关联的证据等级。
pgx_clin_url = (
    f"https://api.clinpgx.org/v1/data/clinicalAnnotation"
    f"?location.genes.symbol={gene_symbol}&view=base"
)
pgx_clin_resp = requests.get(pgx_clin_url, timeout=30)
pgx_clin = pgx_clin_resp.json()
results["pharmgkb_clinical_annotations"] = pgx_clin
print(f"[PharmGKB] 临床注释获取成功")

# ── Step 3: Monarch — 基因表型关联 ──
# 调用 Monarch Initiative API,获取该基因关联的表型(HPO terms),
# 需要使用 Step 1 中获取的 HGNC id。
if hgnc_id:
    monarch_url = (
        f"https://api-v3.monarchinitiative.org/v3/api/entity/{hgnc_id}"
        f"/biolink:GeneToPhenotypicFeatureAssociation"
    )
    monarch_resp = requests.get(monarch_url, timeout=30)
    monarch = monarch_resp.json()
    items = monarch.get("items", [])
    results["monarch_phenotypes"] = {
        "association_count": len(items),
        "associations": items
    }
    phenotypes = [i.get("object_label", "") for i in items[:5]]
    print(f"[Monarch] 表型关联数={len(items)}, 前5个={phenotypes}")
else:
    results["monarch_phenotypes"] = {"error": "HGNC id not found from ClinGen CAR"}
    print("[Monarch] 跳过: 未获取到 HGNC id")

# ── 保存结果到 JSON 文件 ──
output_file = f"{gene_symbol}_knowledge.json"
with open(output_file, "w", encoding="utf-8") as f:
    json.dump(results, f, indent=2, ensure_ascii=False)
print(f"\n✓ 所有结果已保存: {output_file}")
```

Related Skills

tcga-gene-expression

370
from SpectrAI-Initiative/InnoClaw

Retrieve gene expression data from TCGA (The Cancer Genome Atlas) to analyze cancer-specific expression patterns.

region-gene-elements

370
from SpectrAI-Initiative/InnoClaw

Query IGVF Catalog for regulatory element–gene associations within a genomic region, including association scores, element types, and biosample context.

rare_disease_genetics

370
from SpectrAI-Initiative/InnoClaw

Rare Disease Genetic Analysis - Analyze rare disease genetics: Monarch phenotype-disease mapping, ClinVar variants, NCBI gene data, and OpenTargets. Use this skill for rare disease genetics tasks involving get HPO ID by phenotype get joint associated diseases by HPO ID list clinvar search get associated targets by disease efoId. Combines 4 tools from 3 SCP server(s).

protocol-generation-from-description

370
from SpectrAI-Initiative/InnoClaw

Generate detailed laboratory protocols from natural language descriptions using AI, producing step-by-step experimental procedures ready for lab execution.

population_genetics

370
from SpectrAI-Initiative/InnoClaw

Population Genetics Analysis - Analyze population genetics: Ensembl variation populations, linkage disequilibrium, and variant frequency data. Use this skill for population genetics tasks involving get info variation populations get ld get variation get variant recoder. Combines 4 tools from 1 SCP server(s).

ncbi_gene_deep_dive

370
from SpectrAI-Initiative/InnoClaw

NCBI Gene Deep Dive - Deep dive into NCBI gene: metadata, dataset report, product report, orthologs, and gene links. Use this skill for gene biology tasks involving get gene metadata by gene name get gene dataset report by id get gene product report by id get gene orthologs get gene links by id. Combines 5 tools from 1 SCP server(s).

ncbi-gene-retrieval

370
from SpectrAI-Initiative/InnoClaw

Retrieve gene information from NCBI Gene database by gene IDs to obtain genomic details, function, and expression data.

multispecies_gene_analysis

370
from SpectrAI-Initiative/InnoClaw

Multi-Species Gene Analysis - Analyze gene across species: Ensembl homologs, NCBI orthologs, cross-species STRING similarity, and taxonomy. Use this skill for comparative genomics tasks involving get homology symbol get gene orthologs get best similarity hits between species get taxonomy. Combines 4 tools from 3 SCP server(s).

multiomics_integration

370
from SpectrAI-Initiative/InnoClaw

Multi-Omics Integration - Integrate multi-omics: gene expression, protein data, pathway enrichment, and metabolic pathways. Use this skill for multi-omics tasks involving get gene expression across cancers get uniprotkb entry by accession get functional enrichment kegg get. Combines 4 tools from 4 SCP server(s).

kegg-gene-search

370
from SpectrAI-Initiative/InnoClaw

Search KEGG database for gene information to retrieve pathway associations, functional annotations, and disease links.

genetic_counseling_report

370
from SpectrAI-Initiative/InnoClaw

Genetic Counseling Variant Report - Generate variant report for genetic counseling: VEP, ClinVar, gene phenotype, and literature evidence. Use this skill for clinical genetics tasks involving get vep hgvs clinvar search get phenotype gene pubmed search. Combines 4 tools from 2 SCP server(s).

gene_variant_drug_nexus

370
from SpectrAI-Initiative/InnoClaw

Gene-Variant-Drug Nexus - Connect gene variants to drugs: variant effect, gene-disease link, drug associations, and clinical evidence. Use this skill for translational genomics tasks involving get vep hgvs get associated targets by disease efoId get associated drugs by target name clinvar search. Combines 4 tools from 3 SCP server(s).