Learn R Programming

phyclust (version 0.1-34)

plotdots: 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", ...)

Value

A dots plot will be drawn.

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.

Author

Wei-Chen Chen wccsnow@gmail.com

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.

References

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

See Also

seqgen, plothist.

Examples

Run this code
if (FALSE) {
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)
}

Run the code above in your browser using DataLab