View source: R/plotConcordance.R
plotConcordance | R Documentation |
Produce a list of graphical outputs summarizing the between and within method concordance.
plotConcordance(concordance, threshold = NULL, cols = NULL)
concordance |
A long format |
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. |
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.
createConcordance
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
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.