@nahisaho/satori 0.18.0 → 0.19.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.
@@ -0,0 +1,239 @@
1
+ ---
2
+ name: scientific-depmap-dependencies
3
+ description: |
4
+ DepMap 依存性スキル。Cancer Dependency Map (DepMap) Portal
5
+ API によるがん細胞株 CRISPR/RNAi 依存性スコア・薬剤
6
+ 感受性データ・遺伝子効果取得。ToolUniverse 連携: depmap。
7
+ tu_tools:
8
+ - key: depmap
9
+ name: DepMap
10
+ description: がん細胞株依存性マップ API
11
+ ---
12
+
13
+ # Scientific DepMap Dependencies
14
+
15
+ Cancer Dependency Map (DepMap) Portal API を活用した
16
+ がん細胞株の CRISPR/RNAi 遺伝子依存性スコア取得・
17
+ 薬剤感受性データ・遺伝子効果パイプラインを提供する。
18
+
19
+ ## When to Use
20
+
21
+ - がん細胞株の遺伝子依存性 (CRISPR/RNAi) を調べるとき
22
+ - 遺伝子のがん選択的必須性を評価するとき
23
+ - 薬剤感受性データと遺伝子発現の相関を調べるとき
24
+ - 細胞株メタデータ (組織型・疾患サブタイプ) を取得するとき
25
+ - Cell Model Passports データを参照するとき
26
+
27
+ ---
28
+
29
+ ## Quick Start
30
+
31
+ ## 1. DepMap 細胞株検索・メタデータ
32
+
33
+ ```python
34
+ import requests
35
+ import pandas as pd
36
+
37
+ DEPMAP_API = "https://api.cellmodelpassports.sanger.ac.uk/v1"
38
+
39
+
40
+ def depmap_cell_lines(tissue=None, cancer_type=None,
41
+ limit=50):
42
+ """
43
+ DepMap / Cell Model Passports — 細胞株検索。
44
+
45
+ Parameters:
46
+ tissue: str — 組織型フィルタ (例: "Breast")
47
+ cancer_type: str — がん種フィルタ
48
+ (例: "Breast Carcinoma")
49
+ limit: int — 最大結果数
50
+ """
51
+ url = f"{DEPMAP_API}/models"
52
+ params = {"page_size": limit}
53
+ if tissue:
54
+ params["tissue"] = tissue
55
+ if cancer_type:
56
+ params["cancer_type"] = cancer_type
57
+
58
+ resp = requests.get(url, params=params, timeout=30)
59
+ resp.raise_for_status()
60
+ data = resp.json()
61
+
62
+ rows = []
63
+ for model in data.get("data", data
64
+ if isinstance(data, list)
65
+ else []):
66
+ if isinstance(model, dict):
67
+ rows.append({
68
+ "model_id": model.get("model_id", ""),
69
+ "model_name": model.get("model_name", ""),
70
+ "tissue": model.get("tissue", ""),
71
+ "cancer_type": model.get(
72
+ "cancer_type", ""),
73
+ "sample_site": model.get(
74
+ "sample_site", ""),
75
+ "gender": model.get("gender", ""),
76
+ })
77
+
78
+ df = pd.DataFrame(rows[:limit])
79
+ print(f"DepMap cell lines: {len(df)} models")
80
+ return df
81
+ ```
82
+
83
+ ## 2. CRISPR 遺伝子依存性スコア
84
+
85
+ ```python
86
+ def depmap_gene_dependency(gene_symbol,
87
+ dataset="Chronos_Combined"):
88
+ """
89
+ DepMap — 遺伝子依存性スコア取得。
90
+
91
+ Parameters:
92
+ gene_symbol: str — 遺伝子シンボル (例: "KRAS")
93
+ dataset: str — データセット名
94
+ (例: "Chronos_Combined", "RNAi_merged")
95
+ """
96
+ # DepMap Public Portal download URL
97
+ DEPMAP_PORTAL = "https://depmap.org/portal/api"
98
+
99
+ url = f"{DEPMAP_PORTAL}/dataset/search"
100
+ params = {"gene": gene_symbol,
101
+ "dataset": dataset}
102
+
103
+ try:
104
+ resp = requests.get(url, params=params,
105
+ timeout=30)
106
+ resp.raise_for_status()
107
+ data = resp.json()
108
+ except Exception:
109
+ # Fallback: alternative DepMap API
110
+ print(f" DepMap portal fallback for "
111
+ f"{gene_symbol}")
112
+ data = []
113
+
114
+ rows = []
115
+ if isinstance(data, list):
116
+ for entry in data:
117
+ if isinstance(entry, dict):
118
+ rows.append({
119
+ "gene": gene_symbol,
120
+ "cell_line": entry.get(
121
+ "cell_line_name", ""),
122
+ "depmap_id": entry.get(
123
+ "depmap_id", ""),
124
+ "dependency_score": entry.get(
125
+ "dependency", 0),
126
+ "dataset": dataset,
127
+ })
128
+
129
+ df = pd.DataFrame(rows)
130
+ if not df.empty:
131
+ df = df.sort_values("dependency_score")
132
+ print(f"DepMap dependency: {gene_symbol} "
133
+ f"→ {len(df)} cell lines")
134
+ return df
135
+ ```
136
+
137
+ ## 3. 薬剤感受性データ
138
+
139
+ ```python
140
+ def depmap_drug_sensitivity(compound_name=None,
141
+ limit=100):
142
+ """
143
+ DepMap — 薬剤感受性データ取得。
144
+
145
+ Parameters:
146
+ compound_name: str — 化合物名フィルタ
147
+ (例: "Paclitaxel")
148
+ limit: int — 最大結果数
149
+ """
150
+ url = f"{DEPMAP_API}/drugs"
151
+ params = {"page_size": limit}
152
+ if compound_name:
153
+ params["name"] = compound_name
154
+
155
+ resp = requests.get(url, params=params, timeout=30)
156
+ resp.raise_for_status()
157
+ data = resp.json()
158
+
159
+ rows = []
160
+ for drug in data.get("data", data
161
+ if isinstance(data, list)
162
+ else []):
163
+ if isinstance(drug, dict):
164
+ rows.append({
165
+ "drug_id": drug.get("drug_id", ""),
166
+ "drug_name": drug.get("drug_name", ""),
167
+ "target": drug.get("target", ""),
168
+ "pathway": drug.get("pathway", ""),
169
+ "n_cell_lines": drug.get(
170
+ "n_cell_lines_tested", 0),
171
+ })
172
+
173
+ df = pd.DataFrame(rows[:limit])
174
+ print(f"DepMap drugs: {len(df)} compounds")
175
+ return df
176
+ ```
177
+
178
+ ## 4. DepMap 統合パイプライン
179
+
180
+ ```python
181
+ def depmap_pipeline(gene_symbol,
182
+ output_dir="results"):
183
+ """
184
+ DepMap 統合パイプライン。
185
+
186
+ Parameters:
187
+ gene_symbol: str — 遺伝子シンボル
188
+ output_dir: str — 出力ディレクトリ
189
+ """
190
+ from pathlib import Path
191
+ output_dir = Path(output_dir)
192
+ output_dir.mkdir(parents=True, exist_ok=True)
193
+
194
+ # 1) 遺伝子依存性
195
+ deps = depmap_gene_dependency(gene_symbol)
196
+ deps.to_csv(output_dir / "depmap_dependency.csv",
197
+ index=False)
198
+
199
+ # 2) 関連薬剤
200
+ drugs = depmap_drug_sensitivity()
201
+ drugs.to_csv(output_dir / "depmap_drugs.csv",
202
+ index=False)
203
+
204
+ # 3) 依存性の高い細胞株
205
+ if not deps.empty:
206
+ top_dependent = deps.head(10)
207
+ top_dependent.to_csv(
208
+ output_dir / "depmap_top_dependent.csv",
209
+ index=False)
210
+
211
+ print(f"DepMap pipeline: {gene_symbol} → {output_dir}")
212
+ return {"dependency": deps, "drugs": drugs}
213
+ ```
214
+
215
+ ---
216
+
217
+ ## ToolUniverse 連携
218
+
219
+ | TU Key | ツール名 | 連携内容 |
220
+ |--------|---------|---------|
221
+ | `depmap` | DepMap | がん細胞株依存性マップ API |
222
+
223
+ ## パイプライン統合
224
+
225
+ ```
226
+ cancer-genomics → depmap-dependencies → precision-oncology
227
+ (がんゲノム) (DepMap Portal) (精密腫瘍学)
228
+ │ │ ↓
229
+ expression-analysis ──────┘ drug-target-profiling
230
+ (発現リスト) (標的プロファイリング)
231
+ ```
232
+
233
+ ## パイプライン出力
234
+
235
+ | ファイル | 説明 | 次スキル |
236
+ |---------|------|---------|
237
+ | `results/depmap_dependency.csv` | 依存性スコア | → cancer-genomics |
238
+ | `results/depmap_drugs.csv` | 薬剤感受性 | → drug-target-profiling |
239
+ | `results/depmap_top_dependent.csv` | 依存細胞株 | → precision-oncology |
@@ -5,6 +5,10 @@ description: |
5
5
  疾患-遺伝子関連解析・希少疾患診断支援・表現型-遺伝型マッピング・
