check.associations {SIAMCAT} | R Documentation

## Check and visualize associations between features and classes

### Description

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)

### Usage

    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)

### Arguments

`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 `'RdYlBu'`
`alpha` | float, significance level, defaults to `0.05`
`mult.corr` | multiple hypothesis correction method, see `p.adjust`, defaults to `"fdr"`
`sort.by` | string, sort features by p-value (`"p.val"`), by fold change (`"fc"`) or by prevalence shift (`"pr.shift"`), defaults to `"fc"`
`detect.lim` | float, pseudocount to be added before log-transformation of the data, defaults to `1e-06`
`pr.cutoff` | float, cutoff for the prevalence computation, defaults to `1e-06`
`max.show` | integer, how many associated features should be shown, defaults to `50`
`plot.type` | string, specify how the abundance should be plotted, must be one of these: `c("bean", "box", "quantile.box", "quantile.rect")`, defaults to `"quantile.box"`
`panels` | vector, name of the panels to be plotted next to the log10- transformed abundances, possible entries are `c("fc", "auroc", "prevalence")`, defaults to `c("fc", "auroc")`
`verbose` | 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`

### Value

Does not return anything, but produces an association plot

### Examples

    # 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'))

[Package SIAMCAT version 1.0.0 Index]