Communitygithub.com

deepTools:NGS 資料分析工具包

NGS 分析工具包。可進行 BAM 到 bigWig 格式轉換、品管(相關性、PCA、指紋分析)、以及熱圖/輪廓(TSS、peak)繪製,適用於 ChIP-seq、RNA-seq、ATAC-seq 等定序資料的視覺化。

deepTools:NGS 資料分析工具包 是什麼?

deepTools 是一套整合性 Python 命令列工具,專為處理與分析高通量定序資料而設計。它能協助研究者進行資料品質管控、標準化、樣本比較,並產出足以發表的專業圖表,廣泛應用於 ChIP-seq、RNA-seq、ATAC-seq、MNase-seq 等 NGS 實驗。此技能支援在 Claude Code、Cursor、Codex 等 AI 代理環境中運作,透過明確的流程與腳本,引導使用者完成從檔案驗證、workflow 產生、到工具執行的完整步驟。功能涵蓋 BAM 轉 bigWig 格式轉換、品管(指紋分析、相關性、覆蓋度)、樣本比較與相關性分析、以及熱圖與輪廓繪製。技能內建完整的參考文檔(工具參考、workflow 範例、標準化方法、有效基因組大小),以及驗證與 workflow 產生輔助腳本,能有效協助開發者與生資使用者快速上手並解決常見問題。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/deeptools

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

deepTools:NGS 資料分析工具包 是做什麼的?

總覽

deepTools 是一套完整的 Python 命令列工具套件,專門用於處理與分析高通量定序資料。使用 deepTools 可執行品質管控、資料標準化、樣本比較,並為 ChIP-seq、RNA-seq、ATAC-seq、MNase-seq 及其他 NGS 實驗產出高品質的圖表。

核心功能:

  • 將 BAM 比對結果轉換為標準化覆蓋度軌跡(bigWig/bedGraph)
  • 品質管控評估(指紋分析、相關性、覆蓋度)
  • 樣本比較與相關性分析
  • 在基因體特徵周圍產生熱圖與輪廓圖
  • 富集分析與 peak 區域視覺化

使用時機

此技能應在以下情況使用:

  • 檔案轉換:「將 BAM 轉為 bigWig」、「產生覆蓋度軌跡」、「標準化 ChIP-seq 資料」
  • 品質管控:「檢查 ChIP 品質」、「比較重複樣本」、「評估定序深度」、「QC 分析」
  • 視覺化:「在 TSS 周圍建立熱圖」、「繪製 ChIP 訊號」、「視覺化富集」、「產生輪廓圖」
  • 樣本比較:「比較處理組與對照組」、「樣本相關性」、「PCA 分析」
  • 分析流程:「分析 ChIP-seq 資料」、「RNA-seq 覆蓋度」、「ATAC-seq 分析」、「完整流程」
  • 處理特定檔案類型:基因體學背景下的 BAM 檔案、bigWig 檔案、BED 區域檔案

快速入門

對於剛接觸 deepTools 的使用者,從檔案驗證與常見流程開始:

1. 驗證輸入檔案

在執行任何分析前,先使用驗證腳本驗證 BAM、bigWig 與 BED 檔案:

python scripts/validate_files.py --bam sample1.bam sample2.bam --bed regions.bed

這會檢查檔案是否存在、BAM 索引以及格式正確性。

2. 產生流程範本

對於標準分析,使用流程產生器來建立客製化腳本:

# 列出可用流程
python scripts/workflow_generator.py --list

# 產生 ChIP-seq QC 流程
python scripts/workflow_generator.py chipseq_qc -o qc_workflow.sh \
    --input-bam Input.bam --chip-bams "ChIP1.bam ChIP2.bam" \
    --genome-size 2913022398

# 設定為可執行並執行
chmod +x qc_workflow.sh
./qc_workflow.sh

3. 最常用操作

請參閱 assets/quick_reference.md 以取得常用命令與參數。

安裝

uv pip install deepTools==3.5.6

上游建議使用 conda/bioconda 以獲得完整的依賴解析,特別是在共享的 HPC 系統上:

conda install -c conda-forge -c bioconda deeptools

