| Title: | Create Plasmid Maps in R |
|---|---|
| Description: | Create circular plasmid maps as ggplot objects. Allows for parsing of .gb files and the creation of plasmid maps. Features allowing for customisation of aesthetics, like regular ggplot plots. |
| Authors: | Brady Johnston [aut, cre] (ORCID: <https://orcid.org/0000-0001-6301-2269>) |
| Maintainer: | Brady Johnston <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.1 |
| Built: | 2026-06-05 06:34:43 UTC |
| Source: | https://github.com/bradyajohnston/plasmapR |
Extract Features of a Plasmid as a DataFrame
## S3 method for class 'plasmid' as.data.frame(x, row.names, optional, ...)## S3 method for class 'plasmid' as.data.frame(x, row.names, optional, ...)
x |
A list of class 'plasmid' from |
row.names |
Ignored. |
optional |
Ignored. |
... |
Ignored. |
a DataFrame
Create a {ggplot2} plot of a plasmid in polar coordinates. Extracts the
features as a data.frame from the plasmid and uses these to construct arrows
that are added to the plot.
plot_plasmid(plasmid, name = "Plasmid Name", label_wrap = 20)plot_plasmid(plasmid, name = "Plasmid Name", label_wrap = 20)
plasmid |
A list of class 'plasmid' created through |
name |
Name of the plasmid, to be shown in the center. |
label_wrap |
Passed to |
A ggplot object.
.gb GenBank FileRead a .gb GenBank File
read_gb(file)read_gb(file)
file |
File path or connection, that can be handled by readr::read_lines(). |
a list of class 'plasmid' which can be further coerced for plotting.
fl <- system.file("extdata", "petm20.gb", package = "plasmapR") fl |> read_gb() |> as.data.frame()fl <- system.file("extdata", "petm20.gb", package = "plasmapR") fl |> read_gb() |> as.data.frame()
This stat creates arrow shapes in a ggplot.
stat_arrow( mapping = NULL, data = NULL, geom = "polygon", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ..., bp = 6000, arrowhead_size = 8 )stat_arrow( mapping = NULL, data = NULL, geom = "polygon", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ..., bp = 6000, arrowhead_size = 8 )
mapping |
The aesthetic mapping, usually constructed with aes(). |
data |
The dataset to be used in the layer. |
geom |
The geometric object to use for the layer, default is "polygon". |
position |
Position adjustment, default is "identity". |
na.rm |
Should missing values be removed? |
show.legend |
Logical. Should this layer be included in the legends? |
inherit.aes |
Should inherit aesthetics from the parent plot? |
... |
Other arguments passed to layer(). |
bp |
The base parameter for the arrow shape. |
arrowhead_size |
The size of the arrowhead. |
Used for drawing features for a plasmid that work in both cartesian and polad coordinate systems.
A ggplot layer with arrow shapes.
The bp parameter determines the base parameter of the arrow shape.
The arrowhead_size parameter controls the size of the arrowhead.
Compute positions for an Arrow
StatArrowStatArrow
An object of class StatArrow (inherits from Stat, ggproto, gg) of length 5.
Compute required values for labels
StatArrowLabelStatArrowLabel
An object of class StatArrowLabel (inherits from StatArrow, Stat, ggproto, gg) of length 2.