Description Usage Arguments Details Aesthetics See Also Examples
View source: R/geom_gene_arrow.R
'geom_gene_arrow' draws genes as arrows, allowing gene maps to be drawn.
1 2 3 4 5 |
mapping, data, stat, position, na.rm, show.legend, inherit.aes, ... |
As standard for ggplot2. |
arrowhead_width |
grid::unit object giving the width of the arrowhead. Defaults to 4 mm. If the gene is drawn smaller than this width, only the arrowhead will be drawn, compressed to the length of the gene. |
arrowhead_height |
grid::unit object giving the height of the arrowhead. Defaults to 4 mm. |
arrow_body_height |
grid::unit object giving the height of the body of the arrow. Defaults to 3 mm. |
This geom draws genes arranged along a horizontal 'string' representing the molecule. The start and end positions of the gene are expressed with the 'xmin' and 'xmax' aesthetics, while the molecule can be specified with the 'y' aesthetic.
Unless the plot is faceted with a free x scale, all the molecules will share a common x-axis. This means that if the genes are in very different numerical positions, they might appear very small and squished together. To get around this, either facet the plot with 'scales = "free_x"', or normalise the gene positions if their exact positions are not important.
See 'make_alignment_dummies' for a method to align genes between molecules.
xmin,xmax (start and end of the gene; will be used to determine gene orientation)
y (molecule)
alpha
colour
fill
linetype
size
theme_genes, make_alignment_dummies
1 2 3 4 | ggplot2::ggplot(example_genes, ggplot2::aes(xmin = start, xmax = end,
y = molecule, fill = gene)) +
geom_gene_arrow() +
ggplot2::facet_wrap(~ molecule, scales = "free")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.