view_motifs | R Documentation |
Show sequence logo. If given a list of more than one motif, then the motifs are aligned with the first in the list.
view_motifs(motifs, use.type = "ICM", method = "ALLR", tryRC = TRUE,
min.overlap = 6, min.mean.ic = 0.25, relative_entropy = FALSE,
normalise.scores = FALSE, min.position.ic = 0, score.strat = "sum",
return.raw = FALSE, dedup.names = TRUE, show.positions = TRUE,
show.positions.once = TRUE, show.names = TRUE, names.pos = c("top",
"right"), use.freq = 1, colour.scheme = NULL, fontDF = NULL,
min.height = 0.01, x.spacer = if (use.freq == 1) 0.04 else 0.1,
y.spacer = 0.01, sort.positions = !use.type %in% c("PCM", "PPM"),
sort.positions.decreasing = TRUE, text.size = 16, fit.to.height = if
(use.type == "PPM") 1 else NULL, RC.text = " [RC]", ...)
motifs |
See |
use.type |
|
method |
|
tryRC |
|
min.overlap |
|
min.mean.ic |
|
relative_entropy |
|
normalise.scores |
|
min.position.ic |
|
score.strat |
|
return.raw |
|
dedup.names |
|
show.positions |
|
show.positions.once |
|
show.names |
|
names.pos |
|
use.freq |
|
colour.scheme |
|
fontDF |
|
min.height |
|
x.spacer |
|
y.spacer |
|
sort.positions |
|
sort.positions.decreasing |
|
text.size |
|
fit.to.height |
|
RC.text |
|
... |
Unused. Was previously in place to allow extra args to be given
to |
See compare_motifs()
for more info on comparison parameters.
See view_logo()
to plot from a numeric matrix with arbitrary values instead
of a motif object.
Note: score.strat = "a.mean"
is NOT recommended, as view_motifs()
will
not discriminate between two alignments with equal mean scores, even if one
alignment is longer than the other.
Note: if you want to plot the motifs yourself, you can set
return.raw=TRUE
to get the numeric motif matrices and calculate
the polygon paths on your own or access the polygon path data directly from
the final ggplot
object using $data
.
A ggplot
object. If return.raw = TRUE
, a list of matrices.
Benjamin Jean-Marie Tremblay, benjamin.tremblay@uwaterloo.ca
compare_motifs()
, add_multifreq()
, view_logo()
## Plotting multifreq motifs:
data(examplemotif2)
view_motifs(examplemotif2, use.freq = 2)
## Generate your own letter set:
## Not run:
library(gglogo) # install from CRAN first if needed
fontDFtimes <- createPolygons(LETTERS, "Times", 800, scale = TRUE)
view_motifs(examplemotif2, fontDF = fontDFtimes)
## Note: setting `scale = TRUE` is necessary to properly align letters
## vertically, but this has the effect of horizontally stretching out
## letters which shouldn't be stretched (such as "I"). If you need to plot
## letters which have been badly horizontally scaled, you can fix them
## manually as demonstrated here:
# Retrieve the x-coordinates for the desired letter:
tofix <- fontDFtimes$x[fontDFtimes$group == "I"]
# Scale the letter x-coordinates:
tofix <- tofix * 0.35
# Remember to center the letter around 0.5 again:
tofix <- tofix + (1 - max(tofix)) / 2
# Apply the fix:
fontDFtimes$x[fontDFtimes$group == "I"] <- tofix
view_motifs(create_motif("AIG", alphabet = "AA"), fontDF = fontDFtimes)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.