geom_arrowhead: A 'ggplot2' geom to draw genomic ranges as arrowheads.

View source: R/geom_arrowhead.R

geom_arrowheadR Documentation

A 'ggplot2' geom to draw genomic ranges as arrowheads.

Description

'geom_arrowhead()' draws ranges defined by 'xmin' and 'xmax' as triangular polygon. draws genomic ranges as arrowheads, allowing to draw for instance segmental duplication maps.

Usage

geom_arrowhead(
  mapping = NULL,
  data = NULL,
  stat = "identity",
  position = "identity",
  na.rm = FALSE,
  show.legend = NA,
  inherit.aes = TRUE,
  arrowhead_height = grid::unit(3, "mm"),
  ...
)

Arguments

mapping, data, stat, position, na.rm, show.legend, inherit.aes, ...

As is standard for ggplot2.

arrowhead_height

A 'grid::unit()' object providing the height of the arrowhead. (Default : '3'mm).

Details

This geom draws triangular polygons as arrowheads between defined start and end coordinates. Intended application of this geom is to visualize genomic coordinates defined by start and end position.

Aesthetics

'geom_roundrect()' require or can take the following aesthetics (required aesthetics are in bold):

- **xmin** - **xmax** - **y** - color - linewidth - linetype - alpha - fill - size

Author(s)

David Porubsky

Examples

## Create example data.frame to plot
plt.df <- data.frame(
    xmin = c(10, 100, 200),
    xmax = c(100, 190, 400)
)
## Plot rectangles with rounded edges
ggplot2::ggplot(plt.df) +
    geom_arrowhead(ggplot2::aes(xmin = xmin, xmax = xmax, y = 1))


daewoooo/SVbyEye documentation built on March 31, 2024, 8:58 a.m.