$npx -y skills add LeonChaoX/qinyan-academic-skills --skill deeptoolsNGS analysis toolkit. BAM to bigWig conversion, QC (correlation, PCA, fingerprints), heatmaps/profiles (TSS, peaks), for ChIP-seq, RNA-seq, ATAC-seq visualization.
| 1 | # deepTools: NGS Data Analysis Toolkit |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | deepTools 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. |
| 6 | |
| 7 | **Core capabilities:** |
| 8 | - Convert BAM alignments to normalized coverage tracks (bigWig/bedGraph) |
| 9 | - Quality control assessment (fingerprint, correlation, coverage) |
| 10 | - Sample comparison and correlation analysis |
| 11 | - Heatmap and profile plot generation around genomic features |
| 12 | - Enrichment analysis and peak region visualization |
| 13 | |
| 14 | ## When to Use This Skill |
| 15 | |
| 16 | This skill should be used when: |
| 17 | |
| 18 | - **File conversion**: "Convert BAM to bigWig", "generate coverage tracks", "normalize ChIP-seq data" |
| 19 | - **Quality control**: "check ChIP quality", "compare replicates", "assess sequencing depth", "QC analysis" |
| 20 | - **Visualization**: "create heatmap around TSS", "plot ChIP signal", "visualize enrichment", "generate profile plot" |
| 21 | - **Sample comparison**: "compare treatment vs control", "correlate samples", "PCA analysis" |
| 22 | - **Analysis workflows**: "analyze ChIP-seq data", "RNA-seq coverage", "ATAC-seq analysis", "complete workflow" |
| 23 | - **Working with specific file types**: BAM files, bigWig files, BED region files in genomics context |
| 24 | |
| 25 | ## Quick Start |
| 26 | |
| 27 | For users new to deepTools, start with file validation and common workflows: |
| 28 | |
| 29 | ### 1. Validate Input Files |
| 30 | |
| 31 | Before running any analysis, validate BAM, bigWig, and BED files using the validation script: |
| 32 | |
| 33 | ```bash |
| 34 | python scripts/validate_files.py --bam sample1.bam sample2.bam --bed regions.bed |
| 35 | ``` |
| 36 | |
| 37 | This checks file existence, BAM indices, and format correctness. |
| 38 | |
| 39 | ### 2. Generate Workflow Template |
| 40 | |
| 41 | For standard analyses, use the workflow generator to create customized scripts: |
| 42 | |
| 43 | ```bash |
| 44 | # List available workflows |
| 45 | python scripts/workflow_generator.py --list |
| 46 | |
| 47 | # Generate ChIP-seq QC workflow |
| 48 | python scripts/workflow_generator.py chipseq_qc -o qc_workflow.sh \ |
| 49 | --input-bam Input.bam --chip-bams "ChIP1.bam ChIP2.bam" \ |
| 50 | --genome-size 2913022398 |
| 51 | |
| 52 | # Make executable and run |
| 53 | chmod +x qc_workflow.sh |
| 54 | ./qc_workflow.sh |
| 55 | ``` |
| 56 | |
| 57 | ### 3. Most Common Operations |
| 58 | |
| 59 | See `assets/quick_reference.md` for frequently used commands and parameters. |
| 60 | |
| 61 | ## Installation |
| 62 | |
| 63 | ```bash |
| 64 | uv pip install deeptools |
| 65 | ``` |
| 66 | |
| 67 | ## Core Workflows |
| 68 | |
| 69 | deepTools workflows typically follow this pattern: **QC → Normalization → Comparison/Visualization** |
| 70 | |
| 71 | ### ChIP-seq Quality Control Workflow |
| 72 | |
| 73 | When users request ChIP-seq QC or quality assessment: |
| 74 | |
| 75 | 1. **Generate workflow script** using `scripts/workflow_generator.py chipseq_qc` |
| 76 | 2. **Key QC steps**: |
| 77 | - Sample correlation (multiBamSummary + plotCorrelation) |
| 78 | - PCA analysis (plotPCA) |
| 79 | - Coverage assessment (plotCoverage) |
| 80 | - Fragment size validation (bamPEFragmentSize) |
| 81 | - ChIP enrichment strength (plotFingerprint) |
| 82 | |
| 83 | **Interpreting results:** |
| 84 | - **Correlation**: Replicates should cluster together with high correlation (>0.9) |
| 85 | - **Fingerprint**: Strong ChIP shows steep rise; flat diagonal indicates poor enrichment |
| 86 | - **Coverage**: Assess if sequencing depth is adequate for analysis |
| 87 | |
| 88 | Full workflow details in `references/workflows.md` → "ChIP-seq Quality Control Workflow" |
| 89 | |
| 90 | ### ChIP-seq Complete Analysis Workflow |
| 91 | |
| 92 | For full ChIP-seq analysis from BAM to visualizations: |
| 93 | |
| 94 | 1. **Generate coverage tracks** with normalization (bamCoverage) |
| 95 | 2. **Create comparison tracks** (bamCompare for log2 ratio) |
| 96 | 3. **Compute signal matrices** around features (computeMatrix) |
| 97 | 4. **Generate visualizations** (plotHeatmap, plotProfile) |
| 98 | 5. **Enrichment analysis** at peaks (plotEnrichment) |
| 99 | |
| 100 | Use `scripts/workflow_generator.py chipseq_analysis` to generate template. |
| 101 | |
| 102 | Complete command sequences in `references/workflows.md` → "ChIP-seq Analysis Workflow" |
| 103 | |
| 104 | ### RNA-seq Coverage Workflow |
| 105 | |
| 106 | For strand-specific RNA-seq coverage tracks: |
| 107 | |
| 108 | Use bamCoverage with `--filterRNAstrand` to separate forward and reverse strands. |
| 109 | |
| 110 | **Important:** NEVER use `--extendReads` for RNA-seq (would extend over splice junctions). |
| 111 | |
| 112 | Use normalization: CPM for fixed bins, RPKM for gene-level analysis. |
| 113 | |
| 114 | Template available: `scripts/workflow_generator.py rnaseq_coverage` |
| 115 | |
| 116 | Details in `references/workflows.md` → "RNA-seq Coverage Workflow" |
| 117 | |
| 118 | ### ATAC-seq Analysis Workflow |
| 119 | |
| 120 | ATAC-seq requires Tn5 offset correction: |
| 121 | |
| 122 | 1. **Shift reads** using alignmentSieve with `--ATACshift` |
| 123 | 2. **Generate coverage** with bamCoverage |
| 124 | 3. **Analyze fragment sizes** (expect nucleosome ladder pattern) |
| 125 | 4. **Visualize at peaks** if available |
| 126 | |
| 127 | Template: `scripts/workflow_generator.py atacseq` |
| 128 | |
| 129 | Full workflow in `references/workflows.md` → "ATAC-seq Workflow" |
| 130 | |
| 131 | ## Tool Categor |