Fast generation of dotplots comparing sequences in R
Switch branches/tags
Nothing to show
Clone or download
Latest commit b17fc43 Feb 21, 2017
Permalink
Failed to load latest commit information.
R Plotting Improvements Apr 2, 2016
man Plotting Improvements Apr 2, 2016
src Add interrupt check Feb 21, 2017
.Rbuildignore Initial Commit Apr 2, 2016
.gitignore Initial Commit Apr 2, 2016
DESCRIPTION Initial Commit Apr 2, 2016
NAMESPACE Initial Commit Apr 2, 2016
README.md Update README.md Apr 4, 2016
Traditional.png Add README Apr 2, 2016
dotplot.Rproj Initial Commit Apr 2, 2016
ggplot.png Add README Apr 2, 2016

README.md

#dotplot - Rapid dot plots in R.

This package makes dotplots from DNA sequences. It is modeled after the dotPlot function contained within the seqinr package, but it doesn't take a million years to produce the plot because it uses compiled code to compute the regions of similarity and uses the faster raster functions added to R in 2011 instead of the older and very time consuming image function call.

#Installation

install.packages("devtools")
library(devtools)
install_github("evolvedmicrobe/dotplot", build_vignettes = FALSE)

Usage

There are two style of plots one can produce, either the older base graphics type as originally used in the seqinr package or a newer ggplot version. In addition to the aesthetic differences between these plots, for large sequences with sparse similarity, the ggplot version allows a region of similarity to take over more space than one pixel, while the older version strictly uses one pixel per coordinate pair as in the original function.

seq1 = "ATGAATACTAGATAGCATAGAGATAGACTATTAGGGTTAGGTTAGGGTTAGGGTGTTAGGGTTAGGGTTAGGGTTAGGGTTGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGGTTAGGGTTAGGGTTAGGGCCGCACCGAGCGCATACA"

seq2 = "ATGAATACTAGATAGCATAGAGATAGACTATTAGGGTTAGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTGTTAGGGTTAGGGTTAGGGTTAGGGCCGCACCGAGCGCATACA"

library(dotplot)
# Older Base Graphics Plot
dotPlotm(seq1, seq2, wsize = 7, xlab="Sequence 1", ylab="Sequence 2", main="Traditional R Graphics")

# Newer ggplot Version
library(ggplot2)
dotPlotg(seq1, seq2, wsize=7) + theme_bw() + labs(x="Sequence 1", y = "Sequence 2", title="New ggplot version")

Original New