{"id":"deeptools","name":"deeptools","summary":"NGS解析ツールキット。BAMからbigWigへの変換、QC(相関、PCA、指紋)、ヒートマップ/プロファイル(TSS、ピーク)、ChIP-seq、RNA-seq、ATAC-seqの可視化。","body":"# deepTools: NGS Data Analysis Toolkit\n\n## Overview\n\ndeepTools is a comprehensive suite of Python command-line tools designed for processing and analyzing high-throughput sequencing data. Use deepTools to perform quality control, normalize data, compare samples, and generate publication-quality visualizations for ChIP-seq, RNA-seq, ATAC-seq, MNase-seq, and other NGS experiments.\n\n**Core capabilities:**\n- Convert BAM alignments to normalized coverage tracks (bigWig/bedGraph)\n- Quality control assessment (fingerprint, correlation, coverage)\n- Sample comparison and correlation analysis\n- Heatmap and profile plot generation around genomic features\n- Enrichment analysis and peak region visualization\n\n## When to Use This Skill\n\nThis skill should be used when:\n\n- **File conversion**: \"Convert BAM to bigWig\", \"generate coverage tracks\", \"normalize ChIP-seq data\"\n- **Quality control**: \"check ChIP quality\", \"compare replicates\", \"assess sequencing depth\", \"QC analysis\"\n- **Visualization**: \"create heatmap around TSS\", \"plot ChIP signal\", \"visualize enrichment\", \"generate profile plot\"\n- **Sample comparison**: \"compare treatment vs control\", \"correlate samples\", \"PCA analysis\"\n- **Analysis workflows**: \"analyze ChIP-seq data\", \"RNA-seq coverage\", \"ATAC-seq analysis\", \"complete workflow\"\n- **Working with specific file types**: BAM files, bigWig files, BED region files in genomics context\n\n## Quick Start\n\nFor users new to deepTools, start with file validation and common workflows:\n\n### 1. Validate Input Files\n\nBefore running any analysis, validate BAM, bigWig, and BED files using the validation script:\n\n```bash\npython scripts/validate_files.py --bam sample1.bam sample2.bam --bed regions.bed\n```\n\nThis checks file existence, BAM indices, and format correctness.\n\n### 2. Generate Workflow Template\n\nFor standard analyses, use the workflow generator to create customized scripts:\n\n```bash\n# List available workflows\npython scripts/workflow_generator.py --list\n\n# Generate ChIP-seq QC workflow\npython scripts/workflow_generator.py chipseq_qc -o qc_workflow.sh \\\n    --input-bam Input.bam --chip-bams \"ChIP1.bam ChIP2.bam\" \\\n    --genome-size 2913022398\n\n# Make executable and run\nchmod +x qc_workflow.sh\n./qc_workflow.sh\n```\n\n### 3. Most Common Operations\n\nSee `assets/quick_reference.md` for frequently used commands and parameters.\n\n## Installation\n\n```bash\nuv pip install deepTools==3.5.6\n```\n\nUpstream recommends conda/bioconda for full dependency resolution, especially on shared HPC systems:\n\n```bash\nconda install -c conda-forge -c bioconda deeptools\n```\n\nOn Apple Silicon, upstream documents either the PyPI route above or an `osx-64` conda environment when native conda packages are unavailable.\n\n## Core Workflows and Tool Categories\n\nComplete command sequences for ChIP-seq QC, full ChIP-seq analysis, RNA-seq coverage, and\nATAC-seq analysis — plus the BAM/bigWig processing, quality control, and visualization\ntool categories — are in [references/core_workflows.md](references/core_workflows.md) and\n[references/workflows.md](references/workflows.md). Per-tool options are in\n[references/tools_reference.md](references/tools_reference.md).\n\n## Normalization Methods\n\nChoosing the correct normalization is critical for valid comparisons. Consult `references/normalization_methods.md` for comprehensive guidance.\n\n**Quick selection guide:**\n\n- **ChIP-seq coverage**: Use RPGC or CPM\n- **ChIP-seq comparison**: Use bamCompare with log2 and readCount\n- **RNA-seq bins**: Use CPM\n- **RNA-seq genes**: Use RPKM (accounts for gene length)\n- **ATAC-seq**: Use RPGC or CPM\n\n**Normalization methods:**\n- **RPGC**: 1× genome coverage (requires --effectiveGenomeSize)\n- **CPM**: Counts per million mapped reads\n- **RPKM**: Reads per kb per million (per-bin length and library-size scaling)\n- **BPM**: Bins per million, analogous to TPM-style scaling over binned signal\n- **None**: Raw counts (not recommended for comparisons)\n\nFull explanation: `references/normalization_methods.md`\n\n## Effective Genome Sizes\n\nRPGC normalization requires effective genome size. Common values:\n\n| Organism | Assembly | Size | Usage |\n|----------|----------|------|-------|\n| Human | GRCh38/hg38 | 2,913,022,398 | `--effectiveGenomeSize 2913022398` |\n| Human | T2T/CHM13CAT_v2 | 3,117,292,070 | `--effectiveGenomeSize 3117292070` |\n| Mouse | GRCm39/mm39 | 2,654,621,783 | `--effectiveGenomeSize 2654621783` |\n| Mouse | GRCm38/mm10 | 2,652,783,500 | `--effectiveGenomeSize 2652783500` |\n| Zebrafish | GRCz11 | 1,368,780,147 | `--effectiveGenomeSize 1368780147` |\n| *Drosophila* | dm6 | 142,573,017 | `--effectiveGenomeSize 142573017` |\n| *C. elegans* | ce10/ce11 | 100,286,401 | `--effectiveGenomeSize 100286401` |\n\nComplete table with read-length-specific values: `references/effective_genome_sizes.md`\n\n## Common Parameters Across Tools\n\nMany deepTools commands share these options:\n\n**Performance:**\n- `--numberOfProcessors, -p`: Enable parallel processing (always use available cores)\n- `max` / `max/2`: Supported values for `--numberOfProcessors`; useful under schedulers because recent deepTools releases detect CPU affinity more carefully\n- `--region`: Process specific regions for testing (e.g., `chr1:1-1000000`)\n\n**Read Filtering:**\n- `--ignoreDuplicates`: Remove PCR duplicates (recommended for most analyses)\n- `--minMappingQuality`: Filter by alignment quality (e.g., `--minMappingQuality 10`)\n- `--minFragmentLength` / `--maxFragmentLength`: Fragment length bounds\n- `--samFlagInclude` / `--samFlagExclude`: SAM flag filtering\n\n**Read Processing:**\n- `--extendReads`: Extend to fragment length (ChIP-seq: YES, RNA-seq: NO)\n- `--centerReads`: Center at fragment midpoint for sharper signals\n\n## Best Practices\n\n### File Validation\n**Always validate files first** using `scripts/validate_files.py` to check:\n- File existence and readability\n- BAM indices present (.bai files)\n- BED format correctness\n- File sizes reasonable\n\n### Analysis Strategy\n\n1. **Start with QC**: Run correlation, coverage, and fingerprint analysis before proceeding\n2. **Test on small regions**: Use `--region chr1:1-10000000` for parameter testing\n3. **Document commands**: Save full command lines for reproducibility\n4. **Use consistent normalization**: Apply same method across samples in comparisons\n5. **Verify genome assembly**: Ensure BAM and BED files use matching genome builds\n\n### ChIP-seq Specific\n\n- **Always extend reads** for ChIP-seq: `--extendReads 200`\n- **Remove duplicates**: Use `--ignoreDuplicates` in most cases\n- **Check enrichment first**: Run plotFingerprint before detailed analysis\n- **GC correction**: Only apply if significant bias detected; never use `--ignoreDuplicates` after GC correction\n\n### RNA-seq Specific\n\n- **Never extend reads** for RNA-seq (would span splice junctions)\n- **Strand-specific**: Use `--filterRNAstrand forward/reverse` for common dUTP-style stranded libraries; confirm library orientation before interpreting strand labels\n- **Normalization**: CPM for bins, RPKM for genes\n\n### ATAC-seq Specific\n\n- **Apply Tn5 correction**: Use alignmentSieve with `--ATACshift`\n- **Use only proper pairs for shifting**: `--ATACshift` is equivalent to `--shift 4 -5 5 -4` and filters to properly paired fragments\n- **Fragment filtering**: Set appropriate min/max fragment lengths\n- **Check nucleosome pattern**: Fragment size plot should show ladder pattern\n\n### Performance Optimization\n\n1. **Use multiple processors**: `--numberOfProcessors 8` (or available cores)\n2. **Increase bin size** for faster processing and smaller files\n3. **Process chromosomes separately** for memory-limited systems\n4. **Pre-filter BAM files** using alignmentSieve to create reusable filtered files\n5. **Use bigWig over bedGraph**: Compressed and faster to process\n\n## Troubleshooting\n\n### Common Issues\n\n**BAM index missing:**\n```bash\nsamtools index input.bam\n```\n\n**Out of memory:**\nProcess chromosomes individually using `--region`:\n```bash\nbamCoverage --bam input.bam -o chr1.bw --region chr1\n```\n\n**Slow processing:**\nIncrease `--numberOfProcessors` and/or increase `--binSize`\n\n**bigWig files too large:**\nIncrease bin size: `--binSize 50` or larger\n\n### Validation Errors\n\nRun validation script to identify issues:\n```bash\npython scripts/validate_files.py --bam *.bam --bed regions.bed\n```\n\nCommon errors and solutions explained in script output.\n\n## Reference Documentation\n\nThis skill includes comprehensive reference documentation:\n\n### references/tools_reference.md\nComplete documentation of all deepTools commands organized by category:\n- BAM and bigWig processing tools (9 tools)\n- Quality control tools (6 tools)\n- Visualization tools (3 tools)\n- Miscellaneous tools (3 tools, including `bigwigAverage`)\n\nEach tool includes:\n- Purpose and overview\n- Key parameters with explanations\n- Usage examples\n- Important notes and best practices\n\n**Use this reference when:** Users ask about specific tools, parameters, or detailed usage.\n\n### references/workflows.md\nComplete workflow examples for common analyses:\n- ChIP-seq quality control workflow\n- ChIP-seq complete analysis workflow\n- RNA-seq coverage workflow\n- ATAC-seq analysis workflow\n- Multi-sample comparison workflow\n- Peak region analysis workflow\n- Troubleshooting and performance tips\n\n**Use this reference when:** Users need complete analysis pipelines or workflow examples.\n\n### references/normalization_methods.md\nComprehensive guide to normalization methods:\n- Detailed explanation of each method (RPGC, CPM, RPKM, BPM, etc.)\n- When to use each method\n- Formulas and interpretation\n- Selection guide by experiment type\n- Common pitfalls and solutions\n- Quick reference table\n\n**Use this reference when:** Users ask about normalization, comparing samples, or which method to use.\n\n### references/effective_genome_sizes.md\nEffective genome size values and usage:\n- Common organism values (human, mouse, fly, worm, zebrafish)\n- Read-length-specific values\n- Calculation methods\n- When and how to use in commands\n- Custom genome calculation instructions\n\n**Use this reference when:** Users need genome size for RPGC normalization or GC bias correction.\n\n## Helper Scripts\n\n### scripts/validate_files.py\n\nValidates BAM, bigWig, and BED files for deepTools analysis. Checks file existence, indices, and format.\n\n**Usage:**\n```bash\npython scripts/validate_files.py --bam sample1.bam sample2.bam \\\n    --bed peaks.bed --bigwig signal.bw\n```\n\n**When to use:** Before starting any analysis, or when troubleshooting errors.\n\n### scripts/workflow_generator.py\n\nGenerates customizable bash script templates for common deepTools workflows.\n\n**Available workflows:**\n- `chipseq_qc`: ChIP-seq quality control\n- `chipseq_analysis`: Complete ChIP-seq analysis\n- `rnaseq_coverage`: Strand-specific RNA-seq coverage\n- `atacseq`: ATAC-seq with Tn5 correction\n\n**Usage:**\n```bash\n# List workflows\npython scripts/workflow_generator.py --list\n\n# Generate workflow\npython scripts/workflow_generator.py chipseq_qc -o qc.sh \\\n    --input-bam Input.bam --chip-bams \"ChIP1.bam ChIP2.bam\" \\\n    --genome-size 2913022398 --threads 8\n\n# Run generated workflow\nchmod +x qc.sh\n./qc.sh\n```\n\n**When to use:** Users request standard workflows or need template scripts to customize.\n\n## Assets\n\n### assets/quick_reference.md\n\nQuick reference card with most common commands, effective genome sizes, and typical workflow pattern.\n\n**When to use:** Users need quick command examples without detailed documentation.\n\n## Handling User Requests\n\n### For New Users\n\n1. Start with installation verification\n2. Validate input files using `scripts/validate_files.py`\n3. Recommend appropriate workflow based on experiment type\n4. Generate workflow template using `scripts/workflow_generator.py`\n5. Guide through customization and execution\n\n### For Experienced Users\n\n1. Provide specific tool commands for requested operations\n2. Reference appropriate sections in `references/tools_reference.md`\n3. Suggest optimizations and best practices\n4. Offer troubleshooting for issues\n\n### For Specific Tasks\n\n**\"Convert BAM to bigWig\":**\n- Use bamCoverage with appropriate normalization\n- Recommend RPGC or CPM based on use case\n- Provide effective genome size for organism\n- Suggest relevant parameters (extendReads, ignoreDuplicates, binSize)\n\n**\"Check ChIP quality\":**\n- Run full QC workflow or use plotFingerprint specifically\n- Explain interpretation of results\n- Suggest follow-up actions based on results\n\n**\"Create heatmap\":**\n- Guide through two-step process: computeMatrix → plotHeatmap\n- Help choose appropriate matrix mode (reference-point vs scale-regions)\n- Suggest visualization parameters and clustering options\n\n**\"Compare samples\":**\n- Recommend bamCompare for two-sample comparison\n- Suggest multiBamSummary + plotCorrelation for multiple samples\n- Guide normalization method selection\n\n### Referencing Documentation\n\nWhen users need detailed information:\n- **Tool details**: Direct to specific sections in `references/tools_reference.md`\n- **Workflows**: Use `references/workflows.md` for complete analysis pipelines\n- **Normalization**: Consult `references/normalization_methods.md` for method selection\n- **Genome sizes**: Reference `references/effective_genome_sizes.md`\n\n## Example Interactions\n\n**User: \"I need to analyze my ChIP-seq data\"**\n\nResponse approach:\n1. Ask about files available (BAM files, peaks, genes)\n2. Validate files using validation script\n3. Generate chipseq_analysis workflow template\n4. Customize for their specific files and organism\n5. Explain each step as script runs\n\n**User: \"Which normalization should I use?\"**\n\nResponse approach:\n1. Ask about experiment type (ChIP-seq, RNA-seq, etc.)\n2. Ask about comparison goal (within-sample or between-sample)\n3. Consult `references/normalization_methods.md` selection guide\n4. Recommend appropriate method with justification\n5. Provide command example with parameters\n\n**User: \"Create a heatmap around TSS\"**\n\nResponse approach:\n1. Verify bigWig and gene BED files available\n2. Use computeMatrix with reference-point mode at TSS\n3. Generate plotHeatmap with appropriate visualization parameters\n4. Suggest clustering if dataset is large\n5. Offer profile plot as complement\n\n## Key Reminders\n\n- **File validation first**: Always validate input files before analysis\n- **Normalization matters**: Choose appropriate method for comparison type\n- **Extend reads carefully**: YES for ChIP-seq, NO for RNA-seq\n- **Use all cores**: Set `--numberOfProcessors` to available cores\n- **Test on regions**: Use `--region` for parameter testing\n- **Check QC first**: Run quality control before detailed analysis\n- **Document everything**: Save commands for reproducibility\n- **Reference documentation**: Use comprehensive references for detailed guidance","author":"@K-Dense-AI","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/deeptools","license":"MIT","category":"coding","lang":"en","tokens":3461,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"assets/quick_reference.md","size":1780,"sha256":"e89ef3fc6a32f68a24412df1b3270389ef36f59db2a8bb8ee44f4c03dd198ab4"},{"path":"references/core_workflows.md","size":4532,"sha256":"49d3e86625067c15637abed34bd0aaae4ab29aaf3c2777b8ce07208bd6274cef"},{"path":"references/effective_genome_sizes.md","size":3869,"sha256":"74a7dc7296d667207bfa8a20bb51ff3c380ddb0f32d8601a335aeb0f945e0053"},{"path":"references/normalization_methods.md","size":11835,"sha256":"808930712713c2c37a2258e61cd5e316ce2e3f87122f9ef019f622a741f4ac78"},{"path":"references/tools_reference.md","size":20494,"sha256":"d2824ac13d38c32cb82b165a453c5857b89d13329a953a98f40233a6ad35ef90"},{"path":"references/workflows.md","size":11214,"sha256":"f5a1a838e27ddd6ba92414e9696e60da7ff37a60909b3c5033dc2346eb4efd68"},{"path":"scripts/validate_files.py","size":6039,"sha256":"63c96703778ea475c6567dc4d8a22ebf1bdfa07e8255bf256d36a8b64c555069"},{"path":"scripts/workflow_generator.py","size":16868,"sha256":"22d851818ba2f6a2296a72f82ecec061715d37cad76fac3ea9d63e68caaea66a"}],"requires":{"mcp":[],"tools":["Read Write Edit Bash"]},"safety":{"flags":[{"code":"net.endpoints","kind":"exfiltration","excerpt":"deeptools.readthedocs.io","message":"bundled scripts reach 1 external host(s)","severity":"warn"}],"scannedAt":"2026-08-22","hasScripts":true,"networkEndpoints":["deeptools.readthedocs.io"]}}