Simple wrapper around tax_sort that:
optionally aggregates taxa at
rank
sorts the aggregated taxa according to
by
returns the top
n
number of taxa names
Arguments
- data
phyloseq object or psExtra
- n
how many taxa names to return, or NA for all (can return fewer than n values, if there are fewer to return)
- by
how to sort taxa (see
?tax_sort()
), defaults tosum
which sorts by total abundance across all samples- rank
taxonomic rank to aggregate at before calculating ("unique" = no aggregation)
- use_counts
use count data if available, instead of transformed data
- ...
Arguments passed on to
tax_sort
verbose
passed to phyloseq_validate verbose (if TRUE: message about suspicious values in tax_table, and how to fix)
trans
name of transformation to apply to taxa before sorting (taxa are returned un-transformed)
Examples
data("dietswap", package = "microbiome")
tax_top(dietswap)
#> [1] "Prevotella melaninogenica et rel."
#> [2] "Oscillospira guillermondii et rel."
#> [3] "Bacteroides vulgatus et rel."
#> [4] "Clostridium cellulosi et rel."
#> [5] "Prevotella oralis et rel."
#> [6] "Faecalibacterium prausnitzii et rel."
#> [7] "Sporobacter termitidis et rel."
#> [8] "Clostridium symbiosum et rel."
#> [9] "Allistipes et rel."
#> [10] "Clostridium orbiscindens et rel."
tax_top(dietswap, n = 4, by = "prev", rank = "Phylum", undetected = 30)
#> [1] "Firmicutes" "Proteobacteria" "Bacteroidetes" "Actinobacteria"