motif_tree {universalmotif} | R Documentation |
For more powerful motif tree functions, see the motifStack package.
The motif_tree()
function compares motifs with compare_motifs()
to create
a distance matrix, which is used to generate a phylogeny via ape.
This can be plotted with ggtree::ggtree()
. The purpose of this function
is simply to combine the compare_motifs()
and ggtree::ggtree()
steps
into one. For more control over tree creation, it is recommend to do these
steps separately. See the Advanced Usage vignette for such a workthrough.
motif_tree(motifs, layout = "circular", linecol = "family", labels = "none", tipsize = "none", legend = TRUE, branch.length = "none", db.scores, method = "MPCC", use.type = "PPM", min.overlap = 6, tryRC = TRUE, min.mean.ic = 0.5, relative_entropy = FALSE, progress = TRUE, BP = FALSE, ...)
motifs |
|
layout |
|
linecol |
|
labels |
|
tipsize |
|
legend |
|
branch.length |
|
db.scores |
|
method |
|
use.type |
|
min.overlap |
|
tryRC |
|
min.mean.ic |
|
relative_entropy |
|
progress |
|
BP |
|
... |
ggtree params. See |
ggplot object.
Benjamin Jean-Marie Tremblay, b2tremblay@uwaterloo.ca
Wickham H (2009). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. ISBN 978-0-387-98140-6, http://ggplot2.org.
Yu G, Smith D, Zhu H, Guan Y, Lam TT (2017). “ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data.” Methods in Ecology and Evolution, 8, 28-36. doi: 10.1111/2041-210X.12628, http://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12628/abstract.
motifStack::motifStack()
, compare_motifs()
,
ggtree::ggtree()
, ggplot2::ggplot()
jaspar <- read_jaspar(system.file("extdata", "jaspar.txt", package = "universalmotif")) jaspar.tree <- motif_tree(jaspar, linecol = "none", labels = "name", layout = "rectangular") ## Not run: ## When inputting a dist object, the linecol and tipsize options are ## not available. To add these manually: library(MotifDb) library(ggtree) library(ggplot2) motifs <- filter_motifs(MotifDb, organism = "Athaliana")[1:50] comparison <- compare_motifs(motifs, method = "MPCC") comparison <- as.dist(1 - comparison) mot.names <- attr(comparison, "Labels") tree <- motif_tree(comparison) annotations <- data.frame(label = mot.names, icscore = sapply(motifs, function(x) x["icscore"]), family = sapply(motifs, function(x) x["family"])) tree <- tree %<+% annotations + geom_tippoint(aes(size = icscore)) + aes(colour = family) + theme(legend.position = "right", legend.title = element_blank()) ## End(Not run)