Description Usage Arguments Value Examples
View source: R/MWAS_visualization.R
This function creates a bar plot based on the output from "MWAS_stats()". This function is designed to visualize MWAS results in the case of discrete metabolic variables (e.g. target GC/MS metabolites).
1 2 3 4 5 |
MWAS_matrix |
numeric matrix resulting from the function "MWAS_stats()". |
alpha_th |
numeric value indicating the significance threshold. |
width |
numeric value indicating bar width. |
scale_color |
character vector corresponding to the 3-color scale that will be used to represent the association results. The first color of the scale indicates "no change", the second color indicates "downregulation", and the third color indicates "upregulation". |
legend_labs |
character vector containing the legend labels, according to scale_color. |
ylab |
character vector specifying a title for the y-axis. |
size_yaxis |
numeric value indicating the font size of y-axis title. |
size_ylab |
numeric value indicating the font size of y-axis labels. |
size_names |
numeric value indicating the font size of the metabolite ids displayed on the x-axis. |
angle_names |
numeric value indicating the angle in which the metabolite ids will be displayed on the x-axis. |
sort |
logical constant indicating whether the metabolites will be sorted based on MWAS results. |
A bar plot.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Load data
data(targetMetabo_SE)
## Test for association between diabetes and target_metabolites
T2D_model <- MWAS_stats (targetMetabo_SE, disease_id = "T2D",
confounder_ids = c("Age", "Gender", "BMI"),
assoc_method = "logistic")
## Bar plot
MWAS_barplot(T2D_model)
MWAS_barplot(T2D_model, width = 0.7) # change bar width
MWAS_barplot(T2D_model, width = 0.7, angle_names = 90)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.