$ show jokergoo/EnrichedHeatmap
This is an R/Bioconductor package for making enriched heatmaps, primarily used in epigenomics to visualize enrichment of genomic signals (e.g., histone modifications, DNA methylation) around target regions (e.g., transcription start sites). The package provides a workflow: normalize signals to a matrix via `normalizeToMatrix()`, then draw a heatmap with `EnrichedHeatmap()`, which is a subclass of ComplexHeatmap. It includes specialized annotation (`anno_enriched()`), row ordering by enrichment scores, smoothing, and support for categorical signals. The architecture leverages S3 classes (normalizedMatrix) and integrates with GenomicRanges for genomic interval operations. It is well-documented with vignettes and a pkgdown site, and includes Rcpp for performance-critical distance calculations. While the package is actively maintained, there are some signs of technical drift such as deprecated arguments and an old CI configuration.
The LLM identified 2 files worth highlighting for reuse:
A C++ implementation of a custom distance metric for comparing rows of a matrix based on the closeness of non-zero windows. It computes pairwise distances by finding the closest non-zero window index across rows, making it useful for ordering rows in heatmaps. The code is self-contained, uses Rcpp, and can be extracted into any R package that requires a similar distance measure.
Contains the `makeWindows` function, which splits genomic regions (GRanges) into windows of a specified size or number. This is a common genomic data preprocessing step, and the function is parameterized and independent of the package's core logic. It can be reused in any genomic analysis pipeline that requires window-based binning of genomic intervals.