6
6
  疫学的特性評価を支援。
7
7
  「疾患と遺伝子の関連を調べて」「希少疾患を診断して」「GWAS 結果を解析して」で発火。
8
+ tu_tools:
9
+ - key: disgenet
10
+ name: DisGeNET
11
+ description: 疾患-遺伝子関連スコア (GDA) データベース
8
12
  ---
9
13
 
10
14
  # Scientific Disease Research
@@ -0,0 +1,269 @@
1
+ ---
2
+ name: scientific-drugbank-resources
3
+ description: |
4
+ DrugBank リソーススキル。DrugBank API を用いた薬剤記述・
5
+ 薬理情報・標的タンパク質・薬物相互作用検索。
6
+ ToolUniverse 連携: drugbank。
7
+ tu_tools:
8
+ - key: drugbank
9
+ name: DrugBank
10
+ description: 薬剤データベース API
11
+ ---
12
+
13
+ # Scientific DrugBank Resources
14
+
15
+ DrugBank API を活用した薬剤記述・薬理情報 (MOA)・標的タンパク質
16
+ 検索・薬物相互作用 (DDI) パイプラインを提供する。
17
+
18
+ ## When to Use
19
+
20
+ - 薬剤の基本情報 (名前・分類・構造) を検索するとき
21
+ - 薬理メカニズム (MOA) を調べるとき
22
+ - 標的タンパク質から薬剤を逆引き検索するとき
23
+ - 薬物相互作用 (DDI) を確認するとき
24
+ - 薬剤の ADMET プロパティを取得するとき
25
+
26
+ ---
27
+
28
+ ## Quick Start
29
+
30
+ ## 1. 薬剤検索・基本情報
31
+
32
+ ```python
33
+ import requests
34
+ import pandas as pd
35
+
36
+ DRUGBANK_API = "https://api.drugbank.com/v1"
37
+
38
+
39
+ def drugbank_search(query, limit=25, api_key=None):
40
+ """
41
+ DrugBank — 薬剤テキスト検索。
42
+
43
+ Parameters:
44
+ query: str — 検索クエリ (例: "imatinib")
45
+ limit: int — 最大結果数
46
+ api_key: str — DrugBank API キー
47
+ """
48
+ headers = {}
49
+ if api_key:
50
+ headers["Authorization"] = f"Bearer {api_key}"
51
+
52
+ url = f"{DRUGBANK_API}/drugs"
53
+ params = {"q": query, "per_page": limit}
54
+ resp = requests.get(url, params=params,
55
+ headers=headers, timeout=30)
56
+ resp.raise_for_status()
57
+ data = resp.json()
58
+
59
+ rows = []
60
+ for d in data:
61
+ rows.append({
62
+ "drugbank_id": d.get("drugbank_id", ""),
63
+ "name": d.get("name", ""),
64
+ "cas_number": d.get("cas_number", ""),
65
+ "drug_type": d.get("type", ""),
66
+ "state": d.get("state", ""),
67
+ "description": (d.get("description", "")
68
+ [:200]),
69
+ })
70
+
71
+ df = pd.DataFrame(rows)
72
+ print(f"DrugBank search: '{query}' → {len(df)} drugs")
73
+ return df
74
+
75
+
76
+ def drugbank_drug_detail(drugbank_id, api_key=None):
77
+ """
78
+ DrugBank — 薬剤詳細取得。
79
+
80
+ Parameters:
81
+ drugbank_id: str — DrugBank ID (例: "DB01254")
82
+ api_key: str — DrugBank API キー
83
+ """
84
+ headers = {}
85
+ if api_key:
86
+ headers["Authorization"] = f"Bearer {api_key}"
87
+
88
+ url = f"{DRUGBANK_API}/drugs/{drugbank_id}"
89
+ resp = requests.get(url, headers=headers, timeout=30)
90
+ resp.raise_for_status()
91
+ data = resp.json()
92
+
93
+ result = {
94
+ "drugbank_id": data.get("drugbank_id", ""),
95
+ "name": data.get("name", ""),
96
+ "description": data.get("description", ""),
97
+ "indication": data.get("indication", ""),
98
+ "pharmacodynamics": data.get(
99
+ "pharmacodynamics", ""),
100
+ "mechanism_of_action": data.get(
101
+ "mechanism_of_action", ""),
102
+ "absorption": data.get("absorption", ""),
103
+ "half_life": data.get("half_life", ""),
104
+ "protein_binding": data.get(
105
+ "protein_binding", ""),
106
+ "molecular_weight": data.get(
107
+ "average_molecular_weight", ""),
108
+ }
109
+ return result
110
+ ```
111
+
112
+ ## 2. 標的タンパク質検索
113
+
114
+ ```python
115
+ def drugbank_targets(drugbank_id, api_key=None):
116
+ """
117
+ DrugBank — 薬剤の標的タンパク質取得。
118
+
119
+ Parameters:
120
+ drugbank_id: str — DrugBank ID
121
+ api_key: str — DrugBank API キー
122
+ """
123
+ headers = {}
124
+ if api_key:
125
+ headers["Authorization"] = f"Bearer {api_key}"
126
+
127
+ url = f"{DRUGBANK_API}/drugs/{drugbank_id}/targets"
128
+ resp = requests.get(url, headers=headers, timeout=30)
129
+ resp.raise_for_status()
130
+ data = resp.json()
131
+
132
+ rows = []
133
+ for t in data:
134
+ polypeptide = t.get("polypeptide", {}) or {}
135
+ rows.append({
136
+ "drugbank_id": drugbank_id,
137
+ "target_name": t.get("name", ""),
138
+ "organism": t.get("organism", ""),
139
+ "known_action": t.get("known_action", ""),
140
+ "gene_name": polypeptide.get(
141
+ "gene_name", ""),
142
+ "uniprot_id": polypeptide.get(
143
+ "external_identifiers", {}).get(
144
+ "UniProtKB", ""),
145
+ })
146
+
147
+ df = pd.DataFrame(rows)
148
+ print(f"DrugBank targets: {drugbank_id} "
149
+ f"→ {len(df)} targets")
150
+ return df
151
+ ```
152
+
153
+ ## 3. 薬物相互作用 (DDI)
154
+
155
+ ```python
156
+ def drugbank_interactions(drugbank_id, api_key=None):
157
+ """
158
+ DrugBank — 薬物相互作用取得。
159
+
160
+ Parameters:
161
+ drugbank_id: str — DrugBank ID
162
+ api_key: str — DrugBank API キー
163
+ """
164
+ headers = {}
165
+ if api_key:
166
+ headers["Authorization"] = f"Bearer {api_key}"
167
+
168
+ url = (f"{DRUGBANK_API}/drugs/"
169
+ f"{drugbank_id}/drug_interactions")
170
+ resp = requests.get(url, headers=headers, timeout=30)
171
+ resp.raise_for_status()
172
+ data = resp.json()
173
+
174
+ rows = []
175
+ for inter in data:
176
+ rows.append({
177
+ "drug_a": drugbank_id,
178
+ "drug_b_id": inter.get(
179
+ "drugbank_id", ""),
180
+ "drug_b_name": inter.get("name", ""),
181
+ "description": inter.get(
182
+ "description", "")[:300],
183
+ })
184
+
185
+ df = pd.DataFrame(rows)
186
+ print(f"DrugBank DDI: {drugbank_id} "
187
+ f"→ {len(df)} interactions")
188
+ return df
189
+ ```
190
+
191
+ ## 4. DrugBank 統合パイプライン
192
+
193
+ ```python
194
+ def drugbank_pipeline(drug_name, api_key=None,
195
+ output_dir="results"):
196
+ """
197
+ DrugBank 統合パイプライン。
198
+
199
+ Parameters:
200
+ drug_name: str — 薬剤名 (例: "imatinib")
201
+ api_key: str — DrugBank API キー
202
+ output_dir: str — 出力ディレクトリ
203
+ """
204
+ from pathlib import Path
205
+ output_dir = Path(output_dir)
206
+ output_dir.mkdir(parents=True, exist_ok=True)
207
+
208
+ # 1) 検索
209
+ results = drugbank_search(drug_name,
210
+ api_key=api_key)
211
+ results.to_csv(output_dir / "drugbank_search.csv",
212
+ index=False)
213
+
214
+ if results.empty:
215
+ print(f"DrugBank: '{drug_name}' not found")
216
+ return {"search": results}
217
+
218
+ db_id = results.iloc[0]["drugbank_id"]
219
+
220
+ # 2) 詳細
221
+ detail = drugbank_drug_detail(db_id,
222
+ api_key=api_key)
223
+ pd.DataFrame([detail]).to_csv(
224
+ output_dir / "drugbank_detail.csv",
225
+ index=False)
226
+
227
+ # 3) 標的
228
+ targets = drugbank_targets(db_id,
229
+ api_key=api_key)
230
+ targets.to_csv(output_dir / "drugbank_targets.csv",
231
+ index=False)
232
+
233
+ # 4) DDI
234
+ ddi = drugbank_interactions(db_id,
235
+ api_key=api_key)
236
+ ddi.to_csv(output_dir / "drugbank_ddi.csv",
237
+ index=False)
238
+
239
+ print(f"DrugBank pipeline: {drug_name} → {output_dir}")
240
+ return {"detail": detail, "targets": targets,
241
+ "ddi": ddi}
242
+ ```
243
+
244
+ ---
245
+
246
+ ## ToolUniverse 連携
247
+
248
+ | TU Key | ツール名 | 連携内容 |
249
+ |--------|---------|---------|
250
+ | `drugbank` | DrugBank | 薬剤データベース API |
251
+
252
+ ## パイプライン統合
253
+
254
+ ```
255
+ drug-target-profiling → drugbank-resources → admet-pharmacokinetics
256
+ (標的プロファイリング) (DrugBank API) (ADMET 予測)
257
+ │ │ ↓
258
+ opentargets-genetics ──────────┘ compound-screening
259
+ (OT 薬剤エビデンス) (ZINC 化合物検索)
260
+ ```
261
+
262
+ ## パイプライン出力
263
+
264
+ | ファイル | 説明 | 次スキル |
265
+ |---------|------|---------|
266
+ | `results/drugbank_search.csv` | 薬剤検索結果 | → drug-target-profiling |
267
+ | `results/drugbank_detail.csv` | 薬剤詳細 | → admet-pharmacokinetics |
268
+ | `results/drugbank_targets.csv` | 標的タンパク質 | → protein-interaction-network |
269
+ | `results/drugbank_ddi.csv` | 薬物相互作用 | → pharmacogenomics |