Package 'plasmapR'

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

Help Index


Extract Features of a Plasmid as a DataFrame

Description

Extract Features of a Plasmid as a DataFrame

Usage

## S3 method for class 'plasmid'
as.data.frame(x, row.names, optional, ...)

Arguments

x

A list of class 'plasmid' from read_gb()

row.names

Ignored.

optional

Ignored.

...

Ignored.

Value

a DataFrame


Plot a Plasmid

Description

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.

Usage

plot_plasmid(plasmid, name = "Plasmid Name", label_wrap = 20)

Arguments

plasmid

A list of class 'plasmid' created through read_gb().

name

Name of the plasmid, to be shown in the center.

label_wrap

Passed to stringr::str_wrap() to wrap the long labels.

Value

A ggplot object.


Read a .gb GenBank File

Description

Read a .gb GenBank File

Usage

read_gb(file)

Arguments

file

File path or connection, that can be handled by readr::read_lines().

Value

a list of class 'plasmid' which can be further coerced for plotting.

Examples

fl <- system.file("extdata", "petm20.gb", package = "plasmapR")

fl |>
  read_gb() |>
  as.data.frame()

Compute positions for an Arrow

Description

Compute positions for an Arrow

Usage

StatArrow

Format

An object of class StatArrow (inherits from Stat, ggproto, gg) of length 5.


Compute required values for labels

Description

Compute required values for labels

Usage

StatArrowLabel

Format

An object of class StatArrowLabel (inherits from StatArrow, Stat, ggproto, gg) of length 2.