plot_overlay | R Documentation |
Takes a ggplot2 object and superimoses genes from a reference data.frame. This data.frame
can be constructed manually or generated with a variety of functions, e.g. get_inweb_list
,
get_irefindex_list
or get_tissue_list
.
The function uses the mapping and plot environment from a previous ggplot to add an overlay with a matching 'reference' data.frame. This yields a new plot with items that intersect the the original ggplot data and the reference data. Can be applied iteratively. The user can input certain columns in the reference to gain more control over the plotting parameters of individual points. See notes for additional details.
plot_overlay( p, reference, match = "gene", size_gg = 3.5, stroke = 0.75, sig_text = NULL, insig_text = NULL, label = NULL, label_size = NULL, label_color = "black", col_significant = NULL, col_other = NULL, label_box_padding = 0.3, label_point_padding = 0.5, label_arrowhead_size = 0.01, label_max_overlaps = 10, legend_nchar_max = NULL, nchar_max_collapse = "<br>" )
p |
A ggplot object passed down from |
reference |
a named list of data.frames. |
match |
string. By what string should the ggplot and overlay be merged? Default is 'gene'. |
size_gg |
numeric. Size of ggplot points. |
stroke |
numeric. The width of the outline/borders. |
sig_text |
string. Text for significant interactors to be displayed in legend. |
insig_text |
string. Text for non-significant interactors to be displayed in legend. |
label |
boolean. This will overwrite the |
label_size |
numeric. Size of label. This will overwrite the |
label_color |
string. The color of the label. Default is black. |
col_significant |
string. Color of superimposed genes that are significant. |
col_other |
string. Color of superimposed genes that are non-significant. |
label_box_padding |
numeric. Amount of padding around bounding box. See |
label_point_padding |
numeric. Amount of padding around label. See |
label_arrowhead_size |
numeric. The size of the arrowhead. 0 means no arrowhead. |
label_max_overlaps |
integer. Exclude text labels that overlap too many things. See |
legend_nchar_max |
integer. Maximum amount of allowed characters in the legend. |
nchar_max_collapse |
string. What character should be used for line break? Default is HTML line break |
The following data.frame headers for a reference are accepted:
"gene" A string tht indicates the gene name.
"label" A boolen that indicates whether the label should be plotted.
"label.size"A numeric that indicates the size of the label items.
See ?validate_reference for additional details.
## Not run: df <- example_data %>% calc_mod_ttest() %>% id_significant_proteins() # overlay simple a bait df %>% plot_volcano_basic() %>% plot_overlay(as.bait('BCL2')) # make a custom overlay with custom colors myoverlay = data.frame(gene = c('FUS', 'RBMX'), col_significant = c('cyan', 'blue'), col_other = c('grey', 'grey'), dataset = c('group 1', 'group 2')) # plot overlay df %>% plot_volcano_basic() %>% plot_overlay(list(overlay = myoverlay)) # plot multiple overlays df %>% plot_volcano_basic() %>% plot_overlay(list(overlay = myoverlay)) %>% plot_overlay(as.bait('BCL2')) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.