plotdots: Dots Plots of Sequences for Visual Comparisons

View source: R/f_plotdots.r

plotdotsR Documentation

Dots Plots of Sequences for Visual Comparisons

Description

This function provides dots plots of data set given an idea how diverse the sequences are by drawing dots with different colors for all mutations.

Usage

plotdots(X, X.class = NULL, Mu = NULL, code.type = .code.type[1],
    diff.only = TRUE, fill = FALSE, label = TRUE, with.gap = FALSE,
    xlim = NULL, ylim = NULL, main = "Dots Plot", xlab = "Sites",
    ylab = "Sequences", missing.col = "gray95", ...)

Arguments

X

numerical data matrix with N rows/sequences and L columns/sites.

X.class

class ids indicated for all sequences.

Mu

a center sequence with length L.

code.type

either "NUCLEOTIDE" (default) or "SNP".

diff.only

draw the segregating sites only, default = TRUE.

fill

fill in all dots, default = FALSE.

label

indicate segregating sites, default = TRUE.

with.gap

pass to find.consensus if Mu is NULL, default = FALSE

xlim

limit of x-axis.

ylim

limit of y-axis.

main

main label, default = "Dots Plot".

xlab

x-axis label, default = "Sites".

ylab

y-axis label, default = "Sequences".

missing.col

color for the missing allele, default = NA.

...

other options passed to plot.

Details

The first rows in Mu will be drawn entirely on dots plots in colors which are "green3", "blue2", #CC00CC, "red2", "gray", and "white", according the ids + 1. If fill is FALSE, other sequences will be drawn by the mutation sites comparing to the first sequences. Otherwise, they be drawn entirely.

If X.class is set, the sequences will be drawn in cluster order.

If Mu is NULL, the consensus sequence of X will be drawn.

If label is TRUE, the bottom row will be drawn in color "orange" to indicate segregating sites.

with.gap is only used when Mu is NULL.

Value

A dots plot will be drawn.

Author(s)

Wei-Chen Chen wccsnow@gmail.com

References

Phylogenetic Clustering Website: https://snoweye.github.io/phyclust/

See Also

seqgen, plothist.

Examples

## Not run: 
library(phyclust, quiet = TRUE)

# For nucleotide
X <- seq.data.toy$org
par(mfrow = c(2, 2))
plotdots(X)
plotdots(X, diff.only = FALSE)
plotdots(X, diff.only = FALSE, label = FALSE)
plotdots(X, fill = TRUE, diff.only = FALSE, label = FALSE)

# With class ids
X.class <- as.numeric(gsub(".*-(.*)", "\\1", seq.data.toy$seqname))
plotdots(X, X.class)

# For SNP
X.SNP <- nid2sid(X)
plotdots(X.SNP, X.class)

## End(Not run)

snoweye/phyclust documentation built on Sept. 12, 2023, 5 a.m.