format_hits: Format differential test results to be presentable

Description Usage Arguments Value Examples

Description

Format differential abundance/prevalence results for elegant presentation, selecting only the significant hits.

Usage

1
format_hits(results, p.adjust.threshold = 0.1, p.adjust.method = NULL)

Arguments

results

Results from test_differential_abundance_DESeq2(), or test_differential_abundance_Wilcoxon() or test_differential_prevalence().

p.adjust.threshold

Adjusted P-value threshold to use when returning the significant hits.

p.adjust.method

P-value adjustment method, in case you want it to be re-estimated. Use this only if you know what you are doing!!

Value

Returns a list containing all the entities in the input results variable, with the following changes:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 

# Run DESeq2

x <- test_differential_abundance_DESeq2(physeq, group = "Health_status", compare = c("T2D", "Healthy"))
y <- format_hits(x, p.adjust.method= "bonferroni") # Overwrite DESeq's FDR padj with Bonferroni padj
z <- format_hits_for_heatmap(y)
draw_taxa_heatmap(physeq, taxa_data = z, group = "Health_status", compare = c("T2D", "Healthy"))

# Run Wilcoxon rank sum test

x <- test_differential_abundance_Wilcoxon(physeq, group = "Health_status")
y <- format_hits(x)
z <- format_hits_for_heatmap(y)
draw_taxa_heatmap(physeq, taxa_data = z, group = "Health_status", block = "Enterotype")

# Set up custom palette
pal = list(Health_status = "Set2", Enterotype = "Pastel1", Significance = "PuRd")

# Run differential prevalence test

x <- test_differential_prevalence(physeq, group = "Health_status")
y <- format_hits(x)
z <- format_hits_for_heatmap(y, p.adjust.threshold = 0.01)
draw_taxa_heatmap(physeq, taxa_data = z, group = "Health_status", custom_palette = pal)

## End(Not run)

TBrach/MicrobiomeX documentation built on May 14, 2019, 2:28 p.m.