在 Apple Silicon 上,上游文件建議使用上述 PyPI 方式,或是在原生 conda 套件不可用時建立 osx-64 conda 環境。

核心流程與工具分類

完整的 ChIP-seq QC、完整 ChIP-seq 分析、RNA-seq 覆蓋度與 ATAC-seq 分析命令序列,以及 BAM/bigWig 處理、品質管控與視覺化工具分類,請參閱 references/core_workflows.md 與 references/workflows.md。各工具的選項請參閱 references/tools_reference.md。

標準化方法

選擇正確的標準化方法對於有效的比較至關重要。請查閱 references/normalization_methods.md 以獲得完整指南。

快速選擇指南:

  • ChIP-seq 覆蓋度:使用 RPGC 或 CPM
  • ChIP-seq 比較:使用 bamCompare 搭配 log2 與 readCount
  • RNA-seq bins:使用 CPM
  • RNA-seq 基因:使用 RPKM(考慮基因長度)
  • ATAC-seq:使用 RPGC 或 CPM

標準化方法:

  • RPGC:1× 基因體覆蓋度(需要 --effectiveGenomeSize)
  • CPM:每百萬比對 reads 的計數
  • RPKM:每千鹼基每百萬比對 reads(同時考慮 bin 長度與文庫大小)
  • BPM:每百萬 bins,類似於 TPM 風格的訊號標準化
  • None:原始計數(不建議用於比較)

完整說明:references/normalization_methods.md

有效基因體大小

RPGC 標準化需要有效基因體大小。常見數值:

生物體組裝大小使用方式
人類GRCh38/hg382,913,022,398--effectiveGenomeSize 2913022398
人類T2T/CHM13CAT_v23,117,292,070--effectiveGenomeSize 3117292070
小鼠GRCm39/mm392,654,621,783--effectiveGenomeSize 2654621783
小鼠GRCm38/mm102,652,783,500--effectiveGenomeSize 2652783500
斑馬魚GRCz111,368,780,147--effectiveGenomeSize 1368780147
果蠅dm6142,573,017--effectiveGenomeSize 142573017
線蟲ce10/ce11100,286,401--effectiveGenomeSize 100286401

包含 read 長度特定數值的完整表格:references/effective_genome_sizes.md

多種工具共用的參數

許多 deepTools 命令都共用這些選項:

效能:

  • --numberOfProcessors, -p:啟用平行處理(始終使用可用核心)
  • max / max/2:--numberOfProcessors 支援的值;由於近期 deepTools 版本更仔細地偵測 CPU 親和性,在排程器下很有用
  • --region:處理特定區域以進行測試(例如 chr1:1-1000000)

Read 過濾:

  • --ignoreDuplicates:移除 PCR 重複(大部分分析建議使用)
  • --minMappingQuality:依比對品質過濾(例如 --minMappingQuality 10)
  • --minFragmentLength / --maxFragmentLength:片段長度範圍
  • --samFlagInclude / --samFlagExclude:SAM flag 過濾

Read 處理:

  • --extendReads:延伸至片段長度(ChIP-seq:是,RNA-seq:否)
  • --centerReads:以片段中點為中心以獲得較銳利的訊號

最佳實務

檔案驗證

始終先驗證檔案使用 scripts/validate_files.py 檢查:

  • 檔案是否存在與可讀取
  • BAM 索引是否存在(.bai 檔案)
  • BED 格式是否正確
  • 檔案大小是否合理

分析策略

  1. 從 QC 開始:在繼續之前先執行相關性、覆蓋度與指紋分析
  2. 在小區域測試:使用 --region chr1:1-10000000 進行參數測試
  3. 記錄命令:儲存完整命令列以確保可重現性
  4. 使用一致的標準化:在比較中對所有樣本套用相同方法
  5. 驗證基因體組裝:確保 BAM 與 BED 檔案使用匹配的基因體版本

ChIP-seq 特定

  • 始終為 ChIP-seq 延伸 read:--extendReads 200
  • 移除重複:大多數情況下使用 --ignoreDuplicates
  • 先檢查富集:在進行詳細分析前先執行 plotFingerprint
  • GC 校正:僅在偵測到顯著偏差時套用;GC 校正後絕不使用 --ignoreDuplicates

