View source: R/association_plot.R
association.plot | R Documentation |
This function visualizes different measures of association between features and the label, computed previously with the check.associations function
association.plot(siamcat, fn.plot=NULL, color.scheme = "RdYlBu",
sort.by = "fc", max.show = 50, plot.type = "quantile.box",
panels = c("fc", "auroc"), prompt=TRUE, verbose = 1)
siamcat |
object of class siamcat-class |
fn.plot |
string, filename for the pdf-plot. If |
color.scheme |
valid R color scheme or vector of valid R colors (must
be of the same length as the number of classes), defaults to |
sort.by |
string, sort features by p-value ( |
max.show |
integer, how many associated features should be shown,
defaults to |
plot.type |
string, specify how the abundance should be plotted, must
be one of these: |
panels |
vector, name of the panels to be plotted next to the
abundances, possible entries are |
prompt |
boolean, turn on/off prompting user input when not plotting into a pdf-file, defaults to TRUE |
verbose |
integer, control output: |
This function visualizes the results of the computations carried
out in the check.associations function. It produces a plot of the
top max.show
associated features at a user-specified significance
level alpha
.
For binary classification problems, the plot will show the distribution of the log10-transformed abundances for both classes, a P-value from the significance test, and user-selected panels for the effect size (AU-ROC, prevalence shift, or generalized fold change). For regression problems, the plot will show the Spearman correlation, the significance, and the linear model effect size.
Does not return anything, but instead produces association plot
# Example data
data(siamcat_example)
# Simple example
association.plot(siamcat_example, fn.plot = "./assoc_plot.pdf")
# Plot associations as box plot
association.plot(siamcat_example,
fn.plot = "./assoc_plot_box.pdf",
plot.type = "box")
# Additionally, sort by p-value instead of by fold change
association.plot(siamcat_example,
fn.plot = "./assoc_plot_fc.pdf",
plot.type = "box", sort.by = "p.val")
# Custom colors
association.plot(siamcat_example,
fn.plot = "./assoc_plot_blue_yellow.pdf",
plot.type = "box", color.scheme = c("cornflowerblue", "#ffc125"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.