Create a table of most frequent taxa in a data.frame

createTaxonTable(dat, n = 10)

Arguments

dat

data.frame produced by importBugSigDB, subsetted as desired

n

number of taxa to return (if sig.type=="both", this is the number of taxa to return for each direction)

Value

kable table with increased and decreased taxa and a binomial test based on total number of studies in the data.frame

Examples

full.dat <- bugsigdbr::importBugSigDB()
#> Using cached version from 2025-05-05 19:21:34
createTaxonTable(full.dat, n=20)
#> # A tibble: 20 × 15
#>    `Taxon Name`       `Taxonomic Level` total_signatures increased_signatures
#>    <chr>              <chr>                        <int>                <int>
#>  1 Bacteroides        genus                          631                  282
#>  2 Prevotella         genus                          624                  318
#>  3 Lachnospiraceae    family                         594                  264
#>  4 Streptococcus      genus                          579                  363
#>  5 Lactobacillus      genus                          521                  317
#>  6 Oscillospiraceae   family                         456                  225
#>  7 Bacillota          phylum                         452                  212
#>  8 Bifidobacterium    genus                          434                  225
#>  9 Faecalibacterium   genus                          434                  155
#> 10 Veillonella        genus                          392                  239
#> 11 Blautia            genus                          378                  171
#> 12 Pseudomonadota     phylum                         377                  243
#> 13 Actinomycetota     phylum                         376                  202
#> 14 Clostridium        genus                          366                  176
#> 15 Ruminococcus       genus                          338                  136
#> 16 Roseburia          genus                          336                  107
#> 17 Eubacteriales      order                          330                  147
#> 18 Bacteroidota       phylum                         329                  152
#> 19 Haemophilus        genus                          325                  128
#> 20 Enterobacteriaceae family                         317                  218
#> # ℹ 11 more variables: decreased_signatures <int>, `Binomial Test pval` <dbl>,
#> #   kingdom <chr>, phylum <chr>, class <chr>, order <chr>, family <chr>,
#> #   genus <chr>, species <chr>, n_signatures <int>, metaphlan_name <fct>