A GPU-accelerated Hi-C chromatin contact map. The matrix is uploaded once as
a single-channel float texture and drawn as one WebGL quad (via regl), with
the colormap and log/linear transform applied in the fragment shader, so
pan/zoom stays smooth on very large matrices. A precomputed level-of-detail
pyramid keeps interaction fast when zoomed out. Axes (genomic coordinate
ticks) and the colorbar are drawn as crisp vector overlays. No tile server is
required.
Arguments
- mat
Either a square numeric matrix of contact counts, or a data frame / list giving a sparse COO triplet with integer columns
i,jand a numericv. When a triplet is supplied,nmust be given (or inferable frommax(i, j) + 1).- n
Number of bins per axis. Required for the sparse (i/j/v) form; ignored for a dense matrix (taken from
nrow(mat)).- bin_size
Genomic bin size in base pairs; used to label axes in bp/kb/Mb.
NULLlabels axes by bin index.- chrom
Optional chromosome name shown as the axis title.
- colormap
Sequential colormap for intensity:
"viridis"or"rdbu".- transform
Intensity transform,
"log"(default) or"linear".- vmax
Upper clip of the intensity scale;
NULLauto-picks a high percentile.- vmax_percentile
Percentile in
(0, 1]used to auto-pickvmaxwhenvmaxisNULL.NULLuses the component default.- vmin
Lower clip of the intensity scale.
- symmetric
Mirror sparse
i/j/ventries across the diagonal.- label
Axis title (overrides
chromwhen set).- theme
Optional named list of theme overrides (colors, fonts, ...) merged over the component defaults in the browser.
NULLuses the default theme.- width, height
Widget dimensions (any valid CSS size).
- element_id
Optional explicit DOM id.