ggrama: Ramachandran diagram

Description Usage Arguments Value Examples

View source: R/ggrama.R

Description

Plots a Ramachandran diagram from a pdb file using ggplot2 graphics

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
ggrama(
  pdb,
  type = c("general", "glycine", "pre.pro", "proline"),
  values = switch(type, general = c(0, 0.001, 0.02, 0.1, 1), glycine = c(0, 0.002,
    0.02, 0.1, 1), proline = c(0, 0.002, 0.02, 0.1, 1), pre.pro = c(0, 0.002, 0.02, 0.1,
    1)),
  colors = switch(type, general = c("#FFFFFF", "#B3E8FF", "#82daff", "#19bbff"),
    glycine = c("#FFFFFF", "#FFE8C5", "#ffddab", "#FFCC7F"), proline = c("#FFFFFF",
    "#D0FFC5", "#a2fa8e", "#49de26"), pre.pro = c("#FFFFFF", "#B3E8FF", "#82daff",
    "#19bbff")),
  title = switch(type, general = "General", glycine = "Glycine (Symmetric)", proline =
    "Proline", pre.pro = "Pre-Proline"),
  shape = 21,
  size = 2,
  fill = "#FFFFFF",
  contour = FALSE,
  contour.color = NA,
  smooth = FALSE,
  ...
)

Arguments

pdb

input pdb file location.

type

One of c("general", "glycine", "pre.pro", "proline"). String representing the type of Ramachandran diagram.

values

Numeric vector indicating the values of ggplot2{scale_fill_gradientn}.

colors

A character vector of valid color names indicating the colors for ggplot2{scale_fill_gradientn}.

title

A string indicating the title of the plot.

shape

Shape for ggplot2{geom_point}.

size

Size for ggplot2{geom_point}.

fill

fill for ggplot2{geom_point} if supported.

contour

logical, should ggplot2{geom_contour_filled} be used instead of ggplot2{geom_tile}

contour.color

numeric, the color of the contour if contour = TRUE.

smooth

logical, should the background grid be smoothed.

...

currently not used

Value

A ggplot2 plot object

Examples

1
2
3
4
5
6
7
8
9
#download a PDB file
download.file("https://files.rcsb.org/download/2ADQ.pdb1.gz",
              dest = "2ADQ.pdb1.gz")

# plot the general Ramachandran diagram
ggrama("2ADQ.pdb1.gz")

# plot the proline Ramachandran diagram
ggrama("2ADQ.pdb1.gz", type = "proline")

missuse/ggrama documentation built on Dec. 21, 2021, 7:01 p.m.