10: Advanced Omics Heatmaps & Clustering
Tested Stacks:
GATK 4.6.1
Samtools 1.21
Nextflow 24.10
Seurat v5.1
Python 3.12
Prerequisites: Basic Linux CLI & Sequencing Formats
📚 Chapter 10 of 13
0% Course Completed
Chapter 10: Advanced Omics Heatmaps & Clustering with ComplexHeatmap
Heatmaps are indispensable for visualizing multi-sample transcriptomic, epigenomic, and proteomic matrices. ComplexHeatmap enables publication-grade clustered heatmaps with multi-track clinical annotations, row splitting, and dendrogram pruning.
1. Row-wise Z-Score Standardization
Standardizing expression values ($Z = \frac{x - \mu}{\sigma}$) centers gene profiles around zero for direct pattern comparison:
mat_z <- t(scale(t(counts_matrix)))2. Multi-Track Clustered Heatmap
library(ComplexHeatmap)
library(circlize)
col_fun <- colorRamp2(c(-2, 0, 2), c("#2563EB", "#FFFFFF", "#DC2626"))
ha_top <- HeatmapAnnotation(
Subtype = sample_anno$Subtype,
Response = sample_anno$Response,
col = list(
Subtype = c("Basal-like" = "#E11D48", "Luminal A" = "#059669", "HER2+" = "#7C3AED"),
Response = c("Responder" = "#10B981", "Non-Responder" = "#64748B")
)
)
Heatmap(
mat_z,
name = "Z-Score",
col = col_fun,
top_annotation = ha_top,
clustering_distance_rows = "pearson",
clustering_method_rows = "ward.D2",
column_title = "Oncogenic Transcriptomic Profile"
)
⚠️
Common Pitfalls & Troubleshooting Checklist
- Java Heap Exhaustion (GATK / Picard): If processes terminate with
java.lang.OutOfMemoryError, set your environment variable explicitly:export _JAVA_OPTIONS="-Xmx16g -Djava.io.tmpdir=/tmp". - Index Timestamp Mismatch: If tools complain that a BAM index is missing or out of date, regenerate with
samtools index -@ 4 sample.bam. - Conda Channel Conflicts: Avoid ABI incompatibilities between bioconda and conda-forge by setting strict priority:
conda config --set channel_priority strict. - Chromosome Naming Contamination: Always verify whether reference FASTA headers use
chr1or1; divergent naming causes silent alignment drops.
Was this guide helpful to your research?
Help us maintain 100% accurate, peer-reviewed bioinformatics standards.