Learn R Programming

seedy (version 1.3)

plotdistmat: Plot genetic distance matrix

Description

Provides a graphical representation of the pairwise genetic distance matrix for a collection of genomes.

Usage

plotdistmat(distmat, colvec, coltext, pos = "topleft", labels = NULL, 
            numbers = TRUE, ...)

Arguments

distmat
Symmetrical pairwise distance matrix, the [i,j]th entry corresponding to the genetic distance between genomes i and j.
colvec
Vector of colors to represent increasing genetic distance.
coltext
Vector of colors for numerals representing geentic distance on plot (if numbers=TRUE).
pos
Position of the matrix in plot. Allowed values are "topleft", "topright", "bottomleft" and "bottomright".
labels
Axis labels for genomes (by default, marked 1,...,n).
numbers
Should the genetic distance be recorded in each cell?
...
Additional arguments to be passed to plot.

Details

Plots the upper (or lower) diagonal genetic distance matrix, with each entry colored according to geentic distance.

See Also

gd

Examples

Run this code
data(withinhost)
Gmat <- gd(withinhost$obs.strain, withinhost$libr, withinhost$nuc, 
           withinhost$librstrains)

colvec <- rainbow(1200)[1:1000] # Color palette
coltext <- rep("black", length(colvec)) # Corresponding text colors
coltext[680:970] <- "white" # White text for darker background colours

plotdistmat(Gmat, colvec, coltext, pos="bottomleft", labels=NULL, numbers=TRUE)

Run the code above in your browser using DataLab