geom_miropeats: A 'ggplot2' geom to draw genomic alignments in a miropeats...

View source: R/geom_miropeats.R

geom_miropeatsR Documentation

A 'ggplot2' geom to draw genomic alignments in a miropeats style.

Description

'geom_miropeats()' draws miropeat style polygons between query to target genomic alignments.

Usage

geom_miropeats(
  mapping = NULL,
  data = NULL,
  geom = "polygon",
  stat = "miropeats",
  position = "identity",
  n = 100,
  na.rm = FALSE,
  strength = 0.5,
  show.legend = NA,
  inherit.aes = TRUE,
  ...
)

Arguments

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

As is standard for ggplot2.

geom

The geometric object to use to display the data, either as a ggproto Geom subclass or as a string naming the geom stripped of the geom_ prefix (e.g. "point" rather than "geom_point")

n

The number of points to create for each alignment polygon (Default : '100').

strength

The proportion to move the control point along the y-axis towards the other end of the alignment polygon (Default : '0.5').

Details

This geom draws polygons between query to target alignments defined in PAF format. Such alignments are first loaded using readPaf function into a tibble object. Then loaded alignments are converted into the plotting coordinates using paf2coords function. molecule. Resulting data.frame object contains required aesthetics 'x' and 'y' coordinates as well as 'group' field that is required in order to determine which coordinates represent a single alignment.

Value

Plotting coordinates

Aesthetics

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

- **x** - **y** - **group** - color - linewidth - linetype - alpha - fill - size

Author(s)

David Porubsky

See Also

[readPaf()], [paf2coords()]

Examples

## Get PAF to plot
paf.file <- system.file("extdata", "test1.paf", package = "SVbyEye")
## Read in PAF
paf.table <- readPaf(paf.file = paf.file, include.paf.tags = TRUE, restrict.paf.tags = "cg")
## Convert PAF alignments to plotting coordinates
coords <- paf2coords(paf.table = paf.table)
## Make a plot
ggplot2::ggplot(coords) +
    geom_miropeats(ggplot2::aes(x, y, group = group, fill = direction), alpha = 0.5)


daewoooo/SVbyEye documentation built on Oct. 15, 2024, 6:12 a.m.