Learn R Programming

phyclust (version 0.1-9)

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.missing = FALSE,
    xlim = NULL, ylim = NULL, main = "Dots Plot", xlab = "Sites",
    ylab = "Sequences", ...)

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.missing
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".
...
other options passed to plot.

Value

  • A dots plot will be drawn.

Details

The first rows in Mu will be drawn entirely on dots plots in colors which are "green3", "blue2", "#CC00CC", "red2", and "black", 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.missing is only used when Mu is NULL.

References

Phylogenetic Clustering Website: http://thirteen-01.stat.iastate.edu/snoweye/phyclust/

See Also

seqgen, plothist.

Examples

Run this code
# 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