Description Usage Arguments Details Value Author(s) References See Also Examples
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.
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 "Motif comparisons and P-values" vignette for such
a workthrough. This function requires the ape and ggtree packages
to be installed separately.
1 2 3 4 5 6 | motif_tree(motifs, layout = "circular", linecol = "family",
labels = "none", tipsize = "none", legend = TRUE,
branch.length = "none", db.scores, method = "EUCL", use.type = "PPM",
min.overlap = 6, min.position.ic = 0, tryRC = TRUE, min.mean.ic = 0,
relative_entropy = FALSE, progress = FALSE, nthreads = 1,
score.strat = "a.mean", ...)
|
motifs |
|
layout |
|
linecol |
|
labels |
|
tipsize |
|
legend |
|
branch.length |
|
db.scores |
|
method |
|
use.type |
|
min.overlap |
|
min.position.ic |
|
tryRC |
|
min.mean.ic |
|
relative_entropy |
|
progress |
|
nthreads |
|
score.strat |
|
... |
ggtree params. See |
See compare_motifs()
for more info on comparison parameters.
ggplot object.
Benjamin Jean-Marie Tremblay, b2tremblay@uwaterloo.ca
ggplot2universalmotif
\insertRefggtreeuniversalmotif
motifStack::motifStack()
, compare_motifs()
,
ggtree::ggtree()
, ggplot2::ggplot()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | jaspar <- read_jaspar(system.file("extdata", "jaspar.txt",
package = "universalmotif"))
if (requireNamespace("ggtree", quietly = TRUE)) {
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 = "PCC", score.strat = "a.mean")
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.