Last chance! 50% off unlimited learning
Sale ends in
This function creates a volcano plot for all combinations of groups in a factor.
volcano_trio(
polar,
p_cutoff = 0.05,
cutoff_criteria = "pvalue",
fc_cutoff = 1,
label_rows = NULL,
label_size = 3,
text_size = 10,
marker_alpha = 0.7,
marker_size = 3,
marker_outline_colour = "white",
marker_outline_width = 0.5,
shared_legend_size = 1,
sig_names = NULL,
colour_scheme = "none",
colours = c("salmon", "steelblue", "limegreen", "grey60"),
fc_line = TRUE,
p_line = TRUE,
line_colours = c("black", "black"),
share_axes = TRUE
)
A polar object with the pvalues between groups of interest.
Created by polar_coords
.
The cut-off for adjusted pvalue significance (default = 0.05).
Whether to use pvalue or padj for the colour coding significance cutoff.
The cut-off for fold change significance (default = 1).
Row numbers or names of values to be annotated/labelled (default = NULL).
The font size of labels (default = 3)
The font size of text (default = 10)
The alpha parameter for markers (default = 0.7).
The size of markers (default = 3)
Colour for marker outline (default = white)
Width for marker outline (default = 0.5)
The size for the legend (default = 1).
A character vector of labels to be used for colour coding.
If NULL c('Not Significant', paste('Padj <', `p_cutoff`)
,
paste('|FC| >', `fc_cutoff`)
,
paste('Padj <', `p_cutoff`, 'and |FC| >', `fc_cutoff`)
) is used.
How to factor the colour scheme. Colour by "none" for significance group (by p and fold change cut-off), "upregulated" colour- coded according to the upregulated groups, or "polar" for the significance group.
A character vector of colours to be used. This can be of length 3, 4, 7 or 8 depending on the colour coding desired.
If length is 3, c(a,b,c): Only the significant wings are highlighted (where p>p_cutoff and abs(fc)>fc_cutoff) on the graph:
a: padj <= p_cutoff & fc <= -1*fc_cutoff
b: padj <= p_cutoff & fc >= fc_cutoff
c: padj > p_cutoff | abs(fc) < fc_cutoff
If length is 4, c(a,b,c,d):
a: padj <= p_cutoff & abs(fc) >= fc_cutoff
b: padj <= p_cutoff & abs(fc) < fc_cutoff
c: padj > p_cutoff & abs(fc) >= fc_cutoff
d: padj < p_cutoff & abs(fc) < fc_cutoff
If length is 7 the `polar@polar$sig` is used to colour code the probes. `colour_scheme` must be set to 'polar'
If length is 8 c(a,b,c,d,e,f,g,h): Each significance group is colour-coded
a: padj <= p_cutoff & fc <= -1*fc_cutoff
b: padj <= p_cutoff & -1*fc_cutoff < fc <= 0
c: padj <= p_cutoff & 0 < fc < fc_cutoff
d: padj <= p_cutoff & fc >= fc_cutoff
e: padj > p_cutoff & fc <= -1*fc_cutoff
f: padj > p_cutoff & -1*fc_cutoff < fc <= 0
g: padj > p_cutoff & 0 < fc < fc_cutoff
h: padj > p_cutoff & fc >= fc_cutoff
Logical whether to add vertical dashed line at fc_cutoff (default = TRUE).
Logical whether to add horizontal dashed line at p_cutoff (default = TRUE).
A character vector stating the colour of lines to be used for fc_line and p_line respectively (default = c('black', 'black')).
Logical whether plots should share axes when plotted together.
Returns a list of ggplot volcano plots. The first three elements contain comparisons between all contrasts. The last element in the list is a combined figure for all three plots.
Lewis, Myles J., et al. (2019). Molecular portraits of early rheumatoid arthritis identify clinical and treatment response phenotypes. Cell reports, 28:9
# NOT RUN {
data(example_data)
syn_polar <- polar_coords(sampledata = syn_example_meta,
contrast = "Pathotype",
groups = NULL,
pvalues = syn_example_p,
expression = syn_example_rld,
p_col_suffix = "pvalue",
padj_col_suffix = "padj",
non_sig_name = "Not Significant",
multi_group_prefix = "LRT",
significance_cutoff = 0.01,
fc_col_suffix='log2FoldChange',
fc_cutoff = 0.3)
syn_volcano_plots <- volcano_trio(polar=syn_polar)
syn_volcano_plots$All
# }
Run the code above in your browser using DataLab