LDheatmap.highlight: Highlight a genetic region in the linkage disequilibrium heat...

View source: R/LDheatmap.highlight.R

LDheatmap.highlightR Documentation

Highlight a genetic region in the linkage disequilibrium heat map

Description

The function LDheatmap.highlight() is used to highlight a specified genetic region in the linkage disequilibrium (LD) heat map drawn with the LDheatmap() function.

Usage

LDheatmap.highlight(LDheatmap, i, j, fill = "NA", col = "black", lwd = 1, 
lty = 1,flipOutline=FALSE, crissCross = FALSE)

Arguments

LDheatmap

An object of class "LDheatmap" returned by the function LDheatmap().

i

A numeric value specifying the index of the first SNP to be in the highlighted region.

j

A numeric value specifying the index of the last SNP, which must be different from i, to be in the highlighted region.

fill

Color to fill the highlighted area with.

col

A character string specifying the color of the line segments defining the boundary of highlighted region; see par() for possible values.

lwd

A positive number specifying the width of the boundary segments.

lty

Either an integer or a character string specifying the line type of the boundary segments; see par() for possible values.

flipOutline

A Boolean variable that flips the outlined section over the diagonal of the heatmap.

crissCross

A Boolean variable that controls whether a contiguous selection of SNPs are outlined only on their polygonal boundary or at individual SNP levels.

Value

A data frame of the x and y coordinates of points defining the border of the highlighted area.

Warning

By default, LDheatmap.highlight() finds the viewport to draw on from the LDheatmap object passed to it as an argument. However, if LDheatmap() was called with the option pop=TRUE, the resulting LDheatmap object is not assigned a viewport. In this case, LDheatmap.highlight() assumes the user wishes to highlight in the current viewport. Therefore, if LDheatmap() has been called with the option pop=TRUE, the user must navigate to the correct viewport before calling LDheatmap.highlight().

Note

The function LDheatmap.highlight() highlights the cells representing the pairwise LD for the SNPs located between i-th and j-th (inclusive) SNPs in the genomic region of interest. The order of indices has no effect on the plot. For example, LDheatmap.highlight(LDheatmap, i=2, j=4) is the same as LDheatmap.highlight(LDheatmap, i=4, j=2), which highlights the cells representing the pairwise LD for the second, third and fourth SNPs.

Author(s)

Nicholas Lewin-Koh <nikko@hailmail.net>, Ji-Hyung Shin <shin@sfu.ca>, Sigal Blay <sblay@sfu.ca>

Examples

data(CEUSNP); data(CEUDist)
tt <- LDheatmap(CEUSNP, genetic.distances=CEUDist)
LDheatmap.highlight(tt, 3, 8, col="blue", fill="green", lwd=3, flipOutline=FALSE, crissCross=FALSE)

LDheatmap documentation built on April 24, 2022, 1:05 a.m.