draw_domains: Add protein domains to ggplot2 object.

Description Usage Arguments Value Examples

View source: R/geoms.R

Description

draw_domains adds domains to the ggplot2 object created by draw_chains. It uses the data object. The ggplot2 function geom_rect is used to draw each of the domain chains proportional to their number of amino acids (length).

Usage

1
2
3
4
5
6
draw_domains(p,
         data = data,
         label_domains = TRUE,
         label_size = 4,
         show.legend = TRUE,
         type = "DOMAIN")

Arguments

p

ggplot2 object ideally created with draw_canvas.

data

Dataframe of one or more rows with the following column names: 'type', 'description', 'begin', 'end', 'length', 'accession', 'entryName', 'taxid', 'order'. Must contain a minimum of one "CHAIN" as data$type.

label_domains

Option to label domains or not.

label_size

Size of the text used for labels.

show.legend

Option to include legend in this layer

type

Can change to show other protein features

Value

A ggplot2 object either in the plot window or as an object with an additional geom_rect layer.

Examples

1
2
3
4
5
# combines with draw_chains to plot chains and domains.
data("five_rel_data")
p <- draw_canvas(five_rel_data)
p <- draw_chains(p, five_rel_data, label_size = 1.25)
draw_domains(p, five_rel_data)

drawProteins documentation built on Nov. 8, 2020, 5:25 p.m.