kinship.heatmap {ASRgenomics} | R Documentation |
Enhanced heatmap plot for a kinship matrix K
Description
Generates a heatmap with dendrogram based on a provided kinship matrix.
This matrix can be a pedigree relationship matrix \boldsymbol{A}
, a
genomic relationship matrix \boldsymbol{G}
or a hybrid relationship
matrix \boldsymbol{H}
.
Individual names should be assigned to rownames
and colnames
.
It sorts individuals according to dendrogram in both columns and rows.
Usage
kinship.heatmap(
K = NULL,
dendrogram = TRUE,
clustering.method = c("hierarchical", "kmeans"),
dist.method = c("euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski"),
row.label = TRUE,
col.label = FALSE
)
Arguments
K |
Input of a kinship matrix in full format ( |
dendrogram |
If |
clustering.method |
The clustering method considered for the dendrogram.
Options are: |
dist.method |
The method considered to calculate the distance matrix between
individuals used for hierarchical clustering. Options are: |
row.label |
If |
col.label |
If |
Details
Uses the library superheat
from Barter and Yu (2018) to generate plots.
Value
A plot with the properties specified by the above arguments.
References
Barter, R.L. and Yu, B. 2018. Superheat: An R package for creating beautiful and extendable heatmaps for visualizing complex data. J. Comput. Graph. Stat. 27(4):910-922.
Examples
# Get G matrix.
G <- G.matrix(M = geno.apple, method = "VanRaden")$G
G[1:5, 1:5]
# Plot a subset of the individuals.
kinship.heatmap(K = G[1:10, 1:10], dendrogram = TRUE, row.label = TRUE, col.label = TRUE)