NGS analysis toolkit. BAM to bigWig conversion, QC (correlation, PCA, fingerprints), heatmaps/profiles (TSS, peaks), for ChIP-seq, RNA-seq, ATAC-seq visualization.
SKILL.md
deepTools: NGS Data Analysis Toolkit
Overview
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.
Core capabilities:
Convert BAM alignments to normalized coverage tracks (bigWig/bedGraph)
Quality control assessment (fingerprint, correlation, coverage)
Sample comparison and correlation analysis
Heatmap and profile plot generation around genomic features
RPKM: Reads per kb per million (per-bin length and library-size scaling)
BPM: Bins per million, analogous to TPM-style scaling over binned signal
None: Raw counts (not recommended for comparisons)
Full explanation: references/normalization_methods.md
Effective Genome Sizes
RPGC normalization requires effective genome size. Common values:
Organism
Assembly
Size
Usage
Human
GRCh38/hg38
2,913,022,398
--effectiveGenomeSize 2913022398
Human
T2T/CHM13CAT_v2
3,117,292,070
--effectiveGenomeSize 3117292070
Mouse
GRCm39/mm39
2,654,621,783
--effectiveGenomeSize 2654621783
Mouse
GRCm38/mm10
2,652,783,500
--effectiveGenomeSize 2652783500
Zebrafish
GRCz11
1,368,780,147
--effectiveGenomeSize 1368780147
Drosophila
dm6
142,573,017
--effectiveGenomeSize 142573017
C. elegans
ce10/ce11
100,286,401
--effectiveGenomeSize 100286401
Complete table with read-length-specific values: references/effective_genome_sizes.md
Common Parameters Across Tools
Many deepTools commands share these options:
Performance:
--numberOfProcessors, -p: Enable parallel processing (always use available cores)
max / max/2: Supported values for --numberOfProcessors; useful under schedulers because recent deepTools releases detect CPU affinity more carefully
--region: Process specific regions for testing (e.g., chr1:1-1000000)
Read Filtering:
--ignoreDuplicates: Remove PCR duplicates (recommended for most analyses)
--minMappingQuality: Filter by alignment quality (e.g., --minMappingQuality 10)
--minFragmentLength / --maxFragmentLength: Fragment length bounds
--samFlagInclude / --samFlagExclude: SAM flag filtering
Read Processing:
--extendReads: Extend to fragment length (ChIP-seq: YES, RNA-seq: NO)
--centerReads: Center at fragment midpoint for sharper signals
Best Practices
File Validation
Always validate files first using scripts/validate_files.py to check:
File existence and readability
BAM indices present (.bai files)
BED format correctness
File sizes reasonable
Analysis Strategy
Start with QC: Run correlation, coverage, and fingerprint analysis before proceeding
Test on small regions: Use --region chr1:1-10000000 for parameter testing
Document commands: Save full command lines for reproducibility
Use consistent normalization: Apply same method across samples in comparisons
Verify genome assembly: Ensure BAM and BED files use matching genome builds
ChIP-seq Specific
Always extend reads for ChIP-seq: --extendReads 200
Remove duplicates: Use --ignoreDuplicates in most cases
Check enrichment first: Run plotFingerprint before detailed analysis
GC correction: Only apply if significant bias detected; never use --ignoreDuplicates after GC correction
RNA-seq Specific
Never extend reads for RNA-seq (would span splice junctions)
Strand-specific: Use --filterRNAstrand forward/reverse for common dUTP-style stranded libraries; confirm library orientation before interpreting strand labels
Normalization: CPM for bins, RPKM for genes
ATAC-seq Specific
Apply Tn5 correction: Use alignmentSieve with --ATACshift
Use only proper pairs for shifting: --ATACshift is equivalent to --shift 4 -5 5 -4 and filters to properly paired fragments
Fragment filtering: Set appropriate min/max fragment lengths
Check nucleosome pattern: Fragment size plot should show ladder pattern
Performance Optimization
Use multiple processors: --numberOfProcessors 8 (or available cores)
Increase bin size for faster processing and smaller files
Process chromosomes separately for memory-limited systems
Pre-filter BAM files using alignmentSieve to create reusable filtered files
Use bigWig over bedGraph: Compressed and faster to process
Troubleshooting
Common Issues
BAM index missing:
samtools index input.bam
Out of memory:
Process chromosomes individually using --region: