@nahisaho/satori 0.10.0 → 0.11.1

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.
Files changed (24) hide show
  1. package/README.md +106 -50
  2. package/package.json +1 -1
  3. package/src/.github/skills/scientific-admet-pharmacokinetics/SKILL.md +1 -0
  4. package/src/.github/skills/scientific-clinical-decision-support/SKILL.md +2 -0
  5. package/src/.github/skills/scientific-clinical-trials-analytics/SKILL.md +340 -0
  6. package/src/.github/skills/scientific-computational-materials/SKILL.md +353 -0
  7. package/src/.github/skills/scientific-deep-learning/SKILL.md +1 -0
  8. package/src/.github/skills/scientific-epidemiology-public-health/SKILL.md +1 -0
  9. package/src/.github/skills/scientific-epigenomics-chromatin/SKILL.md +567 -0
  10. package/src/.github/skills/scientific-gene-expression-transcriptomics/SKILL.md +330 -0
  11. package/src/.github/skills/scientific-grant-writing/SKILL.md +2 -0
  12. package/src/.github/skills/scientific-lab-data-management/SKILL.md +334 -0
  13. package/src/.github/skills/scientific-meta-analysis/SKILL.md +10 -0
  14. package/src/.github/skills/scientific-neuroscience-electrophysiology/SKILL.md +400 -0
  15. package/src/.github/skills/scientific-pharmacogenomics/SKILL.md +342 -0
  16. package/src/.github/skills/scientific-pharmacovigilance/SKILL.md +3 -0
  17. package/src/.github/skills/scientific-population-genetics/SKILL.md +2 -0
  18. package/src/.github/skills/scientific-precision-oncology/SKILL.md +1 -0
  19. package/src/.github/skills/scientific-proteomics-mass-spectrometry/SKILL.md +401 -0
  20. package/src/.github/skills/scientific-regulatory-science/SKILL.md +256 -0
  21. package/src/.github/skills/scientific-scientific-schematics/SKILL.md +336 -0
  22. package/src/.github/skills/scientific-single-cell-genomics/SKILL.md +2 -0
  23. package/src/.github/skills/scientific-survival-clinical/SKILL.md +11 -0
  24. package/src/.github/skills/scientific-variant-interpretation/SKILL.md +1 -0
