Skip to contents

Applies a threshold and pools any taxa below this threshold, across samples and optionally, across a variable.

Usage

pool_taxa(
  rel_abund_tb,
  threshold,
  n_taxa = 12,
  keep_metadata = FALSE,
  label = FALSE
)

Arguments

rel_abund_tb

A rel_abund table in tibble format.

threshold

A numeric vector for the threshold.

n_taxa

The number of taxa to display.

keep_metadata

Logical. Whether to keep metadata or not.

label

Logical. Whether to show threshold in label.

Value

A tibble.

Examples

rel_abund_phy(physeq) %>% pool_taxa()
#> # A tibble: 300 × 3
#>    sample_id taxon           rel_abund
#>    <chr>     <chr>               <dbl>
#>  1 Smp1      Actinomycetota 0.00290   
#>  2 Smp1      Bacillota      0.00000212
#>  3 Smp1      Bacteroidota   0.000667  
#>  4 Smp1      Other          0.00333   
#>  5 Smp1      Pseudomonadota 0.00183   
#>  6 Smp1      Spirochaetota  0.00000635
#>  7 Smp10     Actinomycetota 0.000110  
#>  8 Smp10     Bacillota      0.0000191 
#>  9 Smp10     Bacteroidota   0.0000508 
#> 10 Smp10     Other          0.00626   
#> # ℹ 290 more rows