mcpField
M
monarch-database

monarch-database

github.com/leonchaoxデータ・データベース98570 回インストール14 週間前に更新
リポジトリ

monarch-database について

monarch-databaseは、Monarch Initiativeの多種生物統合ナレッジベースを扱う研究向けスキルです。APIを通じて、表現型、遺伝子、疾患、モデル生物の関連を調べられます。

主な機能

  1. 01HPO表現型から候補遺伝子を検索
  2. 02疾患と遺伝子の関連を照会
  3. 03遺伝子に関連する表現型を取得
  4. 04HPO用語の検索と参照
  5. 05疾患間の表現型類似度を比較
  6. 06種をまたいだオーソログを照会

活用シーン

  1. 01患者の表現型から希少疾患の遺伝子を絞り込む
  2. 022つの疾患の表現型プロファイルを比較
  3. 03ヒト疾患の動物モデルを探す

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/leonchaox/qinyan-academic-skills --skill monarch-database

インストール後、Claude Code で/monarch-databaseを入力して読み込まれたか確認します。

同梱ファイルreferences/phenotype_ontology.md

詳細

Monarch Initiative データベース

概要

Monarch Initiative(https://monarchinitiative.org/)は、ヒトとモデル生物を横断して遺伝子、疾患、表現型を結び付ける、複数種を対象とした統合ナレッジベースです。OMIM、ORPHANET、HPO(Human Phenotype Ontology)、ClinVar、MGI(Mouse Genome Informatics)、ZFIN(ゼブラフィッシュ)、RGD(ラット)、FlyBase、WormBaseなど、40を超えるデータソースを統合しています。

Monarch では、次のことができます。

  • 種をまたいで表現型を対応付け、疾患候補遺伝子を特定する
  • 疾患または表現型に関連するすべての遺伝子を検索する
  • ヒトの疾患に対応するモデル生物を見つける
  • 表現型オントロジーのクエリでHPO階層をたどる

主なリソース:

このスキルを使う場面

次の場合に Monarch を使用します。

  • 希少疾患の原因遺伝子の発見:患者の表現型(HPO用語)に関連する遺伝子は何ですか?
  • 表現型の類似性:表現型プロファイルに基づいて、2つの疾患は類似していますか?
  • 種をまたいだモデル化:対象の疾患に対応するマウスやゼブラフィッシュのモデルはありますか?
  • HPO用語の検索:HPO用語の名称、定義、オントロジー階層を取得する
  • 疾患と表現型の対応付け:特定の疾患に関連するすべてのHPO用語を一覧表示する
  • 遺伝子と表現型の関連付け:ある遺伝子の変異によってどのような表現型が生じますか?
  • オルソログと表現型の対応付け:動物モデルの表現型を用いて、ヒトの遺伝子機能を推定する

主な機能

1. Monarch API v3

ベース URL:https://api-v3.monarchinitiative.org/v3/

import requests

BASE_URL = "https://api-v3.monarchinitiative.org/v3"

def monarch_get(endpoint, params=None):
    """Make a GET request to the Monarch API."""
    url = f"{BASE_URL}/{endpoint}"
    response = requests.get(url, params=params, headers={"Accept": "application/json"})
    response.raise_for_status()
    return response.json()
2. 表現型と遺伝子の関連付け(Pheno2Gene)
def get_genes_for_phenotypes(hpo_ids, limit=50, offset=0):
    """
    Find genes associated with a list of HPO phenotype terms.
    Core use case: rare disease differential diagnosis.

    Args:
        hpo_ids: List of HPO term IDs (e.g., ["HP:0001250", "HP:0004322"])
        limit: Maximum number of results
    """
    params = {
        "terms": hpo_ids,
        "limit": limit,
        "offset": offset
    }
    return monarch_get("semsim/termset-pairwise-similarity/analyze", params)

def phenotype_to_gene(hpo_ids):
    """
    Return genes whose phenotypes match the given HPO terms.
    Uses semantic similarity scoring.
    """
    # Use the /association endpoint for direct phenotype-gene links
    all_genes = []
    for hpo_id in hpo_ids:
        data = monarch_get("association/all", {
            "subject": hpo_id,
            "predicate": "biolink:has_phenotype",
            "category": "biolink:GeneToPhenotypicFeatureAssociation",
            "limit": 50
        })
        for assoc in data.get("items", []):
            all_genes.append({
                "phenotype_id": hpo_id,
                "gene_id": assoc.get("object", {}).get("id"),
                "gene_name": assoc.get("object", {}).get("name"),
                "evidence": assoc.get("evidence_type")
            })
    return all_genes

# Example: Find genes associated with seizures and short stature
hpo_terms = ["HP:0001250", "HP:0004322"]  # Seizures, Short stature
genes = phenotype_to_gene(hpo_terms)
3. 疾患と遺伝子の関連付け
def get_genes_for_disease(disease_id, limit=100):
    """
    Get all genes associated with a disease.
    Disease IDs: OMIM:146300, MONDO:0007739, ORPHANET:558, etc.
    """
    params = {
        "object": disease_id,
        "category": "biolink:DiseaseToDiseaseAssociation",
        "limit": limit
    }
    # Use the gene-disease association endpoint
    gene_params = {
        "subject": disease_id,
        "category": "biolink:GeneToPhenotypicFeatureAssociation",
        "limit": limit
    }

    data = monarch_get("association/all", {
        "object": disease_id,
        "predicate": "biolink:has_phenotype",
        "limit": limit
    })
    return data

def get_disease_genes(disease_id, limit=100):
    """Get genes causally linked to a disease."""
    data = monarch_get("association/all", {
        "subject_category": "biolink:Gene",
        "object": disease_id,
        "predicate": "biolink:causes",
        "limit": limit
    })
    return data.get("items", [])

# MONDO disease IDs (preferred over OMIM for cross-ontology queries)
# MONDO:0007739 - Huntington disease
# MONDO:0009061 - Cystic fibrosis
# OMIM:104300 - Alzheimer disease, susceptibility to, type 1
4. 遺伝子と表現型・疾患の関連付け
def get_phenotypes_for_gene(gene_id, limit=100):
    """
    Get all phenotypes associated with a gene.
    Gene IDs: HGNC:7884, NCBIGene:4137, etc.
    """
    data = monarch_get("association/all", {
        "subject": gene_id,
        "predicate": "biolink:has_phenotype",
        "limit": limit
    })
    return data.get("items", [])

def get_diseases_for_gene(gene_id, limit=100):
    """Get diseases caused by variants in a gene."""
    data = monarch_get("association/all", {
        "subject": gene_id,
        "object_category": "biolink:Disease",
        "limit": limit
    })
    return data.get("items", [])

# Example: What diseases does BRCA1 cause?
brca1_diseases = get_diseases_for_gene("HGNC:1100")
for assoc in brca1_diseases:
    print(f"  {assoc.get('object', {}).get('name')} ({assoc.get('object', {}).get('id')})")
5. HPO用語の検索
def get_hpo_term(hpo_id):
    """Fetch information about an HPO term."""
    return monarch_get(f"entity/{hpo_id}")

def search_hpo_terms(query, limit=20):
    """Search for HPO terms by name."""
    params = {
        "q": query,
        "category": "biolink:PhenotypicFeature",
        "limit": limit
    }
    return monarch_get("search", params)

# Example: look up the HPO term for seizures
seizure_term = get_hpo_term("HP:0001250")
print(f"Name: {seizure_term.get('name')}")
print(f"Definition: {seizure_term.get('description')}")

# Search for related terms
epilepsy_terms = search_hpo_terms("epilepsy")
for term in epilepsy_terms.get("items", [])[:5]:
    print(f"  {term['id']}: {term['name']}")
6. 意味的類似性(疾患の比較)
def compare_disease_phenotypes(disease_id_1, disease_id_2):
    """
    Compare two diseases by semantic similarity of their phenotype profiles.
    Returns similarity score using HPO hierarchy.
    """
    params = {
        "subjects": [disease_id_1],
        "objects": [disease_id_2],
        "metric": "ancestor_information_content"
    }
    return monarch_get("semsim/compare", params)

# Example: Compare Dravet syndrome with CDKL5-deficiency disorder
similarity = compare_disease_phenotypes("MONDO:0100135", "MONDO:0014917")
7. 種をまたいだオルソログ
def get_orthologs(gene_id, species=None):
    """
    Get orthologs of a human gene in model organisms.
    Useful for finding animal models of human diseases.
    """
    params = {"limit": 50}
    if species:
        params["subject_taxon"] = species

    data = monarch_get("association/all", {
        "subject": gene_id,
        "predicate": "biolink:orthologous_to",
        "limit": 50
    })
    return data.get("items", [])

# NCBI Taxonomy IDs for common model organisms:
# Mouse: 10090 (Mus musculus)
# Zebrafish: 7955 (Danio rerio)
# Fruit fly: 7227 (Drosophila melanogaster)
# C. elegans: 6239
# Rat: 10116 (Rattus norvegicus)
8. ワークフロー全体:希少疾患の原因遺伝子の優先順位付け
import requests
import pandas as pd

def rare_disease_gene_finder(patient_hpo_terms, candidate_gene_ids=None, top_n=20):
    """
    Find genes that match a patient's HPO phenotype profile.

    Args:
        patient_hpo_terms: List of HPO IDs from clinical assessment
        candidate_gene_ids: Optional list to restrict search
        top_n: Number of top candidates to return
    """
    BASE_URL = "https://api-v3.monarchinitiative.org/v3"

    # 1. Find genes associated with each phenotype
    gene_phenotype_counts = {}

    for hpo_id in patient_hpo_terms:
        data = requests.get(
            f"{BASE_URL}/association/all",
            params={
                "object": hpo_id,
                "subject_category": "biolink:Gene",
                "limit": 100
            }
        ).json()

        for item in data.get("items", []):
            gene_id = item.get("subject", {}).get("id")
            gene_name = item.get("subject", {}).get("name")
            if gene_id:
                if gene_id not in gene_phenotype_counts:
                    gene_phenotype_counts[gene_id] = {"name": gene_name, "count": 0, "phenotypes": []}
                gene_phenotype_counts[gene_id]["count"] += 1
                gene_phenotype_counts[gene_id]["phenotypes"].append(hpo_id)

    # 2. Rank by number of matching phenotypes
    ranked = sorted(gene_phenotype_counts.items(),
                    key=lambda x: -x[1]["count"])[:top_n]

    results = []
    for gene_id, info in ranked:
        results.append({
            "gene_id": gene_id,
            "gene_name": info["name"],
            "matching_phenotypes": info["count"],
            "total_patient_phenotypes": len(patient_hpo_terms),
            "phenotype_overlap": info["count"] / len(patient_hpo_terms),
            "matching_hpo_terms": info["phenotypes"]
        })

    return pd.DataFrame(results)

# Example usage
patient_phenotypes = [
    "HP:0001250",  # Seizures
    "HP:0004322",  # Short stature
    "HP:0001252",  # Hypotonia
    "HP:0000252",  # Microcephaly
    "HP:0001263",  # Global developmental delay
]
candidates = rare_disease_gene_finder(patient_phenotypes)
print(candidates[["gene_name", "matching_phenotypes", "phenotype_overlap"]].to_string())

クエリのワークフロー

ワークフロー 1:HPOに基づく鑑別診断
  1. 診療記録または遺伝カウンセリングの記録からHPO用語を抽出する
  2. Monarch に対して表現型と遺伝子のクエリを実行する
  3. 一致する表現型の数で候補遺伝子を順位付けする
  4. gnomAD(制約スコア)およびClinVar(バリアントの根拠)と照合する
  5. pLIが高く、既知の病原性バリアントがある遺伝子を優先する
ワークフロー 2:疾患モデルの発見
  1. 対象の遺伝子または疾患を特定する
  2. Monarch にクエリを実行して、種をまたいだオルソログを調べる
  3. モデル生物のデータベースで表現型との関連付けを調べる
  4. ヒトの疾患の特徴を再現する実験モデルを特定する
ワークフロー 3:新規遺伝子の表現型アノテーション
  1. 機能が不明な遺伝子について、既知の表現型との関連付けをすべて検索する
  2. HPO階層に対応付けて、影響を受ける身体システムを把握する
  3. OMIMおよびORPHANETと照合し、疾患との関連を調べる

一般的な識別子のプレフィックス

プレフィックス名前空間例
HP:Human Phenotype OntologyHP:0001250(発作)
MONDO:Monarch Disease OntologyMONDO:0007739
OMIM:OMIM疾患OMIM:104300
ORPHANET:Orphanet希少疾患ORPHANET:558
HGNC:HGNC遺伝子シンボルHGNC:7884
NCBIGene:NCBI遺伝子IDNCBIGene:4137
ENSEMBL:Ensembl遺伝子ENSEMBL:ENSG...
MGI:マウス遺伝子MGI:1338833
ZFIN:ゼブラフィッシュ遺伝子ZFIN:ZDB-GENE...

ベストプラクティス

  • 疾患にはMONDO IDを使用します。OMIM/ORPHANET/MESH の識別子を統合できます。
  • 表現型にはHPO IDを使用します。臨床的な表現型の記述における標準です。
  • ページネーションを処理します:大規模なクエリでは、offset パラメーターを使って繰り返し取得する必要がある場合があります。
  • 完全一致よりも意味的類似性が有効です:上位の HPO 用語を含めると、関連する表現型も見つかります。
  • ClinVar と OMIM で相互検証します:Monarch は多くの情報源を集約しているため、品質にはばらつきがあります。
  • 遺伝子には HGNC ID を使用します:データベースのバージョンが変わっても、遺伝子シンボルより安定しています。

追加リソース

コメント