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

View source: R/geoms.R

draw_foldingR 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,
alpha = 1.0)

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

alpha

alpha Transparency of the rectangles representing the folds.

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)
draw_folding(p, five_rel_data)




brennanpincardiff/drawProteins documentation built on March 8, 2024, 8:15 a.m.