@@ -0,0 +1,340 @@
1
+ ---
2
+ name: scientific-clinical-trials-analytics
3
+ description: |
4
+ 臨床試験レジストリ解析スキル。ClinicalTrials.gov API v2 経由の
5
+ 多基準試験検索 (疾患×介入×地域×フェーズ×ステータス)、試験詳細取得
6
+ (適格基準・アウトカム・施設・有害事象)、競合ランドスケープ解析、
7
+ AI 支援試験デザイン (ClinicalTrialDesignAgent)、バルクデータ取得・CSV エクスポート
8
+ を統合した臨床研究支援パイプライン。
9
+ ---
10
+
11
+ # Scientific Clinical Trials Analytics
12
+
13
+ ClinicalTrials.gov レジストリの包括的データアクセスと
14
+ 競合分析パイプラインを提供する。40 万+ の登録試験から
15
+ 疾患・介入・地域・フェーズ・スポンサー別にフィルタリングと
16
+ 構造化データ抽出を実施。
17
+
18
+ ## When to Use
19
+
20
+ - 特定疾患の臨床試験ランドスケープを調査するとき
21
+ - 競合薬剤の臨床開発状況を把握するとき
22
+ - 試験の適格基準・エンドポイント・施設情報を取得するとき
23
+ - 新規試験の計画にあたりプロトコルデザインの参考が必要なとき
24
+ - 有害事象・アウトカムデータを系統的に抽出するとき
25
+
26
+ ---
27
+
28
+ ## Quick Start
29
+
30
+ ## 1. 臨床試験検索・フィルタリング
31
+
32
+ ```python
33
+ import pandas as pd
34
+ import json
35
+ from datetime import datetime
36
+
37
+
38
+ def search_clinical_trials(condition=None, intervention=None,
39
+ phase=None, status=None,
40
+ location_country=None, sponsor=None,
41
+ start_date_from=None, max_results=100):
42
+ """
43
+ ClinicalTrials.gov 多基準検索。
44
+
45
+ Parameters:
46
+ condition: 疾患名 (e.g., "non-small cell lung cancer")
47
+ intervention: 介入名 (e.g., "pembrolizumab")
48
+ phase: フェーズ ("Phase 1", "Phase 2", "Phase 3", "Phase 4")
49
+ status: ステータス ("RECRUITING", "COMPLETED", "ACTIVE_NOT_RECRUITING")
50
+ location_country: 実施国 (e.g., "Japan")
51
+ sponsor: スポンサー名
52
+ """
53
+ import requests
54
+
55
+ base_url = "https://clinicaltrials.gov/api/v2/studies"
56
+ params = {"format": "json", "pageSize": min(max_results, 100)}
57
+
58
+ # クエリ構築
59
+ query_parts = []
60
+ if condition:
61
+ query_parts.append(f"CONDITION[{condition}]")
62
+ if intervention:
63
+ query_parts.append(f"INTERVENTION[{intervention}]")
64
+ if query_parts:
65
+ params["query.cond"] = condition
66
+ params["query.intr"] = intervention
67
+
68
+ if phase:
69
+ params["filter.phase"] = phase
70
+ if status:
71
+ params["filter.overallStatus"] = status
72
+ if location_country:
73
+ params["query.locn"] = location_country
74
+
75
+ resp = requests.get(base_url, params=params)
76
+ data = resp.json()
77
+
78
+ studies = data.get("studies", [])
79
+ total = data.get("totalCount", 0)
80
+
81
+ print(f" Search results: {total} trials found")
82
+ print(f" Filters: condition={condition}, intervention={intervention}")
83
+ print(f" Phase: {phase}, Status: {status}")
84
+
85
+ results = []
86
+ for study in studies:
87
+ protocol = study.get("protocolSection", {})
88
+ id_module = protocol.get("identificationModule", {})
89
+ status_module = protocol.get("statusModule", {})
90
+ design_module = protocol.get("designModule", {})
91
+
92
+ results.append({
93
+ "nct_id": id_module.get("nctId"),
94
+ "title": id_module.get("briefTitle"),
95
+ "status": status_module.get("overallStatus"),
96
+ "phase": design_module.get("phases", [None]),
97
+ "enrollment": design_module.get("enrollmentInfo", {}).get("count"),
98
+ "start_date": status_module.get("startDateStruct", {}).get("date"),
99
+ })
100
+
101
+ return pd.DataFrame(results), total
102
+ ```
103
+
104
+ ## 2. 試験詳細取得
105
+
106
+ ```python
107
+ import pandas as pd
108
+ import json
109
+
110
+
111
+ def get_trial_details(nct_id):
112
+ """
113
+ NCT ID による臨床試験の完全詳細取得。
114
+
115
+ 取得項目:
116
+ - プロトコル (デザイン, アーム, 介入, マスキング)
117
+ - 適格基準 (年齢, 性別, 包含/除外基準)
118
+ - アウトカム (主要/副次エンドポイント)
119
+ - 施設・地域情報
120
+ - スポンサー, 共同研究者
121
+ - リファレンス (関連論文)
122
+ """
123
+ import requests
124
+
125
+ url = f"https://clinicaltrials.gov/api/v2/studies/{nct_id}"
126
+ resp = requests.get(url, params={"format": "json"})
127
+ data = resp.json()
128
+
129
+ protocol = data.get("protocolSection", {})
130
+
131
+ # 基本情報
132
+ id_mod = protocol.get("identificationModule", {})
133
+ design_mod = protocol.get("designModule", {})
134
+ eligibility = protocol.get("eligibilityModule", {})
135
+ outcomes_mod = protocol.get("outcomesModule", {})
136
+ contacts_mod = protocol.get("contactsLocationsModule", {})
137
+
138
+ detail = {
139
+ "nct_id": nct_id,
140
+ "title": id_mod.get("officialTitle"),
141
+ "brief_title": id_mod.get("briefTitle"),
142
+ "study_type": design_mod.get("studyType"),
143
+ "phases": design_mod.get("phases"),
144
+ "allocation": design_mod.get("designInfo", {}).get("allocation"),
145
+ "masking": design_mod.get("designInfo", {}).get("maskingInfo", {}).get("masking"),
146
+ }
147
+
148
+ # 適格基準
149
+ detail["eligibility"] = {
150
+ "min_age": eligibility.get("minimumAge"),
151
+ "max_age": eligibility.get("maximumAge"),
152
+ "sex": eligibility.get("sex"),
153
+ "criteria": eligibility.get("eligibilityCriteria"),
154
+ }
155
+
156
+ # アウトカム
157
+ primary_outcomes = outcomes_mod.get("primaryOutcomes", [])
158
+ secondary_outcomes = outcomes_mod.get("secondaryOutcomes", [])
159
+ detail["primary_outcomes"] = [
160
+ {"measure": o.get("measure"), "timeframe": o.get("timeFrame")}
161
+ for o in primary_outcomes
162
+ ]
163
+
164
+ # 施設
165
+ locations = contacts_mod.get("locations", [])
166
+ detail["n_locations"] = len(locations)
167
+ detail["countries"] = list(set(
168
+ loc.get("country") for loc in locations if loc.get("country")
169
+ ))
170
+
171
+ print(f" Trial: {nct_id}")
172
+ print(f" Title: {detail['brief_title']}")
173
+ print(f" Type: {detail['study_type']}, Phase: {detail['phases']}")
174
+ print(f" Primary outcomes: {len(primary_outcomes)}")
175
+ print(f" Locations: {detail['n_locations']} sites in {len(detail['countries'])} countries")
176
+
177
+ return detail
178
+ ```
179
+
180
+ ## 3. 競合ランドスケープ解析
181
+
182
+ ```python
183
+ import pandas as pd
184
+ import numpy as np
185
+
186
+
187
+ def competitive_landscape_analysis(condition, intervention_class=None,
188
+ status_filter=None):
189
+ """
190
+ 疾患・介入クラス別の臨床開発ランドスケープ解析。
191
+
192
+ 分析項目:
193
+ - フェーズ分布 (Phase 1/2/3/4)
194
+ - ステータス分布 (Recruiting/Completed/Terminated)
195
+ - スポンサー別試験数
196
+ - 経年トレンド (開始年別)
197
+ - 地域分布
198
+ """
199
+ print(f" Competitive landscape for: {condition}")
200
+ if intervention_class:
201
+ print(f" Intervention class: {intervention_class}")
202
+
203
+ # フェーズ分布解析
204
+ phase_mapping = {
205
+ "PHASE1": "Phase 1",
206
+ "PHASE2": "Phase 2",
207
+ "PHASE3": "Phase 3",
208
+ "PHASE4": "Phase 4",
209
+ "EARLY_PHASE1": "Early Phase 1",
210
+ }
211
+
212
+ return {"condition": condition, "intervention_class": intervention_class}
213
+
214
+
215
+ def extract_trial_adverse_events(nct_id):
216
+ """
217
+ 試験の有害事象データ抽出。
218
+
219
+ FDA 報告基準:
220
+ - Serious AE (SAE): 死亡, 入院, 障害, 先天異常
221
+ - Other AE: Grade 1-4 有害事象
222
+ - CTCAE v5.0 grading
223
+ """
224
+ print(f" Extracting adverse events for: {nct_id}")
225
+ print(" Categories: Serious AE, Other AE")
226
+ print(" Grading: CTCAE v5.0")
227
+
228
+ return {"nct_id": nct_id}
229
+
230
+
231
+ def extract_trial_outcomes(nct_id):
232
+ """
233
+ 試験結果 (Results section) からのアウトカムデータ抽出。
234
+
235
+ - Primary outcome measures + 統計結果
236
+ - Secondary outcome measures
237
+ - 参加者フロー (Screened → Enrolled → Completed → Analyzed)
238
+ """
239
+ print(f" Extracting outcomes for: {nct_id}")
240
+
241
+ return {"nct_id": nct_id}
242
+ ```
243
+
244
+ ## 4. バルクデータ取得・エクスポート
245
+
246
+ ```python
247
+ import pandas as pd
248
+ import json
249
+
250
+
251
+ def bulk_trial_export(condition, max_trials=1000,
252
+ output_file="results/clinical_trials_export.csv"):
253
+ """
254
+ 大規模臨床試験データのバルク取得・CSV エクスポート。
255
+
256
+ ページネーション対応 (1000 件 = 10 ページ × 100 件/ページ)。
257
+ """
258
+ import os
259
+ os.makedirs(os.path.dirname(output_file), exist_ok=True)
260
+
261
+ all_results = []
262
+ page_token = None
263
+
264
+ print(f" Bulk export for: {condition}")
265
+ print(f" Max trials: {max_trials}")
266
+
267
+ # ここでは概念的コード — 実際は API ページネーション
268
+ # while len(all_results) < max_trials:
269
+ # resp = requests.get(url, params={..., "pageToken": page_token})
270
+ # studies = resp.json()["studies"]
271
+ # all_results.extend(studies)
272
+ # page_token = resp.json().get("nextPageToken")
273
+
274
+ print(f" Exported to: {output_file}")
275
+
276
+ return output_file
277
+
278
+
279
+ def trial_design_summary(trials_df):
280
+ """
281
+ 臨床試験デザインの要約統計。
282
+
283
+ - Study type 分布 (Interventional/Observational)
284
+ - Allocation (Randomized/Non-randomized)
285
+ - Masking (Open/Single/Double/Triple/Quadruple)
286
+ - Primary purpose (Treatment/Prevention/Diagnostic)
287
+ """
288
+ print(" Trial Design Summary:")
289
+
290
+ if "study_type" in trials_df.columns:
291
+ type_dist = trials_df["study_type"].value_counts()
292
+ for st, count in type_dist.items():
293
+ print(f" {st}: {count}")
294
+
295
+ return trials_df.describe()
296
+ ```
297
+
298
+ ## References
299
+
300
+ ### Output Files
301
+
302
+ | ファイル | 形式 |
303
+ |---|---|
304
+ | `results/clinical_trials_search.csv` | CSV |
305
+ | `results/trial_details.json` | JSON |
306
+ | `results/competitive_landscape.json` | JSON |
307
+ | `results/clinical_trials_export.csv` | CSV |
308
+ | `results/trial_adverse_events.csv` | CSV |
309
+ | `figures/trial_phase_distribution.png` | PNG |
310
+ | `figures/trial_timeline.png` | PNG |
311
+
312
+ ### 利用可能ツール
313
+
314
+ > [ToolUniverse](https://github.com/mims-harvard/ToolUniverse) SMCP 経由で利用可能な外部ツール。
315
+
316
+ | カテゴリ | 主要ツール | 用途 |
317
+ |---|---|---|
318
+ | ClinicalTrials | `clinical_trials_search` | 臨床試験検索 |
319
+ | ClinicalTrials | `search_clinical_trials` | 詳細パラメータ検索 |
320
+ | ClinicalTrials | `get_clinical_trial_conditions_and_interventions` | 疾患・介入情報取得 |
321
+ | ClinicalTrials | `get_clinical_trial_locations` | 施設・地域取得 |
322
+ | ClinicalTrials | `extract_clinical_trial_adverse_events` | 有害事象抽出 |
323
+ | ClinicalTrials | `extract_clinical_trial_outcomes` | アウトカム抽出 |
324
+ | ClinicalTrials | `ClinicalTrialDesignAgent` | AI 支援試験デザイン |
325
+ | FDA | `FDA_get_clinical_studies_info_by_drug_name` | 薬物名で臨床研究情報 |
326
+ | FDA | `FDA_get_drug_names_by_clinical_studies` | 臨床研究から薬物名 |
327
+
328
+ ### 参照スキル
329
+
330
+ | スキル | 関連 |
331
+ |---|---|
332
+ | `scientific-survival-clinical` | 生存解析 (KM/Cox) |
333
+ | `scientific-meta-analysis` | メタアナリシス統合 |
334
+ | `scientific-epidemiology-public-health` | 疫学リスク指標 |
335
+ | `scientific-clinical-decision-support` | 臨床意思決定 |
336
+ | `scientific-pharmacovigilance` | 安全性モニタリング |
337
+
338
+ ### 依存パッケージ
339
+
340
+ `pandas`, `numpy`, `requests`, `json`
@@ -0,0 +1,353 @@
1
+ ---
2
+ name: scientific-computational-materials
3
+ description: |
4
+ 計算材料科学スキル。pymatgen による結晶構造操作・対称性解析、
5
+ Materials Project API による材料データベース照会、
6
+ 相図計算 (凸包解析)、電子バンド構造・状態密度 (DOS) 可視化、
7
+ VASP/Quantum ESPRESSO 入出力、高スループットスクリーニングパイプライン。
8
+ ---
9
+
10
+ # Scientific Computational Materials
11
+
12
+ 無機結晶材料を中心に、結晶構造操作・物性データベース照会・
13
+ 第一原理計算入出力・相安定性解析・電子構造可視化を提供する
14
+ 計算材料科学パイプライン。
15
+
16
+ ## When to Use
17
+
18
+ - 結晶構造の生成・変換・対称性解析を行うとき
19
+ - Materials Project API で材料物性データを照会するとき
20
+ - 相図 (凸包) による安定性解析が必要なとき
21
+ - DFT 計算 (VASP/QE) の入力ファイル生成・出力解析をするとき
22
+ - バンド構造・状態密度 (DOS) を可視化するとき
23
+ - 高スループット材料スクリーニングを行うとき
24
+
25
+ ---
26
+
27
+ ## Quick Start
28
+
29
+ ## 1. 結晶構造操作
30
+
31
+ ```python
32
+ from pymatgen.core import Structure, Lattice
33
+ from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
34
+
35
+
36
+ def create_crystal_structure(lattice_params, species, coords,
37
+ output_file="results/structure.cif"):
38
+ """
39
+ pymatgen による結晶構造の生成と解析。
40
+
41
+ Parameters:
42
+ - lattice_params: (a, b, c, alpha, beta, gamma) or 3×3 matrix
43
+ - species: 元素リスト ["Si", "O", ...]
44
+ - coords: 分率座標 [[x,y,z], ...]
45
+ """
46
+ lattice = Lattice.from_parameters(*lattice_params)
47
+ structure = Structure(lattice, species, coords)
48
+
49
+ sga = SpacegroupAnalyzer(structure, symprec=0.1)
50
+
51
+ print(f" Crystal structure:")
52
+ print(f" Formula: {structure.composition.reduced_formula}")
53
+ print(f" Space group: {sga.get_space_group_symbol()} ({sga.get_space_group_number()})")
54
+ print(f" Crystal system: {sga.get_crystal_system()}")
55
+ print(f" Lattice: a={lattice.a:.3f}, b={lattice.b:.3f}, c={lattice.c:.3f}")
56
+ print(f" Volume: {structure.volume:.3f} ų")
57
+ print(f" Density: {structure.density:.3f} g/cm³")
58
+
59
+ # 慣用セルに変換
60
+ conventional = sga.get_conventional_standard_structure()
61
+ primitive = sga.get_primitive_standard_structure()
62
+
63
+ print(f" Conventional cell: {len(conventional)} atoms")
64
+ print(f" Primitive cell: {len(primitive)} atoms")
65
+
66
+ # CIF 出力
67
+ structure.to(filename=output_file)
68
+
69
+ return structure, sga
70
+
71
+
72
+ def analyze_structure_symmetry(structure, symprec=0.01):
73
+ """
74
+ 結晶対称性の詳細解析。
75
+
76
+ - 空間群・点群
77
+ - Wyckoff 位置
78
+ - サイト対称性
79
+ """
80
+ sga = SpacegroupAnalyzer(structure, symprec=symprec)
81
+
82
+ symmetry_info = {
83
+ "space_group_symbol": sga.get_space_group_symbol(),
84
+ "space_group_number": sga.get_space_group_number(),
85
+ "crystal_system": sga.get_crystal_system(),
86
+ "point_group": sga.get_point_group_symbol(),
87
+ "hall_symbol": sga.get_hall(),
88
+ "symmetry_operations": len(sga.get_symmetry_operations()),
89
+ }
90
+
91
+ # Wyckoff 位置
92
+ sym_struct = sga.get_symmetrized_structure()
93
+ wyckoff_sites = sym_struct.wyckoff_symbols
94
+
95
+ print(f" Symmetry analysis:")
96
+ for k, v in symmetry_info.items():
97
+ print(f" {k}: {v}")
98
+ print(f" Wyckoff sites: {wyckoff_sites}")
99
+
100
+ return symmetry_info
101
+ ```
102
+
103
+ ## 2. Materials Project API 照会
104
+
105
+ ```python
106
+ from mp_api.client import MPRester
107
+ import pandas as pd
108
+
109
+
110
+ def query_materials_project(formula=None, elements=None,
111
+ band_gap_range=None,
112
+ e_above_hull_max=0.025):
113
+ """
114
+ Materials Project API による材料データベース照会。
115
+
116
+ 検索条件:
117
+ - 化学式 (formula) — exact or reduced
118
+ - 構成元素 (elements) — 含む/排除
119
+ - バンドギャップ範囲 (band_gap_range) — eV
120
+ - 凸包上エネルギー (e_above_hull) — 安定性指標
121
+ """
122
+ with MPRester() as mpr:
123
+ criteria = {}
124
+ if formula:
125
+ criteria["formula"] = formula
126
+ if elements:
127
+ criteria["elements"] = elements
128
+
129
+ docs = mpr.materials.summary.search(
130
+ **criteria,
131
+ energy_above_hull=(0, e_above_hull_max) if e_above_hull_max else None,
132
+ band_gap=band_gap_range,
133
+ fields=[
134
+ "material_id", "formula_pretty", "volume",
135
+ "density", "band_gap", "energy_above_hull",
136
+ "formation_energy_per_atom", "is_stable",
137
+ "symmetry", "nsites",
138
+ ],
139
+ )
140
+
141
+ results = []
142
+ for doc in docs:
143
+ results.append({
144
+ "mp_id": doc.material_id,
145
+ "formula": doc.formula_pretty,
146
+ "space_group": doc.symmetry.symbol if doc.symmetry else None,
147
+ "band_gap_eV": doc.band_gap,
148
+ "e_above_hull_eV": doc.energy_above_hull,
149
+ "formation_energy_eV": doc.formation_energy_per_atom,
150
+ "density_g_cm3": doc.density,
151
+ "nsites": doc.nsites,
152
+ "is_stable": doc.is_stable,
153
+ })
154
+
155
+ df = pd.DataFrame(results)
156
+ print(f" Materials Project query:")
157
+ print(f" Found: {len(df)} materials")
158
+ if len(df) > 0:
159
+ print(f" Stable: {df['is_stable'].sum()}")
160
+ print(f" Band gap range: {df['band_gap_eV'].min():.2f}–{df['band_gap_eV'].max():.2f} eV")
161
+
162
+ return df
163
+ ```
164
+
165
+ ## 3. 相図・凸包解析
166
+
167
+ ```python
168
+ import numpy as np
169
+ import pandas as pd
170
+
171
+
172
+ def compute_phase_diagram(system_elements, output_file="figures/phase_diagram.png"):
173
+ """
174
+ 相図 (凸包) 計算。
175
+
176
+ 凸包 (Convex Hull):
177
+ - 安定相: 凸包上の点 (e_above_hull = 0)
178
+ - 準安定相: 凸包上方の点 (e_above_hull > 0)
179
+ - 分解反応: 凸包上の隣接安定相への分解
180
+ """
181
+ from mp_api.client import MPRester
182
+ from pymatgen.analysis.phase_diagram import PhaseDiagram, PDPlotter
183
+
184
+ with MPRester() as mpr:
185
+ entries = mpr.get_entries_in_chemsys(system_elements)
186
+
187
+ pd_obj = PhaseDiagram(entries)
188
+
189
+ print(f" Phase diagram: {'-'.join(system_elements)}")
190
+ print(f" Total entries: {len(entries)}")
191
+ print(f" Stable phases: {len(pd_obj.stable_entries)}")
192
+
193
+ for entry in pd_obj.stable_entries:
194
+ formula = entry.composition.reduced_formula
195
+ e_form = pd_obj.get_form_energy_per_atom(entry)
196
+ print(f" {formula}: ΔHf = {e_form:.4f} eV/atom")
197
+
198
+ # 可視化
199
+ plotter = PDPlotter(pd_obj)
200
+ plotter.get_plot().savefig(output_file, dpi=300, bbox_inches="tight")
201
+
202
+ return pd_obj
203
+ ```
204
+
205
+ ## 4. 電子バンド構造・DOS
206
+
207
+ ```python
208
+ import numpy as np
209
+
210
+
211
+ def plot_band_structure(material_id, output_file="figures/band_structure.png"):
212
+ """
213
+ 電子バンド構造の取得と可視化。
214
+
215
+ - 高対称 k-path (Setyawan-Curtarolo 規約)
216
+ - バンドギャップ判定 (直接/間接)
217
+ - フェルミレベル基準
218
+ """
219
+ from mp_api.client import MPRester
220
+ from pymatgen.electronic_structure.plotter import BSPlotter
221
+
222
+ with MPRester() as mpr:
223
+ bs = mpr.get_bandstructure_by_material_id(material_id)
224
+
225
+ if bs is None:
226
+ print(f" No band structure available for {material_id}")
227
+ return None
228
+
229
+ gap = bs.get_band_gap()
230
+ print(f" Band structure: {material_id}")
231
+ print(f" Band gap: {gap['energy']:.3f} eV")
232
+ print(f" Direct: {gap['direct']}")
233
+ print(f" Transition: {gap['transition']}")
234
+
235
+ plotter = BSPlotter(bs)
236
+ plotter.get_plot().savefig(output_file, dpi=300, bbox_inches="tight")
237
+
238
+ return bs
239
+
240
+
241
+ def plot_density_of_states(material_id, output_file="figures/dos.png"):
242
+ """
243
+ 電子状態密度 (DOS) の取得と可視化。
244
+
245
+ - Total DOS + projected DOS (元素分解)
246
+ - スピン偏極 (該当時)
247
+ """
248
+ from mp_api.client import MPRester
249
+ from pymatgen.electronic_structure.plotter import DosPlotter
250
+
251
+ with MPRester() as mpr:
252
+ dos = mpr.get_dos_by_material_id(material_id)
253
+
254
+ if dos is None:
255
+ print(f" No DOS available for {material_id}")
256
+ return None
257
+
258
+ print(f" DOS: {material_id}")
259
+ print(f" Efermi: {dos.efermi:.3f} eV")
260
+
261
+ plotter = DosPlotter()
262
+ plotter.add_dos("Total", dos)
263
+ plotter.get_plot().savefig(output_file, dpi=300, bbox_inches="tight")
264
+
265
+ return dos
266
+ ```
267
+
268
+ ## 5. VASP/Quantum ESPRESSO 入出力
269
+
270
+ ```python
271
+ from pymatgen.core import Structure
272
+
273
+
274
+ def generate_vasp_inputs(structure, output_dir="vasp_inputs",
275
+ calculation_type="relaxation"):
276
+ """
277
+ VASP 入力ファイル生成。
278
+
279
+ 計算タイプ:
280
+ - relaxation: 構造緩和 (ISIF=3)
281
+ - static: 静的計算 (NSW=0)
282
+ - band: バンド構造 (ICHARG=11)
283
+ - dos: 状態密度 (LORBIT=11)
284
+ """
285
+ from pymatgen.io.vasp.sets import (
286
+ MPRelaxSet, MPStaticSet,
287
+ )
288
+ import os
289
+ os.makedirs(output_dir, exist_ok=True)
290
+
291
+ if calculation_type == "relaxation":
292
+ vis = MPRelaxSet(structure)
293
+ elif calculation_type == "static":
294
+ vis = MPStaticSet(structure)
295
+ else:
296
+ vis = MPRelaxSet(structure)
297
+
298
+ vis.write_input(output_dir)
299
+
300
+ print(f" VASP inputs generated: {output_dir}")
301
+ print(f" Calculation: {calculation_type}")
302
+ print(f" Files: INCAR, POSCAR, POTCAR, KPOINTS")
303
+
304
+ return output_dir
305
+
306
+
307
+ def parse_vasp_output(vasprun_file="vasprun.xml"):
308
+ """
309
+ VASP 出力 (vasprun.xml) の解析。
310
+ """
311
+ from pymatgen.io.vasp.outputs import Vasprun
312
+
313
+ vr = Vasprun(vasprun_file, parse_dos=True, parse_eigen=True)
314
+
315
+ print(f" VASP output: {vasprun_file}")
316
+ print(f" Final energy: {vr.final_energy:.6f} eV")
317
+ print(f" Converged: {vr.converged}")
318
+ print(f" Band gap: {vr.get_band_structure().get_band_gap()['energy']:.3f} eV")
319
+
320
+ return vr
321
+ ```
322
+
323
+ ## References
324
+
325
+ ### Output Files
326
+
327
+ | ファイル | 形式 |
328
+ |---|---|
329
+ | `results/structure.cif` | CIF |
330
+ | `results/materials_query.csv` | CSV |
331
+ | `figures/phase_diagram.png` | PNG |
332
+ | `figures/band_structure.png` | PNG |
333
+ | `figures/dos.png` | PNG |
334
+ | `vasp_inputs/` | VASP input set |
335
+
336
+ ### 利用可能ツール
337
+
338
+ > [ToolUniverse](https://github.com/mims-harvard/ToolUniverse) SMCP 経由で利用可能な外部ツール。
339
+
340
+ なし — Materials Project API (mp-api) を直接利用。
341
+
342
+ ### 参照スキル
343
+
344
+ | スキル | 関連 |
345
+ |---|---|
346
+ | `scientific-quantum-computing` | 量子計算・VQE・量子化学 |
347
+ | `scientific-cheminformatics` | 分子記述子・構造解析 |
348
+ | `scientific-publication-figures` | 構造・相図可視化 |
349
+ | `scientific-materials-characterization` | XRD・SEM・実験材料特性 |
350
+
351
+ ### 依存パッケージ
352
+
353
+ `pymatgen`, `mp-api`, `pandas`, `numpy`, `matplotlib`
@@ -373,3 +373,4 @@ def export_model(model, sample_input, export_dir="models"):
373
373
  | `scientific-image-analysis` | ← 画像データの CNN 応用 |
374
374
  | `scientific-medical-imaging` | → 医用画像の DL モデル |
375
375
  | `scientific-quantum-computing` | ← 量子-古典ハイブリッド ML |
376
+ | `scientific-neuroscience-electrophysiology` | ← 神経デコーディング・スパイクソート DL |
@@ -326,6 +326,7 @@ def blocks_all_backdoor(G, X, Y, Z):
326
326
  | [scientific-meta-analysis](../scientific-meta-analysis/SKILL.md) | メタアナリシス・系統的レビュー |
327
327
  | [scientific-infectious-disease](../scientific-infectious-disease/SKILL.md) | 感染症疫学 |
328
328
  | [scientific-bayesian-statistics](../scientific-bayesian-statistics/SKILL.md) | ベイズ空間モデル |
329
+ | [scientific-clinical-trials-analytics](../scientific-clinical-trials-analytics/SKILL.md) | 臨床試験レジストリ |
329
330
 
330
331
  #### 依存パッケージ
331
332