draw_repeat | R Documentation |
draw_repeat
adds protein repeats from Uniprot to ggplot2 object
created by draw_canvas
and draw_chains
.
It uses the data object.
The ggplot2 function geom_rect
is used to draw each of the motifs proportional to their number of
amino acids (length).
draw_repeat(p, data = data, label_size = 2, outline = "dimgrey",
fill = "dimgrey", alpha = 1.0,
label_repeats = TRUE, show.legend = TRUE)
p |
ggplot2 object ideally created with |
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_size |
Size of text used for labels of protein repeats. |
outline |
Colour of the outline of each repeat. |
fill |
Colour of the fill of each repeat. |
alpha |
Transparency of the rectangles representing the repeats. |
label_repeats |
Option to label repeats or not. |
show.legend |
Option to include legend in this layer |
A ggplot2 object either in the plot window or as an object with an additional geom_rect layer.
# combines with draw_chains to plot chains and repeats.
data("five_rel_data")
p <- draw_canvas(five_rel_data)
p <- draw_chains(p, five_rel_data, label_size = 1.25)
draw_repeat(p, five_rel_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.