RNA-seq 特定

  • 絕對不要為 RNA-seq 延伸 reads(會跨越剪接接合處)
  • 鏈特異性:對常見的 dUTP 類型鏈特異性文庫使用 --filterRNAstrand forward/reverse;在解釋鏈標籤前先確認文庫方向
  • 標準化:bins 使用 CPM,基因使用 RPKM

ATAC-seq 特定

  • 套用 Tn5 校正:使用 alignmentSieve 並搭配 --ATACshift
  • 僅對移位使用 proper pairs:--ATACshift 等同於 --shift 4 -5 5 -4,且會過濾為 properly paired 片段
  • 片段過濾:設定適當的最小/最大片段長度
  • 檢查核小體模式:片段大小圖應呈現階梯狀模式

效能最佳化

  1. 使用多個處理器:--numberOfProcessors 8(或可用核心數)
  2. 增加 bin 大小以加速處理並減少檔案大小
  3. 分別處理染色體以適應記憶體受限的系統
  4. 使用 alignmentSieve 預先過濾 BAM 檔案以建立可重複使用的過濾後檔案
  5. 使用 bigWig 而非 bedGraph:壓縮且處理更快

疑難排解

常見問題

缺少 BAM 索引:

samtools index input.bam

記憶體不足: 使用 --region 分別處理染色體:

bamCoverage --bam input.bam -o chr1.bw --region chr1

處理速度慢: 增加 --numberOfProcessors 及/或增加 --binSize

bigWig 檔案過大: 增加 bin 大小:--binSize 50 或更大

驗證錯誤

執行驗證腳本以識別問題:

python scripts/validate_files.py --bam *.bam --bed regions.bed

常見錯誤及其解決方案會顯示在腳本輸出中。

參考文件

此技能包含完整的參考文件:

references/tools_reference.md

所有 deepTools 命令的完整文件,按分類整理:

  • BAM 與 bigWig 處理工具(9 個工具)
  • 品質管控工具(6 個工具)
  • 視覺化工具(3 個工具)
  • 其他工具(3 個工具,包括 bigwigAverage)

每個工具包含:

  • 用途與概述
  • 關鍵參數及其說明
  • 使用範例
  • 重要注意事項與最佳實務

**使用時機:**使用者詢問特定工具、參數或詳細用法時。

references/workflows.md

常用分析的完整流程範例:

  • ChIP-seq 品質管控流程
  • ChIP-seq 完整分析流程
  • RNA-seq 覆蓋度流程
  • ATAC-seq 分析流程
  • 多樣本比較流程
  • Peak 區域分析流程
  • 疑難排解與效能提示

**使用時機:**使用者需要完整的分析管線或流程範例時。

references/normalization_methods.md

標準化方法完整指南:

  • 每種方法的詳細說明(RPGC、CPM、RPKM、BPM 等)
  • 每種方法的使用時機
  • 公式與解釋
  • 依實驗類型選擇指南
  • 常見陷阱與解決方案
  • 快速參考表格

**使用時機:**使用者詢問標準化、樣本比較或應使用哪種方法時。

references/effective_genome_sizes.md

有效基因體大小數值與使用方式:

  • 常見生物體數值(人類、小鼠、果蠅、線蟲、斑馬魚)
  • read 長度特定數值
  • 計算方法
  • 何時以及如何在命令中使用
  • 自訂基因體計算說明

**使用時機:**使用者需要 RPGC 標準化或 GC 偏差校正的基因體大小時。

輔助腳本

scripts/validate_files.py

驗證 BAM、bigWig 與 BED 檔案,供 deepTools 分析使用。檢查檔案是否存在、索引與格式。

用法:

python scripts/validate_files.py --bam sample1.bam sample2.bam \
    --bed peaks.bed --bigwig signal.bw

**使用時機:**在開始任何分析前,或是在疑難排解錯誤時。

scripts/workflow_generator.py

為常見的 deepTools 流程產生可自訂的 bash 腳本範本。

