@nahisaho/satori 0.16.0 → 0.17.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 として体系化した **124 個**のスキルを格納しています。Copilot がプロンプトの文脈に応じて適切なスキルを自動ロードし、各実験で確立した解析パターンを再利用します。74 のスキルは [ToolUniverse](https://github.com/mims-harvard/ToolUniverse) SMCP 経由で 1,200 以上の外部科学データベースツールとも連携可能です。
10
+ このディレクトリには、Exp-01〜13 で蓄積した科学データ解析技法を Agent Skills として体系化した **132 個**のスキルを格納しています。Copilot がプロンプトの文脈に応じて適切なスキルを自動ロードし、各実験で確立した解析パターンを再利用します。79 のスキルは [ToolUniverse](https://github.com/mims-harvard/ToolUniverse) SMCP 経由で 1,200 以上の外部科学データベースツールとも連携可能です。
11
11
 
12
12
  ### パイプラインフロー
13
13
 
@@ -208,7 +208,7 @@ symbolic-mathematics ──→ systems-biology ──→ admet-pharmacokinetics
208
208
 
209
209
  ### ToolUniverse MCP ツール連携
210
210
 
211
- 74 のスキル(HIGH 13 + MEDIUM 9 + Phase 3: 20 + Phase 4: 8 + Phase 5: 9 + Phase 6: 7 + Phase 7: 4 + Phase 8: 4)は、[ToolUniverse](https://github.com/mims-harvard/ToolUniverse) SMCP サーバー経由で 1,200 以上の外部科学ツールを利用可能です。各 SKILL.md 内の `### 利用可能ツール` セクションに対応ツールが記載されています。
211
+ 79 のスキル(HIGH 13 + MEDIUM 9 + Phase 3: 20 + Phase 4: 8 + Phase 5: 9 + Phase 6: 7 + Phase 7: 4 + Phase 8: 4 + Phase 9: 5)は、[ToolUniverse](https://github.com/mims-harvard/ToolUniverse) SMCP サーバー経由で 1,200 以上の外部科学ツールを利用可能です。各 SKILL.md 内の `### 利用可能ツール` セクションに対応ツールが記載されています。
212
212
 
213
213
  ```
214
214
  SATORI Skill (方法論・判断) ToolUniverse SMCP (データ取得・計算)
@@ -249,7 +249,11 @@ SATORI Skill (方法論・判断) ToolUniverse SMCP (データ取得・
249
249
  │ expression-comparison│───MCP──│ Expression Atlas │
250
250
  │ rrna-taxonomy │───MCP──│ MGnify metagenomics │
251
251
  │ marine-ecology │───MCP──│ OBIS, WoRMS, GBIF │
252
- ... (74 skills total) │ │ ... (1,200+ tools)
252
+ encode-screen │───MCP──│ ENCODE, SCREEN, ChIP-Atlas
253
+ │ human-cell-atlas │───MCP──│ HCA Data Portal, CELLxGENE │
254
+ │ geo-expression │───MCP──│ GEO (NCBI E-utilities) │
255
+ │ paleobiology │───MCP──│ Paleobiology Database (PBDB) │
256
+ │ ... (79 skills total) │ │ ... (1,200+ tools) │
253
257
  └──────────────────────┘ └─────────────────────────────┘
254
258
  ```
255
259
 
@@ -262,7 +266,7 @@ SATORI Skill (方法論・判断) ToolUniverse SMCP (データ取得・
262
266
  | C. 機械学習・モデリング | 3 | 回帰・分類・特徴量重要度 |
263
267
  | D. 実験計画・プロセス最適化 | 2 | DOE・応答曲面法・ベイズ最適化 |
264
268
  | E. 信号・スペクトル・時系列 | 4 | スペクトル解析・生体信号・時系列分解・神経電気生理学 |
265
- | F. 生命科学・オミクス | 18 | バイオインフォ・メタボロ・ゲノム配列・マルチオミクス・ネットワーク・プロテオミクス・トランスクリプトミクス・パスウェイ濃縮・代謝物 DB・HPA・ゲノム配列ツール・非コード RNA・オントロジー・EBI DB 群・Ensembl ゲノミクス・STRING/BioGRID PPI・発現比較・モデル生物 DB |
269
+ | F. 生命科学・オミクス | 20 | バイオインフォ・メタボロ・ゲノム配列・マルチオミクス・ネットワーク・プロテオミクス・トランスクリプトミクス・パスウェイ濃縮・代謝物 DB・HPA・ゲノム配列ツール・非コード RNA・オントロジー・EBI DB 群・Ensembl ゲノミクス・STRING/BioGRID PPI・発現比較・モデル生物 DB・GEO 発現プロファイル・寄生虫ゲノミクス |
266
270
  | G. 化学・材料・イメージング | 8 | ケモインフォ・材料特性評価・画像形態解析・計算材料科学・ChEMBL アッセイマイニング・MD シミュレーション・高度イメージング・深層化学 |
267
271
  | H. 臨床・疫学・メタ科学 | 5 | 生存解析・因果推論・メタアナリシス・臨床試験解析・臨床レポート |
268
272
  | I. Deep Research・文献検索 | 3 | 科学文献深層リサーチ・エビデンス階層評価・マルチ DB 文献検索・引用ネットワーク・プレプリント横断検索 |
@@ -276,10 +280,10 @@ SATORI Skill (方法論・判断) ToolUniverse SMCP (データ取得・
276
280
  | Q. 腫瘍学・疾患研究 | 5 | 精密腫瘍学 (CIViC/OncoKB)・疾患-遺伝子関連 (GWAS/Orphanet)・がんゲノミクス (COSMIC/DepMap)・希少疾患遺伝学・細胞株リソース |
277
281
  | R. 量子・先端計算 | 7 | 量子計算・GNN・ベイズ統計・説明可能 AI・深層学習・ヘルスケア AI・強化学習 |
278
282
  | S. 医用イメージング | 1 | DICOM/NIfTI・WSI 病理画像・Radiomics・MONAI |
279
- | T. シングルセル・空間・エピゲノミクス | 8 | scRNA-seq・Visium・MERFISH・CELLxGENE・RNA velocity・エピゲノミクス・レギュラトリーゲノミクス・摂動解析・scVI 統合・scATAC-seq/Signac・GPU シングルセル |
283
+ | T. シングルセル・空間・エピゲノミクス | 11 | scRNA-seq・Visium・MERFISH・CELLxGENE・RNA velocity・エピゲノミクス・レギュラトリーゲノミクス・摂動解析・scVI 統合・scATAC-seq/Signac・GPU シングルセル・ENCODE/SCREEN・Human Cell Atlas・高度 Squidpy 空間解析 |
280
284
  | U. 免疫・感染症 | 2 | 免疫情報学・MHC 結合予測・病原体ゲノミクス・AMR・IEDB |
281
- | V. マイクロバイオーム・環境 | 6 | 16S/メタゲノム・α/β 多様性・SDM・OBIS・GBIF・系統解析・rRNA 分類学・植物バイオロジー・海洋生態学 |
282
- | W. システム生物学 | 2 | SBML シミュレーション・FBA・GRN 推定・BioModels・代謝モデリング |
285
+ | V. マイクロバイオーム・環境 | 8 | 16S/メタゲノム・α/β 多様性・SDM・OBIS・GBIF・系統解析・rRNA 分類学・植物バイオロジー・海洋生態学・環境地理空間データ・古生物学 |
286
+ | W. システム生物学 | 3 | SBML シミュレーション・FBA・GRN 推定・BioModels・代謝モデリング・Metabolic Atlas |
283
287
  | X. 疫学・公衆衛生 | 3 | リスク指標 (RR/OR)・年齢標準化・空間疫学・WHO・CDC・公衆衛生データ・環境毒性学 |
284
288
  | Y. 集団遺伝学 | 1 | HWE・PCA/ADMIXTURE・Fst・選択スキャン・gnomAD・GWAS |
285
289
  | Z. 科学テキストマイニング | 2 | NER・関係抽出・知識グラフ・BERTopic・PubTator バイオアノテーション |
@@ -352,9 +356,9 @@ SATORI Skill (方法論・判断) ToolUniverse SMCP (データ取得・
352
356
  | 24 | [scientific-time-series](scientific-time-series/SKILL.md) | STL 分解・SARIMA 予測・変化点検出・FFT 周期解析・Granger 因果 | 汎用 |
353
357
  | 67 | [scientific-neuroscience-electrophysiology](scientific-neuroscience-electrophysiology/SKILL.md) | SpikeInterface/Kilosort4 スパイクソート・MNE EEG/ERP・NeuroKit2 HRV/EDA・脳機能結合 | 汎用 |
354
358
 
355
- ### F. 生命科学・オミクス(18 種)
359
+ ### F. 生命科学・オミクス(20 種)
356
360
 
357
- バイオ・オミクス・ネットワーク解析・オントロジー・EBI データベース・ゲノミクス・PPI・発現比較・モデル生物 DB を担うスキル群。
361
+ バイオ・オミクス・ネットワーク解析・オントロジー・EBI データベース・ゲノミクス・PPI・発現比較・モデル生物 DB・GEO 発現プロファイル・寄生虫ゲノミクスを担うスキル群。
358
362
 
359
363
  | # | Skill | 説明 | 参照 Exp |
360
364
  |---|---|---|---|
@@ -376,6 +380,8 @@ SATORI Skill (方法論・判断) ToolUniverse SMCP (データ取得・
376
380
  | 109 | [scientific-string-network-api](scientific-string-network-api/SKILL.md) | STRING v12/BioGRID/STITCH PPI ネットワーク・化学-タンパク質相互作用・トポロジー解析 | 汎用 |
377
381
  | 110 | [scientific-expression-comparison](scientific-expression-comparison/SKILL.md) | EBI Expression Atlas 発現比較・ベースライン/差次的発現・組織横断ヒートマップ | 汎用 |
378
382
  | 111 | [scientific-model-organism-db](scientific-model-organism-db/SKILL.md) | FlyBase/WormBase/ZFIN/RGD/MGI モデル生物データベース・種間オーソログ検索 | 汎用 |
383
+ | 127 | [scientific-geo-expression](scientific-geo-expression/SKILL.md) | GEO REST API 発現プロファイル・マトリクス取得・差次的発現解析 | 汎用 |
384
+ | 132 | [scientific-parasite-genomics](scientific-parasite-genomics/SKILL.md) | PlasmoDB/VectorBase/ToxoDB 寄生虫ゲノミクス・薬剤標的同定 | 汎用 |
379
385
 
380
386
  ### G. 化学・材料・イメージング(8 種)
381
387
 
@@ -519,9 +525,9 @@ DICOM・WSI 等の医用画像の解析・セグメンテーションを担う
519
525
  |---|---|---|---|
520
526
  | 56 | [scientific-medical-imaging](scientific-medical-imaging/SKILL.md) | DICOM/NIfTI 処理・MONAI U-Net/SwinUNETR・WSI パッチ抽出・Radiomics・3D 可視化 | 汎用 |
521
527
 
522
- ### T. シングルセル・空間・エピゲノミクス(8 種)
528
+ ### T. シングルセル・空間・エピゲノミクス(11 種)
523
529
 
524
- scRNA-seq・空間トランスクリプトミクス・エピゲノミクス・制御ゲノミクス・摂動解析・scVI 統合・scATAC-seq・GPU シングルセルの解析パイプラインを担うスキル群。
530
+ scRNA-seq・空間トランスクリプトミクス・エピゲノミクス・制御ゲノミクス・摂動解析・scVI 統合・scATAC-seq・GPU シングルセル・ENCODE/SCREEN・Human Cell Atlas・高度 Squidpy 空間解析の解析パイプラインを担うスキル群。
525
531
 
526
532
  | # | Skill | 説明 | 参照 Exp |
527
533
  |---|---|---|---|
@@ -533,6 +539,9 @@ scRNA-seq・空間トランスクリプトミクス・エピゲノミクス・
533
539
  | 116 | [scientific-scvi-integration](scientific-scvi-integration/SKILL.md) | scVI/scANVI/totalVI/SOLO シングルセル統合・半教師有りアノテーション・CITE-seq | 汎用 |
534
540
  | 123 | [scientific-scatac-signac](scientific-scatac-signac/SKILL.md) | Signac/SnapATAC2 scATAC-seq・モチーフ解析・Gene Activity・RNA+ATAC マルチモーダル統合 | 汎用 |
535
541
  | 124 | [scientific-gpu-singlecell](scientific-gpu-singlecell/SKILL.md) | rapids-singlecell/cuML/cuGraph GPU アクセラレーションシングルセル解析 | 汎用 |
542
+ | 125 | [scientific-encode-screen](scientific-encode-screen/SKILL.md) | ENCODE REST API 実験/ファイル検索・SCREEN cCRE・ChIP-Atlas エンリッチメント | 汎用 |
543
+ | 126 | [scientific-human-cell-atlas](scientific-human-cell-atlas/SKILL.md) | HCA Data Portal プロジェクト/ファイル・CELLxGENE Census 大規模アトラス | 汎用 |
544
+ | 131 | [scientific-squidpy-advanced](scientific-squidpy-advanced/SKILL.md) | Squidpy 空間自己相関・共起解析・近傍エンリッチメント・ニッチ同定 | 汎用 |
536
545
 
537
546
  ### U. 免疫・感染症(2 種)
538
547
 
@@ -543,9 +552,9 @@ scRNA-seq・空間トランスクリプトミクス・エピゲノミクス・
543
552
  | 59 | [scientific-immunoinformatics](scientific-immunoinformatics/SKILL.md) | MHC-I/II 結合予測・B 細胞エピトープ・TCR/BCR レパトア多様性・抗体 CDR 解析・ワクチン候補ランキング | 汎用 |
544
553
  | 60 | [scientific-infectious-disease](scientific-infectious-disease/SKILL.md) | 病原体 WGS QC・AMR 遺伝子検出・MLST 型別・系統解析 (IQ-TREE)・SIR/SEIR 数理モデル | 汎用 |
545
554
 
546
- ### V. マイクロバイオーム・環境(6 種)
555
+ ### V. マイクロバイオーム・環境(8 種)
547
556
 
548
- マイクロバイオーム解析・環境/生態系モデリング・系統解析・rRNA 分類学・植物バイオロジー・海洋生態学を担うスキル群。
557
+ マイクロバイオーム解析・環境/生態系モデリング・系統解析・rRNA 分類学・植物バイオロジー・海洋生態学・環境地理空間データ・古生物学を担うスキル群。
549
558
 
550
559
  | # | Skill | 説明 | 参照 Exp |
551
560
  |---|---|---|---|
@@ -555,8 +564,10 @@ scRNA-seq・空間トランスクリプトミクス・エピゲノミクス・
555
564
  | 118 | [scientific-rrna-taxonomy](scientific-rrna-taxonomy/SKILL.md) | SILVA/Greengenes2/MGnify rRNA リファレンス・分類学・コンセンサス分類 | 汎用 |
556
565
  | 121 | [scientific-plant-biology](scientific-plant-biology/SKILL.md) | Plant Reactome/TAIR/Ensembl Plants 植物代謝パスウェイ・種間比較 | 汎用 |
557
566
  | 122 | [scientific-marine-ecology](scientific-marine-ecology/SKILL.md) | OBIS/WoRMS/GBIF/FishBase 海洋生物多様性・分布解析 | 汎用 |
567
+ | 128 | [scientific-environmental-geodata](scientific-environmental-geodata/SKILL.md) | SoilGrids/WorldClim 環境地理空間データ・種分布モデル環境変数 | 汎用 |
568
+ | 129 | [scientific-paleobiology](scientific-paleobiology/SKILL.md) | PBDB 化石産出記録・分類群検索・地質年代多様性曲線 | 汎用 |
558
569
 
559
- ### W. システム生物学(2 種)
570
+ ### W. システム生物学(3 種)
560
571
 
561
572
  SBML 動的シミュレーション・代謝フラックス・遺伝子制御ネットワーク推定・代謝モデリングを担うスキル群。
562
573
 
@@ -564,6 +575,7 @@ SBML 動的シミュレーション・代謝フラックス・遺伝子制御ネ
564
575
  |---|---|---|---|
565
576
  | 63 | [scientific-systems-biology](scientific-systems-biology/SKILL.md) | SBML/RoadRunner シミュレーション・FBA/pFBA (cobrapy)・GRN 推定 (GENIE3)・Sobol 感度解析 | 汎用 |
566
577
  | 95 | [scientific-metabolic-modeling](scientific-metabolic-modeling/SKILL.md) | BiGG Models/BioModels ゲノムスケール代謝モデル・反応・代謝物検索 | 汎用 |
578
+ | 130 | [scientific-metabolic-atlas](scientific-metabolic-atlas/SKILL.md) | Metabolic Atlas/Human-GEM 代謝反応・代謝産物検索・ネットワーク解析 | 汎用 |
567
579
 
568
580
  ### X. 疫学・公衆衛生(3 種)
569
581
 
@@ -694,7 +706,9 @@ Skills は `.github/skills/` に配置されているため、Copilot が自動
694
706
  │ ├── scientific-ensembl-genomics/
695
707
  │ ├── scientific-string-network-api/
696
708
  │ ├── scientific-expression-comparison/
697
- └── scientific-model-organism-db/
709
+ ├── scientific-model-organism-db/
710
+ │ ├── scientific-geo-expression/
711
+ │ └── scientific-parasite-genomics/
698
712
 
699
713
  │── [G] 化学・材料・イメージング
700
714
  │ ├── scientific-cheminformatics/
@@ -783,7 +797,10 @@ Skills は `.github/skills/` に配置されているため、Copilot が自動
783
797
  │ ├── scientific-perturbation-analysis/
784
798
  │ ├── scientific-scvi-integration/
785
799
  │ ├── scientific-scatac-signac/
786
- └── scientific-gpu-singlecell/
800
+ ├── scientific-gpu-singlecell/
801
+ │ ├── scientific-encode-screen/
802
+ │ ├── scientific-human-cell-atlas/
803
+ │ └── scientific-squidpy-advanced/
787
804
 
788
805
  │── [U] 免疫・感染症
789
806
  │ ├── scientific-immunoinformatics/
@@ -795,11 +812,14 @@ Skills は `.github/skills/` に配置されているため、Copilot が自動
795
812
  │ ├── scientific-phylogenetics/
796
813
  │ ├── scientific-rrna-taxonomy/
797
814
  │ ├── scientific-plant-biology/
798
- └── scientific-marine-ecology/
815
+ ├── scientific-marine-ecology/
816
+ │ ├── scientific-environmental-geodata/
817
+ │ └── scientific-paleobiology/
799
818
 
800
819
  │── [W] システム生物学
801
820
  │ ├── scientific-systems-biology/
802
- └── scientific-metabolic-modeling/
821
+ ├── scientific-metabolic-modeling/
822
+ │ └── scientific-metabolic-atlas/
803
823
 
804
824
  │── [X] 疫学・公衆衛生
805
825
  │ ├── scientific-epidemiology-public-health/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nahisaho/satori",
3
- "version": "0.16.0",
3
+ "version": "0.17.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,315 @@
1
+ ---
2
+ name: scientific-encode-screen
3
+ description: |
4
+ ENCODE / ChIP-Atlas エピゲノムアトラススキル。ENCODE REST API
5
+ 実験・ファイル・バイオサンプル検索、SCREEN cis 制御エレメント、
6
+ ChIP-Atlas エンリッチメント解析、エピゲノムアノテーション統合。
7
+ ToolUniverse 連携: encode, chipatlas。
8
+ tu_tools:
9
+ - key: encode
10
+ name: ENCODE
11
+ description: ENCODE プロジェクトの実験・バイオサンプル・ファイルデータ検索
12
+ - key: chipatlas
13
+ name: ChIP-Atlas
14
+ description: ChIP-seq/ATAC-seq エンリッチメント解析・ピークブラウザ
15
+ ---
16
+
17
+ # Scientific ENCODE / SCREEN / ChIP-Atlas
18
+
19
+ ENCODE REST API / SCREEN / ChIP-Atlas を活用したエピゲノム
20
+ アトラス統合解析パイプラインを提供する。
21
+
22
+ ## When to Use
23
+
24
+ - ENCODE 実験データ (ChIP-seq/ATAC-seq/DNase) を検索するとき
25
+ - SCREEN cCRE (candidate cis-Regulatory Elements) を照会するとき
26
+ - ChIP-Atlas で転写因子結合・ヒストン修飾エンリッチメントを解析するとき
27
+ - バリアントの制御領域アノテーションを強化するとき
28
+ - エピゲノムデータを下流のクロマチン解析に統合するとき
29
+ - 組織/細胞型特異的エピゲノムプロファイルを比較するとき
30
+
31
+ ---
32
+
33
+ ## Quick Start
34
+
35
+ ## 1. ENCODE 実験検索・ファイル取得
36
+
37
+ ```python
38
+ import requests
39
+ import pandas as pd
40
+ import json
41
+
42
+ ENCODE_BASE = "https://www.encodeproject.org"
43
+ HEADERS = {"Accept": "application/json"}
44
+
45
+
46
+ def encode_search_experiments(assay_title=None, biosample=None,
47
+ target=None, organism="Homo sapiens",
48
+ limit=50):
49
+ """
50
+ ENCODE — 実験メタデータ検索。
51
+
52
+ Parameters:
53
+ assay_title: str — アッセイ種別 (例: "ChIP-seq", "ATAC-seq")
54
+ biosample: str — バイオサンプル (例: "K562")
55
+ target: str — ターゲット (例: "CTCF")
56
+ organism: str — 生物種
57
+ limit: int — 最大結果数
58
+ """
59
+ url = f"{ENCODE_BASE}/search/"
60
+ params = {
61
+ "type": "Experiment",
62
+ "status": "released",
63
+ "replicates.library.biosample.donor.organism.scientific_name": organism,
64
+ "limit": limit,
65
+ "format": "json",
66
+ }
67
+ if assay_title:
68
+ params["assay_title"] = assay_title
69
+ if biosample:
70
+ params["biosample_ontology.term_name"] = biosample
71
+ if target:
72
+ params["target.label"] = target
73
+
74
+ resp = requests.get(url, params=params, headers=HEADERS, timeout=30)
75
+ resp.raise_for_status()
76
+ data = resp.json()
77
+
78
+ results = []
79
+ for exp in data.get("@graph", []):
80
+ results.append({
81
+ "accession": exp.get("accession", ""),
82
+ "assay": exp.get("assay_title", ""),
83
+ "biosample": exp.get("biosample_summary", ""),
84
+ "target": exp.get("target", {}).get("label", ""),
85
+ "status": exp.get("status", ""),
86
+ "lab": exp.get("lab", {}).get("title", ""),
87
+ "date_released": exp.get("date_released", ""),
88
+ "files_count": len(exp.get("files", [])),
89
+ })
90
+
91
+ df = pd.DataFrame(results)
92
+ print(f"ENCODE: {len(df)} experiments found")
93
+ return df
94
+
95
+
96
+ def encode_get_files(experiment_accession, file_type="bigWig",
97
+ output_type="signal p-value", assembly="GRCh38"):
98
+ """
99
+ ENCODE — 実験ファイル URL 取得。
100
+
101
+ Parameters:
102
+ experiment_accession: str — 実験アクセッション
103
+ file_type: str — ファイルタイプ
104
+ output_type: str — 出力タイプ
105
+ assembly: str — アセンブリ
106
+ """
107
+ url = f"{ENCODE_BASE}/search/"
108
+ params = {
109
+ "type": "File",
110
+ "dataset": f"/experiments/{experiment_accession}/",
111
+ "file_format": file_type,
112
+ "output_type": output_type,
113
+ "assembly": assembly,
114
+ "status": "released",
115
+ "format": "json",
116
+ }
117
+ resp = requests.get(url, params=params, headers=HEADERS, timeout=30)
118
+ resp.raise_for_status()
119
+ data = resp.json()
120
+
121
+ files = []
122
+ for f in data.get("@graph", []):
123
+ files.append({
124
+ "accession": f.get("accession", ""),
125
+ "file_format": f.get("file_format", ""),
126
+ "output_type": f.get("output_type", ""),
127
+ "assembly": f.get("assembly", ""),
128
+ "href": ENCODE_BASE + f.get("href", ""),
129
+ "file_size": f.get("file_size", 0),
130
+ "biological_replicate": f.get("biological_replicates", []),
131
+ })
132
+
133
+ df = pd.DataFrame(files)
134
+ print(f"ENCODE files ({experiment_accession}): {len(df)} files")
135
+ return df
136
+ ```
137
+
138
+ ## 2. SCREEN cCRE 検索
139
+
140
+ ```python
141
+ SCREEN_BASE = "https://api.wenglab.org/screen/v2"
142
+
143
+
144
+ def screen_ccre_search(gene=None, region=None, biosample=None,
145
+ assembly="GRCh38"):
146
+ """
147
+ SCREEN — candidate cis-Regulatory Element 検索。
148
+
149
+ Parameters:
150
+ gene: str — 遺伝子名 (例: "TP53")
151
+ region: str — ゲノム領域 (例: "chr17:7668421-7687490")
152
+ biosample: str — バイオサンプル名
153
+ assembly: str — アセンブリ
154
+ """
155
+ url = f"{SCREEN_BASE}/search"
156
+ query = {"assembly": assembly}
157
+
158
+ if gene:
159
+ query["gene"] = gene
160
+ if region:
161
+ chrom, pos = region.split(":")
162
+ start, end = pos.split("-")
163
+ query["coordinates"] = {
164
+ "chromosome": chrom,
165
+ "start": int(start),
166
+ "end": int(end),
167
+ }
168
+
169
+ resp = requests.post(url, json=query, timeout=30)
170
+ resp.raise_for_status()
171
+ data = resp.json()
172
+
173
+ ccres = []
174
+ for cre in data.get("data", []):
175
+ ccres.append({
176
+ "accession": cre.get("accession", ""),
177
+ "chromosome": cre.get("chrom", ""),
178
+ "start": cre.get("start", 0),
179
+ "end": cre.get("end", 0),
180
+ "ccre_class": cre.get("group", ""),
181
+ "dnase_zscore": cre.get("dnase_zscore", None),
182
+ "h3k4me3_zscore": cre.get("h3k4me3_zscore", None),
183
+ "h3k27ac_zscore": cre.get("h3k27ac_zscore", None),
184
+ "ctcf_zscore": cre.get("ctcf_zscore", None),
185
+ })
186
+
187
+ df = pd.DataFrame(ccres)
188
+ print(f"SCREEN cCREs: {len(df)} elements")
189
+ return df
190
+ ```
191
+
192
+ ## 3. ChIP-Atlas エンリッチメント解析
193
+
194
+ ```python
195
+ CHIPATLAS_BASE = "https://chip-atlas.org/api"
196
+
197
+
198
+ def chipatlas_enrichment(gene_list, cell_type=None,
199
+ antigen_class="TFs and others",
200
+ genome="hg38", threshold=5):
201
+ """
202
+ ChIP-Atlas — 遺伝子リストのエンリッチメント解析。
203
+
204
+ Parameters:
205
+ gene_list: list[str] — 遺伝子リスト
206
+ cell_type: str — 細胞型 (None = 全細胞型)
207
+ antigen_class: str — 抗原クラス
208
+ genome: str — ゲノムアセンブリ
209
+ threshold: int — 距離閾値 (kb)
210
+ """
211
+ url = f"{CHIPATLAS_BASE}/enrichment"
212
+ payload = {
213
+ "genome": genome,
214
+ "geneList": gene_list,
215
+ "antigenClass": antigen_class,
216
+ "distanceThreshold": threshold * 1000,
217
+ }
218
+ if cell_type:
219
+ payload["cellType"] = cell_type
220
+
221
+ resp = requests.post(url, json=payload, timeout=60)
222
+ resp.raise_for_status()
223
+ data = resp.json()
224
+
225
+ results = []
226
+ for hit in data.get("results", []):
227
+ results.append({
228
+ "antigen": hit.get("antigen", ""),
229
+ "cell_type": hit.get("cellType", ""),
230
+ "experiment_id": hit.get("experimentId", ""),
231
+ "p_value": hit.get("pValue", 1.0),
232
+ "log_p": hit.get("logPValue", 0),
233
+ "overlap_genes": hit.get("overlapGenes", 0),
234
+ "total_peaks": hit.get("totalPeaks", 0),
235
+ })
236
+
237
+ df = pd.DataFrame(results)
238
+ df = df.sort_values("p_value")
239
+ print(f"ChIP-Atlas enrichment: {len(df)} TF/antigen hits")
240
+ return df
241
+ ```
242
+
243
+ ## 4. ENCODE + SCREEN + ChIP-Atlas 統合パイプライン
244
+
245
+ ```python
246
+ def encode_epigenome_pipeline(gene_name, biosample="K562",
247
+ output_dir="results"):
248
+ """
249
+ ENCODE/SCREEN/ChIP-Atlas エピゲノム統合パイプライン。
250
+
251
+ Parameters:
252
+ gene_name: str — 遺伝子名
253
+ biosample: str — バイオサンプル
254
+ output_dir: str — 出力ディレクトリ
255
+ """
256
+ from pathlib import Path
257
+ output_dir = Path(output_dir)
258
+ output_dir.mkdir(parents=True, exist_ok=True)
259
+
260
+ # 1) SCREEN cCRE
261
+ ccres = screen_ccre_search(gene=gene_name)
262
+ ccres.to_csv(output_dir / "screen_ccres.csv", index=False)
263
+
264
+ # 2) ENCODE 実験
265
+ experiments = encode_search_experiments(
266
+ assay_title="ChIP-seq",
267
+ biosample=biosample,
268
+ target="H3K27ac",
269
+ )
270
+ experiments.to_csv(output_dir / "encode_experiments.csv", index=False)
271
+
272
+ # 3) ChIP-Atlas エンリッチメント
273
+ enrichment = chipatlas_enrichment(
274
+ gene_list=[gene_name],
275
+ cell_type=biosample,
276
+ )
277
+ enrichment.to_csv(output_dir / "chipatlas_enrichment.csv", index=False)
278
+
279
+ print(f"ENCODE epigenome pipeline: {output_dir}")
280
+ return {
281
+ "ccres": ccres,
282
+ "experiments": experiments,
283
+ "enrichment": enrichment,
284
+ }
285
+ ```
286
+
287
+ ---
288
+
289
+ ## ToolUniverse 連携
290
+
291
+ | TU Key | ツール名 | 連携内容 |
292
+ |--------|---------|---------|
293
+ | `encode` | ENCODE | 実験・バイオサンプル・ファイル検索 |
294
+ | `chipatlas` | ChIP-Atlas | 転写因子エンリッチメント解析 |
295
+
296
+ ## パイプライン統合
297
+
298
+ ```
299
+ regulatory-genomics → encode-screen → epigenomics-chromatin
300
+ (RegulomeDB/ReMap) (ENCODE/SCREEN) (ChIP/ATAC bulk)
301
+ │ │ ↓
302
+ variant-interpretation ───┘ scatac-signac
303
+ (ACMG バリアント) │ (scATAC-seq)
304
+
305
+ gene-regulatory-network
306
+ (GRN 推定)
307
+ ```
308
+
309
+ ## パイプライン出力
310
+
311
+ | ファイル | 説明 | 次スキル |
312
+ |---------|------|---------|
313
+ | `results/screen_ccres.csv` | cCRE アノテーション | → variant-interpretation |
314
+ | `results/encode_experiments.csv` | ENCODE 実験メタデータ | → epigenomics-chromatin |
315
+ | `results/chipatlas_enrichment.csv` | TF エンリッチメント | → gene-regulatory-network |