knit_hits_table: Make knitr table of differential results

Description Usage Arguments Value Examples

Description

Make a table using knitr reporting the differential abundance/prevalence test results. Table caption is standardized based on the test and comparisons made.

Usage

1
2
knit_hits_table(hits, units = NULL, group1 = NULL, group2 = NULL,
  bold_rows = NULL)

Arguments

hits

results object containing significant hits, obtained from format_hits().

units

units that were used for differential test, one of c("OTUs", "Genera").

group1

First group that is being compared.

group2

Second group that is being compared.

bold_rows

List of row identifiers that should be highlighted.

Value

knitr table object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
x <- test_differential_prevalence(physeq, group = "Health_status", compare = c("T2D", "Healthy"))
y <- format_hits(x)
z <- knit_hits_table(y, units="OTUs", group1 = "T2D", group2 = "Healthy")
z

# Finding overlap between two result sets and highlighting common taxa.

res1 <- test_differential_abundance_Wilcoxon(physeq = physeq, group = "Health_status", compare = c("T2D", "Healthy"))
hits1 <- format_hits(res1)

res2 <- test_differential_abundance_Wilcoxon(physeq = physeq, group = "Health_status", compare = c("Prediabetic", "Healthy"))
hits2 <- format_hits(res2)

overlap <- intersect(hits1$table$Taxon, hits2$table$Taxon)

o1 = which(rownames(hits1$table) %in% overlap)
o2 = which(rownames(hits2$table) %in% overlap)

knit_hits_table(hits1, units="OTUs", group1="T2D", group2="Healthy", bold_rows = o1)
knit_hits_table(hits2, units="OTUs", group1="Prediabetic", group2="Healthy", bold_rows = o2)

## End(Not run)

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