@nahisaho/satori 0.9.0 → 0.10.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 CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  ## Overview
9
9
 
10
- このディレクトリには、Exp-01〜13 で蓄積した科学データ解析技法を Agent Skills として体系化した **56 個**のスキルを格納しています。Copilot がプロンプトの文脈に応じて適切なスキルを自動ロードし、各実験で確立した解析パターンを再利用します。22 のスキルは [ToolUniverse](https://github.com/mims-harvard/ToolUniverse) SMCP 経由で 1,200 以上の外部科学データベースツールとも連携可能です。
10
+ このディレクトリには、Exp-01〜13 で蓄積した科学データ解析技法を Agent Skills として体系化した **66 個**のスキルを格納しています。Copilot がプロンプトの文脈に応じて適切なスキルを自動ロードし、各実験で確立した解析パターンを再利用します。32 のスキルは [ToolUniverse](https://github.com/mims-harvard/ToolUniverse) SMCP 経由で 1,200 以上の外部科学データベースツールとも連携可能です。
11
11
 
12
12
  ### パイプラインフロー
13
13
 
@@ -54,6 +54,25 @@ quantum-computing → bayesian-statistics → graph-neural-networks
54
54
  (XAI 説明可能性) (DL パイプライン)
55
55
  ```
56
56
 
57
+ **次世代オミクス・疫学パイプライン(T-Z)**
58
+
59
+ ```
60
+ single-cell-genomics → spatial-transcriptomics ← [T シングルセル・空間]
61
+ (scRNA-seq QC) (Visium/MERFISH)
62
+ ↓ ↓
63
+ immunoinformatics → infectious-disease ← [U 免疫・感染症]
64
+ (エピトープ予測) (AMR・系統解析)
65
+ ↓ ↓
66
+ microbiome-metagenomics → environmental-ecology ← [V マイクロバイオーム・環境]
67
+ (16S/メタゲノム) (SDM・生物多様性)
68
+ ↓ ↓
69
+ systems-biology population-genetics ← [W+Y モデル・集団]
70
+ (SBML/FBA/GRN) (Fst/ADMIXTURE)
71
+ ↓ ↓
72
+ epidemiology-public-health → text-mining-nlp ← [X+Z 疫学・NLP]
73
+ (RR/OR/空間クラスタ) (NER/KG/BERTopic)
74
+ ```
75
+
57
76
  | フェーズ | 生成ファイル | 参照先 |
58
77
  |---|---|---|
59
78
  | 仮説立案 | `docs/hypothesis.{md,json}`, `docs/workflow_design.{md,json}` | → scaffold, writing |
@@ -86,10 +105,20 @@ quantum-computing → bayesian-statistics → graph-neural-networks
86
105
  | 説明可能 AI | `results/xai_report.json`, `figures/shap_summary.png` | → clinical-decision |
87
106
  | 深層学習 | `results/dl_training_log.json`, `models/model.onnx` | → GNN, medical-imaging |
88
107
  | 医用イメージング | `results/imaging_report.{md,json}`, `results/radiomics_features.json` | → precision-oncology |
108
+ | scRNA-seq 解析 | `results/sc_markers.json`, `figures/umap_clusters.png`, `results/rna_velocity.json` | → spatial, systems-biology |
109
+ | 空間トランスクリプトミクス | `results/spatial_domains.json`, `figures/spatial_svg_map.png` | → single-cell, systems-biology |
110
+ | 免疫情報学 | `results/epitope_candidates.json`, `results/tcr_diversity.json` | → infectious-disease, drug-target |
111
+ | 感染症ゲノミクス | `results/amr_report.json`, `results/mlst_profile.json`, `results/sir_simulation.json` | → epidemiology, microbiome |
112
+ | マイクロバイオーム | `results/asv_table.json`, `results/diversity_metrics.json`, `results/da_results.json` | → environmental-ecology |
113
+ | 環境生態学 | `results/sdm_predictions.json`, `results/biodiversity_indices.json` | → microbiome, text-mining |
114
+ | システム生物学 | `results/sbml_timecourse.json`, `results/fba_fluxes.json`, `results/grn_edges.json` | → multi-omics, network-analysis |
115
+ | 疫学・公衆衛生 | `results/epi_risk_measures.json`, `results/spatial_clusters.json`, `results/dag_analysis.json` | → survival-clinical, causal-inference |
116
+ | 集団遺伝学 | `results/pop_structure.json`, `results/fst_matrix.json`, `results/selection_scan.json` | → disease-research, variant-interpretation |
117
+ | テキストマイニング | `results/ner_entities.json`, `results/knowledge_graph.json`, `results/topic_model.json` | → deep-research, meta-analysis |
89
118
 
90
119
  ### ToolUniverse MCP ツール連携
91
120
 
92
- 22 のスキル(HIGH 13 + MEDIUM 9)は、[ToolUniverse](https://github.com/mims-harvard/ToolUniverse) SMCP サーバー経由で 1,200 以上の外部科学ツールを利用可能です。各 SKILL.md 内の `### 利用可能ツール` セクションに対応ツールが記載されています。
121
+ 32 のスキル(HIGH 13 + MEDIUM 9 + 新規 10)は、[ToolUniverse](https://github.com/mims-harvard/ToolUniverse) SMCP サーバー経由で 1,200 以上の外部科学ツールを利用可能です。各 SKILL.md 内の `### 利用可能ツール` セクションに対応ツールが記載されています。
93
122
 
94
123
  ```
95
124
  SATORI Skill (方法論・判断) ToolUniverse SMCP (データ取得・計算)
@@ -100,11 +129,11 @@ SATORI Skill (方法論・判断) ToolUniverse SMCP (データ取得・
100
129
  │ drug-target-profiling│───MCP──│ UniProt, ChEMBL, DGIdb │
101
130
  │ variant-interpretation│──MCP──│ ClinVar, gnomAD, ClinGen │
102
131
  │ admet-pharmacokinetics│──MCP──│ ADMET-AI, PubChem, ChEMBL │
103
- │ ... (22 skills total) │ │ ... (1,200+ tools) │
132
+ │ ... (32 skills total) │ │ ... (1,200+ tools) │
104
133
  └──────────────────────┘ └─────────────────────────────┘
105
134
  ```
106
135
 
107
- スキルは **19 の中区分**に分類されています。
136
+ スキルは **26 の中区分**に分類されています。
108
137
 
109
138
  | 中区分 | スキル数 | 概要 |
110
139
  |---|:---:|---|
@@ -127,6 +156,13 @@ SATORI Skill (方法論・判断) ToolUniverse SMCP (データ取得・
127
156
  | Q. 腫瘍学・疾患研究 | 2 | 精密腫瘍学 (CIViC/OncoKB)・疾患-遺伝子関連 (GWAS/Orphanet) |
128
157
  | R. 量子・先端計算 | 5 | 量子計算・GNN・ベイズ統計・説明可能 AI・深層学習 |
129
158
  | S. 医用イメージング | 1 | DICOM/NIfTI・WSI 病理画像・Radiomics・MONAI |
159
+ | T. シングルセル・空間オミクス | 2 | scRNA-seq・Visium・MERFISH・CELLxGENE・RNA velocity |
160
+ | U. 免疫・感染症 | 2 | 免疫情報学・MHC 結合予測・病原体ゲノミクス・AMR・IEDB |
161
+ | V. マイクロバイオーム・環境 | 2 | 16S/メタゲノム・α/β 多様性・SDM・OBIS・GBIF |
162
+ | W. システム生物学 | 1 | SBML シミュレーション・FBA・GRN 推定・BioModels |
163
+ | X. 疫学・公衆衛生 | 1 | リスク指標 (RR/OR)・年齢標準化・空間疫学・WHO・CDC |
164
+ | Y. 集団遺伝学 | 1 | HWE・PCA/ADMIXTURE・Fst・選択スキャン・gnomAD・GWAS |
165
+ | Z. 科学テキストマイニング | 1 | NER・関係抽出・知識グラフ・BERTopic・PubTator |
130
166
 
131
167
  ---
132
168
 
@@ -321,6 +357,65 @@ DICOM・WSI 等の医用画像の解析・セグメンテーションを担う
321
357
  |---|---|---|---|
322
358
  | 56 | [scientific-medical-imaging](scientific-medical-imaging/SKILL.md) | DICOM/NIfTI 処理・MONAI U-Net/SwinUNETR・WSI パッチ抽出・Radiomics・3D 可視化 | 汎用 |
323
359
 
360
+ ### T. シングルセル・空間オミクス(2 種)
361
+
362
+ scRNA-seq・空間トランスクリプトミクスの解析パイプラインを担うスキル群。
363
+
364
+ | # | Skill | 説明 | 参照 Exp |
365
+ |---|---|---|---|
366
+ | 57 | [scientific-single-cell-genomics](scientific-single-cell-genomics/SKILL.md) | scRNA-seq QC・Scanpy Leiden クラスタリング・DEG・RNA velocity・CellChat 細胞間通信 | 汎用 |
367
+ | 58 | [scientific-spatial-transcriptomics](scientific-spatial-transcriptomics/SKILL.md) | Visium/MERFISH 前処理・Squidpy SVG 検出・空間ドメイン・cell2location デコンボリューション | 汎用 |
368
+
369
+ ### U. 免疫・感染症(2 種)
370
+
371
+ 免疫情報学・病原体ゲノミクスの解析パイプラインを担うスキル群。
372
+
373
+ | # | Skill | 説明 | 参照 Exp |
374
+ |---|---|---|---|
375
+ | 59 | [scientific-immunoinformatics](scientific-immunoinformatics/SKILL.md) | MHC-I/II 結合予測・B 細胞エピトープ・TCR/BCR レパトア多様性・抗体 CDR 解析・ワクチン候補ランキング | 汎用 |
376
+ | 60 | [scientific-infectious-disease](scientific-infectious-disease/SKILL.md) | 病原体 WGS QC・AMR 遺伝子検出・MLST 型別・系統解析 (IQ-TREE)・SIR/SEIR 数理モデル | 汎用 |
377
+
378
+ ### V. マイクロバイオーム・環境(2 種)
379
+
380
+ マイクロバイオーム解析と環境・生態系モデリングを担うスキル群。
381
+
382
+ | # | Skill | 説明 | 参照 Exp |
383
+ |---|---|---|---|
384
+ | 61 | [scientific-microbiome-metagenomics](scientific-microbiome-metagenomics/SKILL.md) | DADA2 ASV パイプライン・MetaPhlAn/Kraken2・α/β 多様性・ANCOM-BC 差次的存在量・HUMAnN 機能プロファイリング | 汎用 |
385
+ | 62 | [scientific-environmental-ecology](scientific-environmental-ecology/SKILL.md) | SDM (MaxEnt/RF/GBM)・生物多様性指数・群集序列化 (NMDS/CCA)・保全優先順位ランキング | 汎用 |
386
+
387
+ ### W. システム生物学(1 種)
388
+
389
+ SBML 動的シミュレーション・代謝フラックス・遺伝子制御ネットワーク推定を担うスキル。
390
+
391
+ | # | Skill | 説明 | 参照 Exp |
392
+ |---|---|---|---|
393
+ | 63 | [scientific-systems-biology](scientific-systems-biology/SKILL.md) | SBML/RoadRunner シミュレーション・FBA/pFBA (cobrapy)・GRN 推定 (GENIE3)・Sobol 感度解析 | 汎用 |
394
+
395
+ ### X. 疫学・公衆衛生(1 種)
396
+
397
+ 疫学的リスク指標算出・標準化・空間疫学・DAG 交絡分析を担うスキル。
398
+
399
+ | # | Skill | 説明 | 参照 Exp |
400
+ |---|---|---|---|
401
+ | 64 | [scientific-epidemiology-public-health](scientific-epidemiology-public-health/SKILL.md) | RR/OR/RD/NNT/AF リスク指標・直接/間接年齢標準化・LISA/Getis-Ord 空間クラスタリング・DAG バックドア基準 | 汎用 |
402
+
403
+ ### Y. 集団遺伝学(1 種)
404
+
405
+ 集団構造推定・分化指標・自然選択検出を担うスキル。
406
+
407
+ | # | Skill | 説明 | 参照 Exp |
408
+ |---|---|---|---|
409
+ | 65 | [scientific-population-genetics](scientific-population-genetics/SKILL.md) | PLINK2 QC・HWE 検定・PCA/ADMIXTURE・Weir-Cockerham Fst・iHS/Tajima's D 選択スキャン | 汎用 |
410
+
411
+ ### Z. 科学テキストマイニング(1 種)
412
+
413
+ 科学文献からの情報抽出・知識グラフ構築・トピックモデリングを担うスキル。
414
+
415
+ | # | Skill | 説明 | 参照 Exp |
416
+ |---|---|---|---|
417
+ | 66 | [scientific-text-mining-nlp](scientific-text-mining-nlp/SKILL.md) | BioBERT/SciSpaCy NER・関係抽出・知識グラフ構築 (Louvain)・BERTopic トピックモデリング・引用ネットワーク分析 | 汎用 |
418
+
324
419
  ---
325
420
 
326
421
  ## インストール
@@ -459,6 +554,30 @@ Skills は `.github/skills/` に配置されているため、Copilot が自動
459
554
 
460
555
  └── [S] 医用イメージング
461
556
  └── scientific-medical-imaging/
557
+
558
+ │── [T] シングルセル・空間オミクス
559
+ │ ├── scientific-single-cell-genomics/
560
+ │ └── scientific-spatial-transcriptomics/
561
+
562
+ │── [U] 免疫・感染症
563
+ │ ├── scientific-immunoinformatics/
564
+ │ └── scientific-infectious-disease/
565
+
566
+ │── [V] マイクロバイオーム・環境
567
+ │ ├── scientific-microbiome-metagenomics/
568
+ │ └── scientific-environmental-ecology/
569
+
570
+ │── [W] システム生物学
571
+ │ └── scientific-systems-biology/
572
+
573
+ │── [X] 疫学・公衆衛生
574
+ │ └── scientific-epidemiology-public-health/
575
+
576
+ │── [Y] 集団遺伝学
577
+ │ └── scientific-population-genetics/
578
+
579
+ └── [Z] 科学テキストマイニング
580
+ └── scientific-text-mining-nlp/
462
581
  ```
463
582
 
464
583
  > 注: 実際のファイルシステム上ではすべてのスキルディレクトリは `.github/skills/` 直下にフラットに配置されています。上記の中区分グルーピングは論理的な分類です。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nahisaho/satori",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "SATORI — Agent Skills for Science. GitHub Copilot Agent Skills collection for scientific data analysis.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -0,0 +1,295 @@
1
+ ---
2
+ name: scientific-environmental-ecology
3
+ description: |
4
+ 環境科学・生態学解析スキル。種分布モデリング(SDM / MaxEnt)・
5
+ 生物多様性指標(α/β/γ 多様性)・群集構造解析(NMDS/CCA/RDA)・
6
+ 生態学的ニッチモデリング・保全優先順位評価・OBIS/GBIF データ統合パイプライン。
7
+ ---
8
+
9
+ # Scientific Environmental Ecology
10
+
11
+ 環境科学・生態学に特化した解析パイプラインを提供する。
12
+ 種分布モデリング、生物多様性評価、群集構造解析、
13
+ 保全優先順位付け、海洋/陸域の生態系データ統合を扱う。
14
+
15
+ ## When to Use
16
+
17
+ - 種分布モデル(SDM)を構築して生息適地を推定するとき
18
+ - 群集の生物多様性指標を算出・比較するとき
19
+ - 群集構造の環境要因への応答を解析するとき(CCA / RDA)
20
+ - GBIF / OBIS から出現データを取得して空間解析を行うとき
21
+ - 保全優先区域の評価・ランキングを行うとき
22
+
23
+ ---
24
+
25
+ ## Quick Start
26
+
27
+ ## 1. 種分布モデリング(SDM)
28
+
29
+ ```python
30
+ import numpy as np
31
+ import pandas as pd
32
+ from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier
33
+ from sklearn.model_selection import cross_val_score
34
+ from sklearn.metrics import roc_auc_score
35
+
36
+ def species_distribution_model(occurrences, background, env_layers,
37
+ method="maxent", n_folds=5):
38
+ """
39
+ 種分布モデリング(SDM)パイプライン。
40
+
41
+ method:
42
+ - "maxent": MaxEnt — 最大エントロピーモデル(在データのみ可)
43
+ - "rf": Random Forest — 在/不在データ
44
+ - "gbm": Gradient Boosting — アンサンブル学習
45
+ - "ensemble": 複数モデルの加重平均
46
+
47
+ MaxEnt 原理:
48
+ P(x) を環境変数 x の関数として推定。
49
+ 情報エントロピーを最大化する分布を選択:
50
+ H(P) = -Σ P(x) log P(x) → maximize
51
+ 制約: E_P[fⱼ] = E_data[fⱼ] (特徴量の期待値一致)
52
+
53
+ 入力:
54
+ - occurrences: 種の出現座標 (lon, lat)
55
+ - background: 疑似不在点 (lon, lat)
56
+ - env_layers: 環境変数ラスタ(Bio1-Bio19 等)
57
+ """
58
+ # 環境変数を出現/不在点で抽出
59
+ X_pres = extract_env_values(occurrences, env_layers)
60
+ X_bg = extract_env_values(background, env_layers)
61
+ X = np.vstack([X_pres, X_bg])
62
+ y = np.concatenate([np.ones(len(X_pres)), np.zeros(len(X_bg))])
63
+
64
+ if method == "maxent":
65
+ from elapid import MaxentModel
66
+ model = MaxentModel()
67
+ model.fit(X_pres, X_bg)
68
+ pred = model.predict(env_layers)
69
+
70
+ elif method == "rf":
71
+ model = RandomForestClassifier(n_estimators=500, random_state=42)
72
+ model.fit(X, y)
73
+ auc_scores = cross_val_score(model, X, y, cv=n_folds, scoring="roc_auc")
74
+ print(f" RF AUC: {np.mean(auc_scores):.3f} ± {np.std(auc_scores):.3f}")
75
+ pred = model.predict_proba(env_layers.reshape(-1, env_layers.shape[-1]))[:, 1]
76
+
77
+ elif method == "gbm":
78
+ model = GradientBoostingClassifier(n_estimators=300, max_depth=5,
79
+ random_state=42)
80
+ model.fit(X, y)
81
+ auc_scores = cross_val_score(model, X, y, cv=n_folds, scoring="roc_auc")
82
+ print(f" GBM AUC: {np.mean(auc_scores):.3f} ± {np.std(auc_scores):.3f}")
83
+
84
+ return model, pred
85
+
86
+
87
+ def extract_env_values(coords, env_layers):
88
+ """座標から環境変数値を抽出する。"""
89
+ import rasterio
90
+ values = []
91
+ for lon, lat in coords:
92
+ row, col = env_layers.index(lon, lat)
93
+ values.append(env_layers.read()[:, row, col])
94
+ return np.array(values)
95
+ ```
96
+
97
+ ## 2. 生物多様性指標
98
+
99
+ ```python
100
+ from scipy.stats import entropy
101
+
102
+ def biodiversity_indices(community_matrix, metadata=None):
103
+ """
104
+ 群集ベースの生物多様性指標算出。
105
+
106
+ α 多様性(サイト内):
107
+ - Species richness: S = 種数
108
+ - Shannon: H' = -Σ pᵢ ln(pᵢ)
109
+ - Simpson: D = 1 - Σ pᵢ²
110
+ - Pielou's Evenness: J = H' / ln(S)
111
+ - Chao1: S_est = S_obs + f₁²/(2·f₂)
112
+
113
+ β 多様性(サイト間):
114
+ - Bray-Curtis dissimilarity
115
+ - Jaccard distance
116
+ - Sørensen index
117
+ - Whittaker's β: γ/ᾱ - 1
118
+
119
+ γ 多様性(景観全体):
120
+ - 全サイトの合計種数
121
+ """
122
+ results = []
123
+ for idx, row in community_matrix.iterrows():
124
+ counts = row[row > 0].values
125
+ freqs = counts / counts.sum()
126
+ S = len(counts)
127
+
128
+ H = entropy(freqs)
129
+ D_simpson = 1 - np.sum(freqs ** 2)
130
+ J = H / np.log(S) if S > 1 else 0
131
+
132
+ f1 = np.sum(counts == 1)
133
+ f2 = max(np.sum(counts == 2), 1)
134
+ chao1 = S + (f1 ** 2) / (2 * f2)
135
+
136
+ results.append({
137
+ "site": idx,
138
+ "richness": S,
139
+ "shannon": round(H, 4),
140
+ "simpson": round(D_simpson, 4),
141
+ "evenness": round(J, 4),
142
+ "chao1": round(chao1, 1),
143
+ "total_abundance": int(counts.sum()),
144
+ })
145
+
146
+ alpha_df = pd.DataFrame(results).set_index("site")
147
+
148
+ # γ 多様性
149
+ gamma = (community_matrix > 0).any(axis=0).sum()
150
+ mean_alpha = alpha_df["richness"].mean()
151
+ beta_whittaker = gamma / mean_alpha - 1
152
+
153
+ summary = {
154
+ "gamma_diversity": gamma,
155
+ "mean_alpha": round(mean_alpha, 2),
156
+ "beta_whittaker": round(beta_whittaker, 3),
157
+ }
158
+
159
+ print(f" Biodiversity: γ={gamma}, ᾱ={mean_alpha:.1f}, β_w={beta_whittaker:.3f}")
160
+ return alpha_df, summary
161
+ ```
162
+
163
+ ## 3. 群集構造解析(NMDS / CCA / RDA)
164
+
165
+ ```python
166
+ def community_ordination(community_matrix, env_df=None, method="nmds",
167
+ n_dims=2, distance="bray"):
168
+ """
169
+ 群集構造の序列化(Ordination)。
170
+
171
+ method:
172
+ - "nmds": Non-metric Multidimensional Scaling — ランクベース
173
+ - "cca": Canonical Correspondence Analysis — 制約付き(単峰型応答)
174
+ - "rda": Redundancy Analysis — 制約付き(線形応答)
175
+ - "dca": Detrended Correspondence Analysis — 勾配長評価
176
+
177
+ NMDS stress 基準:
178
+ - < 0.05: Excellent
179
+ - < 0.10: Good
180
+ - < 0.20: Acceptable
181
+ - > 0.20: Poor(次元数増加を検討)
182
+ """
183
+ from skbio.stats.ordination import pcoa
184
+ from skbio.diversity import beta_diversity
185
+ from scipy.spatial.distance import squareform
186
+
187
+ if method == "nmds":
188
+ from sklearn.manifold import MDS
189
+ dm = beta_diversity(distance, community_matrix.values,
190
+ community_matrix.index)
191
+ mds = MDS(n_components=n_dims, dissimilarity="precomputed",
192
+ metric=False, random_state=42, max_iter=500)
193
+ coords = mds.fit_transform(squareform(dm.data))
194
+ stress = mds.stress_
195
+ print(f" NMDS: stress={stress:.4f} ({n_dims}D)")
196
+ return coords, stress
197
+
198
+ elif method == "pcoa":
199
+ dm = beta_diversity(distance, community_matrix.values,
200
+ community_matrix.index)
201
+ result = pcoa(dm)
202
+ return result.samples.values[:, :n_dims], result.proportion_explained[:n_dims]
203
+ ```
204
+
205
+ ## 4. 種の保全優先順位評価
206
+
207
+ ```python
208
+ def conservation_priority(species_data, criteria_weights=None):
209
+ """
210
+ 保全優先順位の多基準評価。
211
+
212
+ IUCN レッドリスト基準:
213
+ - CR: Critically Endangered
214
+ - EN: Endangered
215
+ - VU: Vulnerable
216
+ - NT: Near Threatened
217
+
218
+ 評価基準:
219
+ 1. 絶滅リスク(IUCN カテゴリ)
220
+ 2. 系統的独自性(Evolutionary Distinctiveness)
221
+ 3. 生息地面積減少率
222
+ 4. Endemic 性(固有種かどうか)
223
+ 5. 生態系サービス寄与
224
+ """
225
+ if criteria_weights is None:
226
+ criteria_weights = {
227
+ "iucn_score": 0.30,
228
+ "evolutionary_distinctiveness": 0.20,
229
+ "habitat_loss_rate": 0.20,
230
+ "endemism": 0.15,
231
+ "ecosystem_service": 0.15,
232
+ }
233
+
234
+ iucn_mapping = {"CR": 5, "EN": 4, "VU": 3, "NT": 2, "LC": 1, "DD": 0}
235
+ species_data["iucn_score"] = species_data["iucn_category"].map(iucn_mapping)
236
+
237
+ # 正規化
238
+ for col in criteria_weights:
239
+ if col in species_data.columns:
240
+ min_v = species_data[col].min()
241
+ max_v = species_data[col].max()
242
+ if max_v > min_v:
243
+ species_data[f"{col}_norm"] = (species_data[col] - min_v) / (max_v - min_v)
244
+
245
+ # Composite score
246
+ species_data["priority_score"] = sum(
247
+ w * species_data.get(f"{col}_norm", 0) for col, w in criteria_weights.items()
248
+ )
249
+ species_data = species_data.sort_values("priority_score", ascending=False)
250
+
251
+ print(f" Conservation: {len(species_data)} species ranked")
252
+ return species_data
253
+ ```
254
+
255
+ ## References
256
+
257
+ ### Output Files
258
+
259
+ | ファイル | 形式 |
260
+ |---|---|
261
+ | `results/sdm_predictions.tif` | GeoTIFF |
262
+ | `results/biodiversity_indices.csv` | CSV |
263
+ | `results/ordination_scores.csv` | CSV |
264
+ | `results/conservation_priority.csv` | CSV |
265
+ | `figures/sdm_map.png` | PNG |
266
+ | `figures/nmds_plot.png` | PNG |
267
+ | `figures/diversity_comparison.png` | PNG |
268
+
269
+ ### 利用可能ツール
270
+
271
+ > [ToolUniverse](https://github.com/mims-harvard/ToolUniverse) SMCP 経由で利用可能な外部ツール。
272
+
273
+ | カテゴリ | 主要ツール | 用途 |
274
+ |---|---|---|
275
+ | OBIS | `OBIS_search_taxa` | 海洋生物分類検索 |
276
+ | OBIS | `OBIS_search_occurrences` | 海洋生物出現データ |
277
+ | GBIF | `GBIF_search_species` | 種名検索 |
278
+ | GBIF | `GBIF_search_occurrences` | 出現記録検索 |
279
+ | Paleobiology | `Paleobiology_get_fossils` | 化石記録データ |
280
+ | OLS | `ols_search_terms` | 生態学オントロジー検索 |
281
+ | PubMed | `PubMed_search_articles` | 生態学文献検索 |
282
+
283
+ ### 参照スキル
284
+
285
+ | スキル | 連携内容 |
286
+ |---|---|
287
+ | [scientific-statistical-testing](../scientific-statistical-testing/SKILL.md) | 多様性有意差検定 |
288
+ | [scientific-pca-tsne](../scientific-pca-tsne/SKILL.md) | 次元削減・序列化 |
289
+ | [scientific-ml-classification](../scientific-ml-classification/SKILL.md) | SDM モデル(RF/GBM) |
290
+ | [scientific-image-analysis](../scientific-image-analysis/SKILL.md) | リモートセンシング画像解析 |
291
+ | [scientific-time-series](../scientific-time-series/SKILL.md) | 生態系時系列トレンド |
292
+
293
+ #### 依存パッケージ
294
+
295
+ - scikit-bio, rasterio, geopandas, elapid, shapely, pygbif