plotMotif | R Documentation |
Creates a bar plot to visualize motif counts or fractions from genomic data. Uses 'ggplot2' for plotting and 'tidyr' and 'dplyr' for data manipulation.
plotMotif(
x,
ylim = NULL,
x_title = "Motif",
plot_type = c("Fraction"),
bar_color = c(A = "cornflowerblue", C = "darksalmon", G = "palevioletred2", T =
"forestgreen"),
motif_levels = c("C", "G", "A", "T"),
output_file = NULL,
ggsave_params = list(width = 16, height = 4, unit = "cm", bg = "white", dpi = 500),
...
)
x |
Object containing the data to plot. |
ylim |
Numeric vector of length 2 providing y axis limits. |
x_title |
Character string, title for the x axis. |
plot_type |
Character string specifying the type of plot: 'count' or 'fraction'. |
bar_color |
Color to be used for bars in the plot. |
motif_levels |
Character vector specifying the order and inclusion of motif levels. |
output_file |
Optional string specifying the path and filename where the plot should be saved. Include the file extension, such as '.png' or '.pdf'. |
ggsave_params |
List of parameters to be passed to 'ggplot2::ggsave()'. This list can include any of the arguments that 'ggsave()' accepts. Example: 'list(width = 10, height = 8, dpi = 300)' |
... |
Additional arguments passed on to 'geom_bar()'. |
Returns a 'ggplot2' object.
## Not run:
plot <- plotMotif(data, ylim = c(0, 20), x_title = "Motif",
plot_type = "count", bar_color = "blue")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.