View source: R/geom_miropeats.R
geom_miropeats | R Documentation |
'geom_miropeats()' draws miropeat style polygons between query to target genomic alignments.
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,
...
)
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
|
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'). |
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.
Plotting coordinates
'geom_miropeats()' require or can take the following aesthetics (required aesthetics are in bold):
- **x** - **y** - **group** - color - linewidth - linetype - alpha - fill - size
David Porubsky
[readPaf()], [paf2coords()]
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.