# Example 1: Humboldt Sulfuretum (Fonseca et al., 2022)
file <- system.file("extdata/DADA2/FEN+22/ps_FEN+22.rds", package = "chem16S")
physeq <- readRDS(file)
# Get lowest-level (to genus) classification for each OTU
taxacounts <- ps_taxacounts(physeq)
# Show numbers of assignments at each taxonomic level
table(taxacounts$rank)
# Map taxonomic names
map <- map_taxa(taxacounts)
# Taxonomy and reference proteomes are both from GTDB,
# so there are no unmapped classifications
sum(attr(map, "unmapped_percent")) # == 0
# Calculate chemical metrics
ps_metrics(physeq)
# Example 2: GlobalPatterns dataset from phyloseq
data(GlobalPatterns, package = "phyloseq")
# Plot metrics grouped by sample type and sorted by mean Zc;
# refdb = "RefSeq" uses manual mappings from the RDP to NCBI taxonomy
p <- plot_ps_metrics(GlobalPatterns, x = "SampleType",
sortby = "Zc", refdb = "RefSeq")
# Change orientation of x-axis labels
p + ggplot2::theme(axis.text.x = ggplot2::element_text(
angle = 45, vjust = 1, hjust = 1))
Run the code above in your browser using DataLab