association.plot.Rd
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)
object of class siamcat-class
string, filename for the pdf-plot. If fn.plot
is
NULL
, the plot will be produced in the active graphics device.
valid R color scheme or vector of valid R colors (must
be of the same length as the number of classes), defaults to 'RdYlBu'
string, sort features by p-value ("p.val"
), by fold
change ("fc"
) or by prevalence shift ("pr.shift"
),
defaults to "fc"
integer, how many associated features should be shown,
defaults to 50
string, specify how the abundance should be plotted, must
be one of these: c("bean", "box", "quantile.box", "quantile.rect")
,
defaults to "quantile.box"
vector, name of the panels to be plotted next to the
abundances, possible entries are c("fc", "auroc", "prevalence")
,
defaults to c("fc", "auroc")
boolean, turn on/off prompting user input when not plotting into a pdf-file, defaults to TRUE
integer, control output: 0
for no output at all,
1
for only information about progress and success, 2
for
normal level of information and 3
for full debug information,
defaults to 1
Does not return anything, but instead produces association plot
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.
# Example data
data(siamcat_example)
# Simple example
association.plot(siamcat_example, fn.plot = "./assoc_plot.pdf")
#> Plotted associations between features and label successfully to: ./assoc_plot.pdf
# Plot associations as box plot
association.plot(siamcat_example,
fn.plot = "./assoc_plot_box.pdf",
plot.type = "box")
#> Plotted associations between features and label successfully to: ./assoc_plot_box.pdf
# 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")
#> Plotted associations between features and label successfully to: ./assoc_plot_fc.pdf
# Custom colors
association.plot(siamcat_example,
fn.plot = "./assoc_plot_blue_yellow.pdf",
plot.type = "box", color.scheme = c("cornflowerblue", "#ffc125"))
#> Plotted associations between features and label successfully to: ./assoc_plot_blue_yellow.pdf