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] |
Maintainer: | Brady Johnston <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.3.1 |
Built: | 2025-02-20 03:14:40 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()
Compute positions for an Arrow
StatArrow
StatArrow
An object of class StatArrow
(inherits from Stat
, ggproto
, gg
) of length 5.
Compute required values for labels
StatArrowLabel
StatArrowLabel
An object of class StatArrowLabel
(inherits from StatArrow
, Stat
, ggproto
, gg
) of length 2.