check.associations: Check and visualize associations between features and classes

Description Usage Arguments Details Value Examples

View source: R/check_associations.r

Description

This function computes different measures of association between features and the label and visualizes the results

Usage

1
2
3
4
5
6
check.associations(siamcat, fn.plot=NULL, 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"), prompt = TRUE,
    feature.type = 'filtered', verbose = 1)

Arguments

siamcat

object of class siamcat-class

fn.plot

string, filename for the pdf-plot. If fn.plot is NULL, the plot will be produced in the active graphics device.

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

string, 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. Will be ignored if feature.type is "normalized".

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 abundances, possible entries are c("fc", "auroc", "prevalence"), defaults to c("fc", "auroc")

prompt

boolean, turn on/off prompting user input when not plotting into a pdf-file, defaults to TRUE

feature.type

string, on which type of features should the function work? Can be either c()"original", "filtered", or "normalized"). Please only change this paramter if you know what you are doing!

If feature.type is "normalized", the normalized abundances will not be log10-transformed.

verbose

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

Details

For each feature, this function calculates different measures of association between the feature and the label. In detail, these associations are:

Finally, the function produces a plot of the top max.show associated features at a user-specified significance level alpha, 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).

Value

object of class siamcat-class with the slot associations filled

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Example data
data(siamcat_example)

# Simple example
siamcat_example <- check.associations(siamcat_example,
    fn.plot='./assoc_plot.pdf')

# Plot associations as box plot
siamcat_example <- check.associations(siamcat_example,
    fn.plot='./assoc_plot_box.pdf', plot.type='box')

# Additionally, sort by p-value instead of by fold change
siamcat_example <- check.associations(siamcat_example,
    fn.plot='./assoc_plot_fc.pdf', plot.type='box', sort.by='p.val')

# Custom colors
siamcat_example <- check.associations(siamcat_example,
    fn.plot='./assoc_plot_blue_yellow.pdf', plot.type='box',
    color.scheme=c('cornflowerblue', '#ffc125'))

SIAMCAT documentation built on Nov. 8, 2020, 5:14 p.m.