plotConcordance: plotConcordance

View source: R/plotConcordance.R

plotConcordanceR Documentation

plotConcordance

Description

Produce a list of graphical outputs summarizing the between and within method concordance.

Usage

plotConcordance(concordance, threshold = NULL, cols = NULL)

Arguments

concordance

A long format data.frame produced by createConcordance function.

threshold

The threshold for rank (x-axis upper limit if all methods have a higher number of computed statistics).

cols

A named vector containing the color hex codes.

Value

A 2 elements list of ggplot2 class objects:

  • concordanceDendrogram which contains the vertically directioned dendrogram for the methods involved in the concordance analysis;

  • concordanceHeatmap which contains the heatmap of between and within method concordances.

See Also

createConcordance

Examples

data(ps_plaque_16S)

# Balanced design
my_splits <- createSplits(
    object = ps_plaque_16S, varName = "HMP_BODY_SUBSITE", balanced = TRUE,
    paired = "RSID", N = 10 # N = 100 suggested
)

# Make sure the subject ID variable is a factor
phyloseq::sample_data(ps_plaque_16S)[, "RSID"] <- as.factor(
    phyloseq::sample_data(ps_plaque_16S)[["RSID"]])

# Initialize some limma based methods
my_limma <- set_limma(design = ~ RSID + HMP_BODY_SUBSITE, 
    coef = "HMP_BODY_SUBSITESupragingival Plaque",
    norm = c("TMM", "CSS"))

# Set the normalization methods according to the DA methods
my_norm <- setNormalizations(fun = c("norm_edgeR", "norm_CSS"),
    method = c("TMM", "CSS"))

# Run methods on split datasets
results <- runSplits(split_list = my_splits, method_list = my_limma,
    normalization_list = my_norm, object = ps_plaque_16S)

# Concordance for p-values
concordance_pvalues <- createConcordance(
    object = results, slot = "pValMat", colName = "rawP", type = "pvalue"
)

# plot concordances from rank 1 to 50.
plotConcordance(
    concordance = concordance_pvalues,
    threshold = 50
)

mcalgaro93/benchdamic documentation built on March 10, 2024, 10:40 p.m.