Description Usage Arguments Value Examples
View source: R/check_associations.r
This function calculates for each feature a pseudo-fold change (geometrical mean of the difference between quantiles) between the different classes found in labels.
Significance of the differences is computed for each feature using a Wilcoxon test followed by multiple hypothesis testing correction.
Additionally, the Area Under the Receiver Operating Characteristic Curve
(AU-ROC) and a prevalence shift are computed for the features found to be
associated with the two different classes at a user-specified
significance level alpha
.
Finally, the function produces a plot of the top max.show
associated features, showing the distribution of the log10-transformed
abundances for both classes, and user-selected panels for the effect
(AU-ROC, Prevalence Shift, and Fold Change)
1 2 3 4 | check.associations(siamcat,fn.plot,color.scheme = "RdYlBu",
alpha =0.05,mult.corr = "fdr", sort.by = "fc",detect.lim = 1e-06,
pr.cutoff = 1e-6, max.show = 50, plot.type = "quantile.box",
panels = c("fc","auroc"),verbose = 1)
|
siamcat |
object of class siamcat-class |
fn.plot |
filename for the pdf-plot |
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 |
alpha |
float, significance level, defaults to |
mult.corr |
multiple hypothesis correction method, see
|
sort.by |
string, sort features by p-value ( |
detect.lim |
float, pseudocount to be added before log-transformation of
the data, defaults to |
pr.cutoff |
float, cutoff for the prevalence computation, defaults to
|
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 log10-
transformed abundances, possible entries are |
verbose |
control output: |
Does not return anything, but produces an association plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Example data
data(siamcat_example)
# since the whole pipeline has been run in the example data, exchange the
# normalized features with the original features
siamcat_example <- reset.features(siamcat_example)
# Simple example
check.associations(siamcat_example, './assoc_plot.pdf')
# Plot associations as bean plot
check.associations(siamcat_example, './assoc_plot_bean.pdf',
plot.type='bean')
# Plot assocations as box plot
# Additionally, sort by p-value instead of by fold change
check.associations(siamcat_example, './assoc_plot_fc.pdf',
plot.type='box', sort.by='p.val')
# Custom colors
check.associations(siamcat_example, './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.