Generates a static LD heatmap from a pre-computed
LDResults object using ggplot2 graphics.
Arguments
- ldObj
An object of class
LDResultsas returned bylinkageDiseq.- plotVal
What LD value do you want to plot? Options are:
r2: \(r^{2}\) (Default parameter)DPrime: \(D'\)pDiseq: p-value
- colorScheme
Color palette for the heatmap cells.
"haploview"uses the classic Haploview scheme where cell color is determined by both LOD score and \(D'\): LOD < 2 and \(D'\) < 1 gives white, LOD < 2 and \(D'\) = 1 gives blue, LOD \(\ge\) 2 and \(D'\) < 1 gives shades of pink/red scaled by \(D'\), and LOD \(\ge\) 2 and \(D'\) = 1 gives bright red. All other options use continuous viridis-family palettes:"viridis"(default),"magma","inferno","plasma","cividis","rocket","mako", and"turbo".- ldBlocks
Optional specification of genomic regions to highlight as LD blocks on the plot. Accepted formats:
A
LDRegionobject (single block) or alistofLDRegionobjects (multiple blocks). Each region carriesstart,end, an optionallabel, and an outlinecolor. The chromosome is inferred from the data (single-chromosome only).A
GRangesobject where each range defines a chromosome and start/end positions. An optionallabelmetadata column (inmcols) adds text annotations. Block outlines default to black.
Sites falling within each region are outlined with a triangular border. Defaults to
NULL.- genomicTrack
Logical. If
TRUE, a horizontal genomic track is drawn above the LD plot showing the approximate physical positions of each site along the chromosome. Site IDs are placed at their physical positions on the track, and line segments connect each physical position to the corresponding evenly-spaced position above the LD triangle. When data span multiple chromosomes, positions are displayed cumulatively. Defaults toFALSE.- showIndex
Logical. If
TRUE(default), numeric index labels (1, 2, 3, ...) are drawn along the diagonal of the LD triangle. Set toFALSEto hide them.- verbose
Display messages? Defaults to
TRUE.
Details
This function visualises a pre-computed LD result set.
Use linkageDiseq to calculate LD first, then pass the
resulting LDResults object here.
