@nahisaho/satori 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -54
- package/package.json +1 -1
- package/src/.github/skills/scientific-biomedical-pubtator/SKILL.md +331 -0
- package/src/.github/skills/scientific-biothings-idmapping/SKILL.md +298 -0
- package/src/.github/skills/scientific-cell-line-resources/SKILL.md +258 -0
- package/src/.github/skills/scientific-compound-screening/SKILL.md +245 -0
- package/src/.github/skills/scientific-ebi-databases/SKILL.md +280 -0
- package/src/.github/skills/scientific-genome-sequence-tools/SKILL.md +304 -0
- package/src/.github/skills/scientific-healthcare-ai/SKILL.md +273 -0
- package/src/.github/skills/scientific-human-protein-atlas/SKILL.md +244 -0
- package/src/.github/skills/scientific-metabolic-modeling/SKILL.md +288 -0
- package/src/.github/skills/scientific-noncoding-rna/SKILL.md +262 -0
- package/src/.github/skills/scientific-ontology-enrichment/SKILL.md +340 -0
- package/src/.github/skills/scientific-pharmacology-targets/SKILL.md +323 -0
- package/src/.github/skills/scientific-phylogenetics/SKILL.md +297 -0
- package/src/.github/skills/scientific-preprint-archive/SKILL.md +476 -0
- package/src/.github/skills/scientific-public-health-data/SKILL.md +322 -0
- package/src/.github/skills/scientific-rare-disease-genetics/SKILL.md +327 -0
- package/src/.github/skills/scientific-regulatory-genomics/SKILL.md +274 -0
- package/src/.github/skills/scientific-reinforcement-learning/SKILL.md +280 -0
- package/src/.github/skills/scientific-structural-proteomics/SKILL.md +317 -0
- package/src/.github/skills/scientific-symbolic-mathematics/SKILL.md +277 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scientific-public-health-data
|
|
3
|
+
description: |
|
|
4
|
+
公衆衛生データアクセススキル。NHANES 疫学調査データ、MedlinePlus 一般向け
|
|
5
|
+
健康情報、RxNorm 薬剤標準語彙、ODPHP 健康目標・ガイドライン、
|
|
6
|
+
Health Disparities 健康格差データ統合パイプライン。
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Scientific Public Health Data
|
|
10
|
+
|
|
11
|
+
NHANES / MedlinePlus / RxNorm / ODPHP / Health Disparities /
|
|
12
|
+
Guidelines を統合した公衆衛生データアクセスパイプラインを提供する。
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- NHANES 疫学調査データ (検査値・アンケート) を取得するとき
|
|
17
|
+
- MedlinePlus で一般向け健康情報を検索するとき
|
|
18
|
+
- RxNorm で薬剤名の標準化・マッピングを行うとき
|
|
19
|
+
- ODPHP Healthy People 目標や健康ガイドラインを参照するとき
|
|
20
|
+
- 健康格差 (Health Disparities) データを分析するとき
|
|
21
|
+
- 臨床ガイドライン (USPSTF/WHO) を検索するとき
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
## 1. NHANES 疫学調査データ取得
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
import requests
|
|
31
|
+
import pandas as pd
|
|
32
|
+
import io
|
|
33
|
+
|
|
34
|
+
NHANES_BASE = "https://wwwn.cdc.gov/nchs/nhanes"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def get_nhanes_dataset(cycle, dataset_name):
|
|
38
|
+
"""
|
|
39
|
+
NHANES データセット (XPT/SAS 形式) 取得。
|
|
40
|
+
|
|
41
|
+
Parameters:
|
|
42
|
+
cycle: str — 調査サイクル (e.g., "2017-2018", "2019-2020")
|
|
43
|
+
dataset_name: str — データセット名 (e.g., "DEMO_J", "BIOPRO_J")
|
|
44
|
+
|
|
45
|
+
ToolUniverse:
|
|
46
|
+
NHANES_get_dataset(cycle=cycle, dataset=dataset_name)
|
|
47
|
+
NHANES_list_datasets(cycle=cycle)
|
|
48
|
+
"""
|
|
49
|
+
cycle_code = cycle.replace("-", "_")
|
|
50
|
+
url = f"{NHANES_BASE}/search/DataPage.aspx"
|
|
51
|
+
|
|
52
|
+
# XPT ファイルの直接ダウンロード
|
|
53
|
+
xpt_url = f"https://wwwn.cdc.gov/Nchs/Nhanes/{cycle}/{dataset_name}.XPT"
|
|
54
|
+
resp = requests.get(xpt_url)
|
|
55
|
+
resp.raise_for_status()
|
|
56
|
+
|
|
57
|
+
df = pd.read_sas(io.BytesIO(resp.content), format="xport")
|
|
58
|
+
print(f"NHANES {cycle} {dataset_name}: {df.shape[0]} rows × {df.shape[1]} columns")
|
|
59
|
+
return df
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def search_nhanes_variables(keyword):
|
|
63
|
+
"""
|
|
64
|
+
NHANES 変数検索。
|
|
65
|
+
|
|
66
|
+
Parameters:
|
|
67
|
+
keyword: str — 変数名/説明の検索語
|
|
68
|
+
|
|
69
|
+
ToolUniverse:
|
|
70
|
+
NHANES_search_variables(keyword=keyword)
|
|
71
|
+
"""
|
|
72
|
+
url = f"{NHANES_BASE}/search/variablelist.aspx"
|
|
73
|
+
params = {"SearchTarget": keyword}
|
|
74
|
+
resp = requests.get(url, params=params)
|
|
75
|
+
resp.raise_for_status()
|
|
76
|
+
|
|
77
|
+
print(f"NHANES variable search '{keyword}': response received")
|
|
78
|
+
return resp.text
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## 2. MedlinePlus 健康情報検索
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
MEDLINEPLUS_API = "https://connect.medlineplus.gov/service"
|
|
85
|
+
MEDLINEPLUS_WS = "https://wsearch.nlm.nih.gov/ws/query"
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def search_medlineplus_health_topics(query, language="English"):
|
|
89
|
+
"""
|
|
90
|
+
MedlinePlus 健康トピック検索。
|
|
91
|
+
|
|
92
|
+
ToolUniverse:
|
|
93
|
+
MedlinePlus_search_health_topics(query=query)
|
|
94
|
+
MedlinePlus_get_health_topic(topic_id=topic_id)
|
|
95
|
+
MedlinePlus_search_drugs(query=query)
|
|
96
|
+
MedlinePlus_search_labs(query=query)
|
|
97
|
+
MedlinePlus_connect(code=code, code_system=system)
|
|
98
|
+
"""
|
|
99
|
+
params = {
|
|
100
|
+
"db": "healthTopics",
|
|
101
|
+
"term": query,
|
|
102
|
+
}
|
|
103
|
+
resp = requests.get(MEDLINEPLUS_WS, params=params)
|
|
104
|
+
resp.raise_for_status()
|
|
105
|
+
|
|
106
|
+
# XML response parsing
|
|
107
|
+
import xml.etree.ElementTree as ET
|
|
108
|
+
root = ET.fromstring(resp.text)
|
|
109
|
+
|
|
110
|
+
results = []
|
|
111
|
+
for doc in root.findall(".//document"):
|
|
112
|
+
results.append({
|
|
113
|
+
"title": doc.find(".//content[@name='title']").text
|
|
114
|
+
if doc.find(".//content[@name='title']") is not None else "",
|
|
115
|
+
"url": doc.get("url", ""),
|
|
116
|
+
"summary": doc.find(".//content[@name='FullSummary']").text[:300]
|
|
117
|
+
if doc.find(".//content[@name='FullSummary']") is not None else "",
|
|
118
|
+
"rank": doc.get("rank", ""),
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
df = pd.DataFrame(results)
|
|
122
|
+
print(f"MedlinePlus search '{query}': {len(df)} health topics")
|
|
123
|
+
return df
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 3. RxNorm 薬剤標準語彙
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
RXNORM_API = "https://rxnav.nlm.nih.gov/REST"
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def rxnorm_lookup(drug_name):
|
|
133
|
+
"""
|
|
134
|
+
RxNorm 薬剤名正規化・コードマッピング。
|
|
135
|
+
|
|
136
|
+
Parameters:
|
|
137
|
+
drug_name: str — 薬剤名 (商品名 or 一般名)
|
|
138
|
+
|
|
139
|
+
ToolUniverse:
|
|
140
|
+
RxNorm_get_rxcui(name=drug_name)
|
|
141
|
+
"""
|
|
142
|
+
resp = requests.get(
|
|
143
|
+
f"{RXNORM_API}/rxcui.json",
|
|
144
|
+
params={"name": drug_name}
|
|
145
|
+
)
|
|
146
|
+
resp.raise_for_status()
|
|
147
|
+
data = resp.json()
|
|
148
|
+
|
|
149
|
+
rxcui = data.get("idGroup", {}).get("rxnormId", [None])[0]
|
|
150
|
+
if not rxcui:
|
|
151
|
+
print(f"RxNorm: '{drug_name}' not found")
|
|
152
|
+
return None
|
|
153
|
+
|
|
154
|
+
# Get properties
|
|
155
|
+
props_resp = requests.get(f"{RXNORM_API}/rxcui/{rxcui}/properties.json")
|
|
156
|
+
props_resp.raise_for_status()
|
|
157
|
+
props = props_resp.json().get("properties", {})
|
|
158
|
+
|
|
159
|
+
# Get related concepts
|
|
160
|
+
related_resp = requests.get(
|
|
161
|
+
f"{RXNORM_API}/rxcui/{rxcui}/related.json",
|
|
162
|
+
params={"tty": "IN+BN+SBD+SCD"}
|
|
163
|
+
)
|
|
164
|
+
related_resp.raise_for_status()
|
|
165
|
+
related = related_resp.json()
|
|
166
|
+
|
|
167
|
+
result = {
|
|
168
|
+
"rxcui": rxcui,
|
|
169
|
+
"name": props.get("name", ""),
|
|
170
|
+
"tty": props.get("tty", ""),
|
|
171
|
+
"synonym": props.get("synonym", ""),
|
|
172
|
+
"related_concepts": [
|
|
173
|
+
{
|
|
174
|
+
"rxcui": c.get("rxcui"),
|
|
175
|
+
"name": c.get("name"),
|
|
176
|
+
"tty": c.get("tty"),
|
|
177
|
+
}
|
|
178
|
+
for group in related.get("relatedGroup", {}).get("conceptGroup", [])
|
|
179
|
+
for c in group.get("conceptProperties", [])
|
|
180
|
+
],
|
|
181
|
+
}
|
|
182
|
+
print(f"RxNorm '{drug_name}': RXCUI={rxcui}, TTY={result['tty']}")
|
|
183
|
+
return result
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## 4. Health Disparities データ取得
|
|
187
|
+
|
|
188
|
+
```python
|
|
189
|
+
HD_API = "https://data.cdc.gov/resource"
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def get_health_disparities(indicator, dataset_id="pqnx-3xr5"):
|
|
193
|
+
"""
|
|
194
|
+
CDC 健康格差データ取得。
|
|
195
|
+
|
|
196
|
+
Parameters:
|
|
197
|
+
indicator: str — 健康指標名
|
|
198
|
+
dataset_id: str — CDC Socrata データセット ID
|
|
199
|
+
|
|
200
|
+
ToolUniverse:
|
|
201
|
+
HealthDisparities_search(query=indicator)
|
|
202
|
+
HealthDisparities_get_indicators(category=category)
|
|
203
|
+
"""
|
|
204
|
+
params = {
|
|
205
|
+
"$where": f"indicator LIKE '%{indicator}%'",
|
|
206
|
+
"$limit": 1000,
|
|
207
|
+
}
|
|
208
|
+
resp = requests.get(f"{HD_API}/{dataset_id}.json", params=params)
|
|
209
|
+
resp.raise_for_status()
|
|
210
|
+
data = resp.json()
|
|
211
|
+
|
|
212
|
+
df = pd.DataFrame(data)
|
|
213
|
+
print(f"Health Disparities '{indicator}': {len(df)} records")
|
|
214
|
+
return df
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## 5. ODPHP 健康ガイドライン
|
|
218
|
+
|
|
219
|
+
```python
|
|
220
|
+
ODPHP_API = "https://health.gov/myhealthfinder/api/v3"
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def search_health_guidelines(keyword, category=None):
|
|
224
|
+
"""
|
|
225
|
+
ODPHP MyHealthfinder ガイドライン検索。
|
|
226
|
+
|
|
227
|
+
ToolUniverse:
|
|
228
|
+
ODPHP_search_topics(keyword=keyword)
|
|
229
|
+
ODPHP_get_topic(topic_id=topic_id)
|
|
230
|
+
"""
|
|
231
|
+
params = {"keyword": keyword}
|
|
232
|
+
if category:
|
|
233
|
+
params["categoryId"] = category
|
|
234
|
+
resp = requests.get(f"{ODPHP_API}/topicsearch.json", params=params)
|
|
235
|
+
resp.raise_for_status()
|
|
236
|
+
data = resp.json()
|
|
237
|
+
|
|
238
|
+
results = []
|
|
239
|
+
for topic in data.get("Result", {}).get("Resources", {}).get("Resource", []):
|
|
240
|
+
results.append({
|
|
241
|
+
"title": topic.get("Title", ""),
|
|
242
|
+
"categories": topic.get("Categories", ""),
|
|
243
|
+
"url": topic.get("AccessibleVersion", ""),
|
|
244
|
+
"sections": [
|
|
245
|
+
s.get("Title", "") for s in topic.get("Sections", {}).get("section", [])
|
|
246
|
+
],
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
df = pd.DataFrame(results)
|
|
250
|
+
print(f"ODPHP search '{keyword}': {len(df)} guidelines")
|
|
251
|
+
return df
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## 6. 臨床ガイドライン検索 (USPSTF)
|
|
255
|
+
|
|
256
|
+
```python
|
|
257
|
+
def search_clinical_guidelines(query, source="uspstf"):
|
|
258
|
+
"""
|
|
259
|
+
USPSTF/WHO 臨床ガイドライン検索。
|
|
260
|
+
|
|
261
|
+
ToolUniverse:
|
|
262
|
+
Guidelines_search(query=query, source=source)
|
|
263
|
+
Guidelines_get_recommendations(topic_id=topic_id)
|
|
264
|
+
"""
|
|
265
|
+
sources = {
|
|
266
|
+
"uspstf": "https://www.uspreventiveservicestaskforce.org/uspstf/api",
|
|
267
|
+
"who": "https://app.magicapp.org/api",
|
|
268
|
+
}
|
|
269
|
+
base_url = sources.get(source, sources["uspstf"])
|
|
270
|
+
|
|
271
|
+
resp = requests.get(f"{base_url}/search", params={"q": query})
|
|
272
|
+
if resp.status_code == 200:
|
|
273
|
+
data = resp.json()
|
|
274
|
+
results = []
|
|
275
|
+
for item in data.get("results", []):
|
|
276
|
+
results.append({
|
|
277
|
+
"title": item.get("title", ""),
|
|
278
|
+
"grade": item.get("grade", ""),
|
|
279
|
+
"population": item.get("population", ""),
|
|
280
|
+
"date": item.get("date", ""),
|
|
281
|
+
"recommendation": item.get("recommendation", ""),
|
|
282
|
+
})
|
|
283
|
+
df = pd.DataFrame(results)
|
|
284
|
+
else:
|
|
285
|
+
df = pd.DataFrame()
|
|
286
|
+
|
|
287
|
+
print(f"Guidelines ({source}) search '{query}': {len(df)} recommendations")
|
|
288
|
+
return df
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## 利用可能ツール
|
|
294
|
+
|
|
295
|
+
| ToolUniverse カテゴリ | 主なツール |
|
|
296
|
+
|---|---|
|
|
297
|
+
| `nhanes` | `NHANES_get_dataset`, `NHANES_list_datasets`, `NHANES_search_variables` |
|
|
298
|
+
| `health_disparities` | `HealthDisparities_search`, `HealthDisparities_get_indicators` |
|
|
299
|
+
| `medlineplus` | `MedlinePlus_search_health_topics`, `MedlinePlus_get_health_topic`, `MedlinePlus_search_drugs`, `MedlinePlus_search_labs`, `MedlinePlus_connect` |
|
|
300
|
+
| `odphp` | `ODPHP_search_topics`, `ODPHP_get_topic` |
|
|
301
|
+
| `rxnorm` | `RxNorm_get_rxcui` |
|
|
302
|
+
| `guidelines_tools` | `Guidelines_search`, `Guidelines_get_recommendations` |
|
|
303
|
+
|
|
304
|
+
## パイプライン出力
|
|
305
|
+
|
|
306
|
+
| 出力ファイル | 説明 | 連携先スキル |
|
|
307
|
+
|---|---|---|
|
|
308
|
+
| `results/nhanes_data.csv` | NHANES 疫学データ | → epidemiology-public-health, survival-clinical |
|
|
309
|
+
| `results/drug_mapping.json` | RxNorm 薬剤マッピング | → pharmacovigilance, pharmacogenomics |
|
|
310
|
+
| `results/health_guidelines.json` | 臨床ガイドライン | → clinical-decision-support |
|
|
311
|
+
| `results/health_disparities.csv` | 健康格差指標 | → epidemiology-public-health, causal-inference |
|
|
312
|
+
|
|
313
|
+
## パイプライン統合
|
|
314
|
+
|
|
315
|
+
```
|
|
316
|
+
epidemiology-public-health ──→ public-health-data ──→ clinical-decision-support
|
|
317
|
+
(RR/OR/DAG) (NHANES/CDC/ODPHP) (GRADE エビデンス)
|
|
318
|
+
│
|
|
319
|
+
├──→ pharmacovigilance (RxNorm + 安全性)
|
|
320
|
+
├──→ pharmacogenomics (RxNorm + PGx)
|
|
321
|
+
└──→ survival-clinical (NHANES コホート)
|
|
322
|
+
```
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scientific-rare-disease-genetics
|
|
3
|
+
description: |
|
|
4
|
+
希少疾患遺伝学スキル。OMIM 遺伝子-疾患マッピング、Orphanet 希少疾患
|
|
5
|
+
分類・遺伝子照会、DisGeNET 疾患-遺伝子関連スコア、IMPC マウス表現型
|
|
6
|
+
参照、遺伝子-表現型統合解析パイプライン。
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Scientific Rare Disease Genetics
|
|
10
|
+
|
|
11
|
+
OMIM / Orphanet / DisGeNET / IMPC を統合した
|
|
12
|
+
希少疾患遺伝学パイプラインを提供する。
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- 希少疾患の原因遺伝子を同定するとき
|
|
17
|
+
- OMIM で遺伝子-疾患の Mendelian 関連を調べるとき
|
|
18
|
+
- Orphanet で希少疾患分類や有病率を検索するとき
|
|
19
|
+
- DisGeNET で疾患-遺伝子関連スコア (GDA) を取得するとき
|
|
20
|
+
- IMPC マウスノックアウト表現型と比較するとき
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
## 1. OMIM 遺伝子-疾患マッピング
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
import requests
|
|
30
|
+
import pandas as pd
|
|
31
|
+
|
|
32
|
+
OMIM_API = "https://api.omim.org/api"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def search_omim(query, api_key, include="geneMap"):
|
|
36
|
+
"""
|
|
37
|
+
OMIM データベース検索。
|
|
38
|
+
|
|
39
|
+
Parameters:
|
|
40
|
+
query: str — 検索語 (遺伝子名、疾患名)
|
|
41
|
+
api_key: str — OMIM API キー
|
|
42
|
+
include: str — "geneMap", "clinicalSynopsis", "all"
|
|
43
|
+
|
|
44
|
+
ToolUniverse:
|
|
45
|
+
OMIM_search(query=query)
|
|
46
|
+
OMIM_get_entry(mim_number=mim_number)
|
|
47
|
+
OMIM_get_gene_map(gene_symbol=gene_symbol)
|
|
48
|
+
OMIM_get_clinical_synopsis(mim_number=mim_number)
|
|
49
|
+
"""
|
|
50
|
+
params = {
|
|
51
|
+
"search": query,
|
|
52
|
+
"include": include,
|
|
53
|
+
"format": "json",
|
|
54
|
+
"apiKey": api_key,
|
|
55
|
+
}
|
|
56
|
+
resp = requests.get(f"{OMIM_API}/entry/search", params=params)
|
|
57
|
+
resp.raise_for_status()
|
|
58
|
+
data = resp.json()
|
|
59
|
+
|
|
60
|
+
entries = data.get("omim", {}).get("searchResponse", {}).get("entryList", [])
|
|
61
|
+
results = []
|
|
62
|
+
for entry in entries:
|
|
63
|
+
e = entry.get("entry", {})
|
|
64
|
+
gene_map = e.get("geneMap", {})
|
|
65
|
+
results.append({
|
|
66
|
+
"mim_number": e.get("mimNumber"),
|
|
67
|
+
"title": e.get("titles", {}).get("preferredTitle", ""),
|
|
68
|
+
"gene_symbols": gene_map.get("geneSymbols", ""),
|
|
69
|
+
"chromosome": gene_map.get("computedCytoLocation", ""),
|
|
70
|
+
"phenotypes": [
|
|
71
|
+
p.get("phenotype", "")
|
|
72
|
+
for p in gene_map.get("phenotypeMapList", [])
|
|
73
|
+
],
|
|
74
|
+
"inheritance": [
|
|
75
|
+
p.get("phenotypeMappingKey", "")
|
|
76
|
+
for p in gene_map.get("phenotypeMapList", [])
|
|
77
|
+
],
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
df = pd.DataFrame(results)
|
|
81
|
+
print(f"OMIM search '{query}': {len(df)} entries")
|
|
82
|
+
return df
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## 2. Orphanet 希少疾患分類
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
ORPHANET_API = "https://api.orphadata.com"
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def search_orphanet_diseases(query):
|
|
92
|
+
"""
|
|
93
|
+
Orphanet 希少疾患検索。
|
|
94
|
+
|
|
95
|
+
ToolUniverse:
|
|
96
|
+
Orphanet_search_diseases(query=query)
|
|
97
|
+
Orphanet_search_by_name(name=query)
|
|
98
|
+
Orphanet_get_disease(orpha_code=code)
|
|
99
|
+
Orphanet_get_genes(orpha_code=code)
|
|
100
|
+
Orphanet_get_classification(orpha_code=code)
|
|
101
|
+
"""
|
|
102
|
+
resp = requests.get(
|
|
103
|
+
f"{ORPHANET_API}/rd-cross-referencing",
|
|
104
|
+
params={"query": query}
|
|
105
|
+
)
|
|
106
|
+
resp.raise_for_status()
|
|
107
|
+
data = resp.json()
|
|
108
|
+
|
|
109
|
+
results = []
|
|
110
|
+
for item in data if isinstance(data, list) else [data]:
|
|
111
|
+
results.append({
|
|
112
|
+
"orpha_code": item.get("ORPHAcode", ""),
|
|
113
|
+
"name": item.get("Preferred term", ""),
|
|
114
|
+
"prevalence_class": item.get("Prevalence", {}).get("PrevalenceClass", ""),
|
|
115
|
+
"inheritance": item.get("TypeOfInheritance", []),
|
|
116
|
+
"age_of_onset": item.get("AgeOfOnset", []),
|
|
117
|
+
"genes": item.get("DisorderGeneAssociationList", []),
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
df = pd.DataFrame(results)
|
|
121
|
+
print(f"Orphanet search '{query}': {len(df)} diseases")
|
|
122
|
+
return df
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## 3. DisGeNET 疾患-遺伝子関連スコア
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
DISGENET_API = "https://www.disgenet.org/api"
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def get_disease_gene_associations(disease_id, api_key):
|
|
132
|
+
"""
|
|
133
|
+
DisGeNET GDA スコアによる疾患-遺伝子関連取得。
|
|
134
|
+
|
|
135
|
+
Parameters:
|
|
136
|
+
disease_id: str — UMLS CUI (e.g., "C0023264") or disease name
|
|
137
|
+
api_key: str — DisGeNET API key
|
|
138
|
+
|
|
139
|
+
ToolUniverse:
|
|
140
|
+
DisGeNET_search_disease(query=disease_id)
|
|
141
|
+
DisGeNET_get_disease_genes(disease_id=disease_id)
|
|
142
|
+
DisGeNET_search_gene(query=gene)
|
|
143
|
+
DisGeNET_get_gene_diseases(gene_symbol=gene)
|
|
144
|
+
DisGeNET_get_variant_diseases(variant_id=variant)
|
|
145
|
+
"""
|
|
146
|
+
headers = {"Authorization": f"Bearer {api_key}"}
|
|
147
|
+
resp = requests.get(
|
|
148
|
+
f"{DISGENET_API}/gda/disease/{disease_id}",
|
|
149
|
+
headers=headers
|
|
150
|
+
)
|
|
151
|
+
resp.raise_for_status()
|
|
152
|
+
data = resp.json()
|
|
153
|
+
|
|
154
|
+
results = []
|
|
155
|
+
for gda in data:
|
|
156
|
+
results.append({
|
|
157
|
+
"gene_symbol": gda.get("gene_symbol", ""),
|
|
158
|
+
"gene_id": gda.get("geneid", ""),
|
|
159
|
+
"gda_score": gda.get("score", 0),
|
|
160
|
+
"ei": gda.get("ei", 0), # Evidence Index
|
|
161
|
+
"el": gda.get("el", ""), # Evidence Level
|
|
162
|
+
"n_pmids": gda.get("pmid_count", 0),
|
|
163
|
+
"source": gda.get("source", ""),
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
df = pd.DataFrame(results)
|
|
167
|
+
if not df.empty:
|
|
168
|
+
df = df.sort_values("gda_score", ascending=False)
|
|
169
|
+
|
|
170
|
+
print(f"DisGeNET '{disease_id}': {len(df)} gene associations, "
|
|
171
|
+
f"top GDA score={df['gda_score'].max():.3f}" if len(df) > 0 else "")
|
|
172
|
+
return df
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## 4. IMPC マウス表現型参照
|
|
176
|
+
|
|
177
|
+
```python
|
|
178
|
+
IMPC_API = "https://www.ebi.ac.uk/mi/impc/solr"
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def get_impc_mouse_phenotypes(gene_symbol):
|
|
182
|
+
"""
|
|
183
|
+
IMPC マウスノックアウト表現型データ取得。
|
|
184
|
+
|
|
185
|
+
ToolUniverse:
|
|
186
|
+
IMPC_search_genes(query=gene_symbol)
|
|
187
|
+
IMPC_get_gene_summary(gene_symbol=gene_symbol)
|
|
188
|
+
IMPC_get_phenotypes_by_gene(gene_symbol=gene_symbol)
|
|
189
|
+
IMPC_get_gene_phenotype_hits(gene_symbol=gene_symbol)
|
|
190
|
+
"""
|
|
191
|
+
params = {
|
|
192
|
+
"q": f"marker_symbol:{gene_symbol}",
|
|
193
|
+
"rows": 100,
|
|
194
|
+
"wt": "json",
|
|
195
|
+
}
|
|
196
|
+
resp = requests.get(f"{IMPC_API}/genotype-phenotype/select", params=params)
|
|
197
|
+
resp.raise_for_status()
|
|
198
|
+
data = resp.json()
|
|
199
|
+
|
|
200
|
+
results = []
|
|
201
|
+
for doc in data.get("response", {}).get("docs", []):
|
|
202
|
+
results.append({
|
|
203
|
+
"gene_symbol": doc.get("marker_symbol", ""),
|
|
204
|
+
"mp_term_id": doc.get("mp_term_id", ""),
|
|
205
|
+
"mp_term_name": doc.get("mp_term_name", ""),
|
|
206
|
+
"top_level_mp": doc.get("top_level_mp_term_name", []),
|
|
207
|
+
"p_value": doc.get("p_value", None),
|
|
208
|
+
"effect_size": doc.get("effect_size", None),
|
|
209
|
+
"zygosity": doc.get("zygosity", ""),
|
|
210
|
+
"procedure_name": doc.get("procedure_name", ""),
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
df = pd.DataFrame(results)
|
|
214
|
+
if not df.empty and "p_value" in df.columns:
|
|
215
|
+
df = df.sort_values("p_value")
|
|
216
|
+
|
|
217
|
+
print(f"IMPC '{gene_symbol}': {len(df)} phenotype associations")
|
|
218
|
+
return df
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## 5. 遺伝子-表現型統合解析
|
|
222
|
+
|
|
223
|
+
```python
|
|
224
|
+
def rare_disease_gene_analysis(gene_symbol, omim_api_key=None,
|
|
225
|
+
disgenet_api_key=None):
|
|
226
|
+
"""
|
|
227
|
+
全 DB 統合の希少疾患遺伝子プロファイリング。
|
|
228
|
+
"""
|
|
229
|
+
profile = {"gene": gene_symbol, "sources": {}}
|
|
230
|
+
|
|
231
|
+
# 1. OMIM
|
|
232
|
+
if omim_api_key:
|
|
233
|
+
try:
|
|
234
|
+
omim_df = search_omim(gene_symbol, omim_api_key)
|
|
235
|
+
profile["sources"]["omim"] = {
|
|
236
|
+
"entries": len(omim_df),
|
|
237
|
+
"phenotypes": omim_df["phenotypes"].explode().dropna().unique().tolist()
|
|
238
|
+
if not omim_df.empty else [],
|
|
239
|
+
}
|
|
240
|
+
except Exception as e:
|
|
241
|
+
profile["sources"]["omim"] = {"error": str(e)}
|
|
242
|
+
|
|
243
|
+
# 2. Orphanet
|
|
244
|
+
try:
|
|
245
|
+
orpha_df = search_orphanet_diseases(gene_symbol)
|
|
246
|
+
profile["sources"]["orphanet"] = {
|
|
247
|
+
"diseases": len(orpha_df),
|
|
248
|
+
"names": orpha_df["name"].tolist() if not orpha_df.empty else [],
|
|
249
|
+
}
|
|
250
|
+
except Exception as e:
|
|
251
|
+
profile["sources"]["orphanet"] = {"error": str(e)}
|
|
252
|
+
|
|
253
|
+
# 3. DisGeNET
|
|
254
|
+
if disgenet_api_key:
|
|
255
|
+
try:
|
|
256
|
+
dgn_df = get_disease_gene_associations(gene_symbol, disgenet_api_key)
|
|
257
|
+
profile["sources"]["disgenet"] = {
|
|
258
|
+
"associations": len(dgn_df),
|
|
259
|
+
"max_gda_score": float(dgn_df["gda_score"].max())
|
|
260
|
+
if not dgn_df.empty else 0,
|
|
261
|
+
}
|
|
262
|
+
except Exception as e:
|
|
263
|
+
profile["sources"]["disgenet"] = {"error": str(e)}
|
|
264
|
+
|
|
265
|
+
# 4. IMPC
|
|
266
|
+
try:
|
|
267
|
+
impc_df = get_impc_mouse_phenotypes(gene_symbol)
|
|
268
|
+
profile["sources"]["impc"] = {
|
|
269
|
+
"phenotypes": len(impc_df),
|
|
270
|
+
"top_phenotypes": impc_df["mp_term_name"].head(5).tolist()
|
|
271
|
+
if not impc_df.empty else [],
|
|
272
|
+
}
|
|
273
|
+
except Exception as e:
|
|
274
|
+
profile["sources"]["impc"] = {"error": str(e)}
|
|
275
|
+
|
|
276
|
+
n_sources = sum(1 for v in profile["sources"].values() if "error" not in v)
|
|
277
|
+
print(f"Rare disease profile '{gene_symbol}': {n_sources}/4 sources OK")
|
|
278
|
+
return profile
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## References
|
|
282
|
+
|
|
283
|
+
### Output Files
|
|
284
|
+
|
|
285
|
+
| ファイル | 形式 |
|
|
286
|
+
|---|---|
|
|
287
|
+
| `results/omim_search.csv` | CSV |
|
|
288
|
+
| `results/orphanet_diseases.csv` | CSV |
|
|
289
|
+
| `results/disgenet_gda.csv` | CSV |
|
|
290
|
+
| `results/impc_phenotypes.csv` | CSV |
|
|
291
|
+
| `results/rare_disease_profile.json` | JSON |
|
|
292
|
+
|
|
293
|
+
### 利用可能ツール
|
|
294
|
+
|
|
295
|
+
| カテゴリ | 主要ツール | 用途 |
|
|
296
|
+
|---|---|---|
|
|
297
|
+
| OMIM | `OMIM_search` | 遺伝子/疾患検索 |
|
|
298
|
+
| OMIM | `OMIM_get_entry` | MIM エントリ取得 |
|
|
299
|
+
| OMIM | `OMIM_get_gene_map` | 遺伝子マップ |
|
|
300
|
+
| OMIM | `OMIM_get_clinical_synopsis` | 臨床概要 |
|
|
301
|
+
| Orphanet | `Orphanet_search_diseases` | 希少疾患検索 |
|
|
302
|
+
| Orphanet | `Orphanet_get_disease` | 疾患詳細 |
|
|
303
|
+
| Orphanet | `Orphanet_get_genes` | 関連遺伝子 |
|
|
304
|
+
| Orphanet | `Orphanet_get_classification` | 分類情報 |
|
|
305
|
+
| Orphanet | `Orphanet_search_by_name` | 名前検索 |
|
|
306
|
+
| DisGeNET | `DisGeNET_search_disease` | 疾患検索 |
|
|
307
|
+
| DisGeNET | `DisGeNET_get_disease_genes` | 疾患遺伝子 |
|
|
308
|
+
| DisGeNET | `DisGeNET_get_gene_diseases` | 遺伝子疾患 |
|
|
309
|
+
| DisGeNET | `DisGeNET_get_variant_diseases` | バリアント疾患 |
|
|
310
|
+
| IMPC | `IMPC_search_genes` | 遺伝子検索 |
|
|
311
|
+
| IMPC | `IMPC_get_gene_summary` | 遺伝子サマリー |
|
|
312
|
+
| IMPC | `IMPC_get_phenotypes_by_gene` | 表現型取得 |
|
|
313
|
+
| IMPC | `IMPC_get_gene_phenotype_hits` | ヒット数 |
|
|
314
|
+
|
|
315
|
+
### 参照スキル
|
|
316
|
+
|
|
317
|
+
| スキル | 関連 |
|
|
318
|
+
|---|---|
|
|
319
|
+
| `scientific-disease-research` | GWAS/Orphanet 疾患研究 |
|
|
320
|
+
| `scientific-variant-interpretation` | ACMG バリアント解釈 |
|
|
321
|
+
| `scientific-variant-effect-prediction` | 病原性予測 |
|
|
322
|
+
| `scientific-population-genetics` | 集団遺伝学 |
|
|
323
|
+
| `scientific-human-protein-atlas` | タンパク質発現 |
|
|
324
|
+
|
|
325
|
+
### 依存パッケージ
|
|
326
|
+
|
|
327
|
+
`requests`, `pandas`
|