draw_folding {drawProteins}R Documentation

Add regions to ggplot object: alpha-helixes, beta-strands and turns.

Description

draw_folding adds alpha-helixes, beta-strands and turns to the ggplot2 object created by draw_chains. It uses the data object. The ggplot2 function geom_rect is used to draw parts of the protein chain which has alpha-helixes, beta-strands and turns proportional to the number of amino acids (length).

Usage

draw_folding(p, data = data, show.legend = TRUE, show_strand = TRUE,
  show_helix = TRUE, show_turn = TRUE)

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'. Uses STRAND, HELIX and TURN type to indicate these parts of the proteins.

show.legend

Option to include legend in this layer

show_strand

Option to show STRAND in this layer

show_helix

Option to show HELIX in this layer

show_turn

Option to show TURN in this layer

Value

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

Examples

# combines with draw_chains to colour chain with helicies, strands and turns.
data("five_rel_data")
p <- draw_canvas(five_rel_data)
p <- draw_chains(p, five_rel_data, label_size = 1.25)
p <- draw_folding(p, five_rel_data)
p

# only colour alpha helix regions
p <- draw_canvas(five_rel_data)
p <- draw_chains(p, five_rel_data, label_size = 1.25)
p <-draw_folding(p, five_rel_data, show_strand = FALSE, show_turn = FALSE)
p

[Package drawProteins version 1.4.0 Index]