可用流程:

  • chipseq_qc:ChIP-seq 品質管控
  • chipseq_analysis:完整 ChIP-seq 分析
  • rnaseq_coverage:鏈特異性 RNA-seq 覆蓋度
  • atacseq:包含 Tn5 校正的 ATAC-seq

用法:

# 列出流程
python scripts/workflow_generator.py --list

# 產生流程
python scripts/workflow_generator.py chipseq_qc -o qc.sh \
    --input-bam Input.bam --chip-bams "ChIP1.bam ChIP2.bam" \
    --genome-size 2913022398 --threads 8

# 執行產生的流程
chmod +x qc.sh
./qc.sh

**使用時機:**使用者要求標準流程或需要可自訂的範本腳本時。

資產

assets/quick_reference.md

包含最常用命令、有效基因體大小與典型流程模式的快速參考卡。

**使用時機:**使用者需要快速命令範例,而不需要詳細文件時。

處理使用者請求

針對新使用者

  1. 從驗證安裝開始
  2. 使用 scripts/validate_files.py 驗證輸入檔案
  3. 根據實驗類型推薦適當的流程
  4. 使用 scripts/workflow_generator.py 產生流程範本
  5. 引導進行自訂化與執行

針對有經驗的使用者

  1. 根據要求的操作提供特定工具命令
  2. 引用 references/tools_reference.md 中的適當章節
  3. 建議最佳化與最佳實務
  4. 針對問題提供疑難排解

針對特定任務

「將 BAM 轉為 bigWig」:

  • 使用 bamCoverage 搭配適當的標準化
  • 根據使用案例推薦 RPGC 或 CPM
  • 提供生物體的有效基因體大小
  • 建議相關參數(extendReads、ignoreDuplicates、binSize)

「檢查 ChIP 品質」:

  • 執行完整的 QC 流程或專門使用 plotFingerprint
  • 說明結果的解釋
  • 根據結果建議後續行動

「建立熱圖」:

  • 引導完成兩步驟流程:computeMatrix → plotHeatmap
  • 協助選擇適當的矩陣模式(reference-point vs scale-regions)
  • 建議視覺化參數與聚類選項

「比較樣本」:

  • 對兩個樣本比較推薦 bamCompare
  • 對多個樣本推薦 multiBamSummary + plotCorrelation
  • 引導標準化方法的選擇

引用文件

當使用者需要詳細資訊時:

  • 工具細節:引導至 references/tools_reference.md 中的特定章節
  • 流程:使用 references/workflows.md 取得完整分析管線
  • 標準化:查閱 references/normalization_methods.md 以選擇方法
  • 基因體大小:參考 references/effective_genome_sizes.md

互動範例

使用者:「我需要分析我的 ChIP-seq 資料」

回應方式:

  1. 詢問可用的檔案(BAM 檔案、peaks、基因)
  2. 使用驗證腳本驗證檔案
  3. 產生 chipseq_analysis 流程範本
  4. 根據其特定檔案與生物體進行自訂化
  5. 在腳本執行時說明每個步驟

使用者:「我應該使用哪種標準化?」

回應方式:

  1. 詢問實驗類型(ChIP-seq、RNA-seq 等)
  2. 詢問比較目標(樣本內或樣本間)
  3. 查閱 references/normalization_methods.md 選擇指南
  4. 推薦適當的方法並提供理由
  5. 提供含參數的命令範例

使用者:「在 TSS 周圍建立熱圖」

回應方式:

  1. 驗證 bigWig 與基因註釋檔案
  2. 執行 computeMatrix 命令(reference-point 模式,TSS 為參考點)
  3. 使用 plotHeatmap 繪製熱圖
  4. 建議視覺化自訂化選項

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

adaptyv

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

alphagenome

Look up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.

analytical-method-validation

Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

arbor

Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g.

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

autoskill

Observe the user

benchling-integration

Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.

bgpt-paper-search

Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.

bids

>

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use biopython.

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g.

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

citation-management

Comprehensive citation management for academic research. Search OpenAlex, PubMed, and Google Scholar for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

clinical-decision-support

Prepare and validate research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts. Use for aggregate or synthetic research documentation and traceability—not patient care or live clinical operation.

clinical-reports

Create safety-bounded draft structures and run local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.

相關技能