Create a table for ternary plot ggtern R package.
prep_ternary(
x,
abund.thres = 1e-04,
prev.thres = 0.1,
group = NULL,
level = "lowest"
)
phyloseq-class
object
= 0.0001 check microbiome
package core function
remove taxa that are dectected at 0.0001 in less than prev.thres of samples
= 0.1 check microbiome
package core function
Grouping variable to compare, for this plot there has to be three groups in the data
= "Genus" Taxonomic level. If OTU/ASV level specify="lowest" Does not support phylum level aggregation
Tibble object.
Plots the mean relative abundance of taxa in 3 groups being compared.
library(microbiome)
library(microbiomeutilities)
library(dplyr)
data("zackular2014")
p0 <- zackular2014
prep_ternary(p0, group = "DiseaseState", abund.thres = 0.0001, level = "Genus", prev.thres = 0.25)
#> An additonal column Sam_rep with sample names is created for reference purpose
#> # A tibble: 73 × 11
#> # Groups: unique [73]
#> unique CRC H nonCRC Domain Phylum Class Order Family Genus OTUID
#> <chr> <dbl> <dbl> <dbl> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 Acetanae… 0.00995 0.0135 0.00858 Bacte… Firmi… Clos… Clos… Rumin… "Ace… Acet…
#> 2 Acidamin… 0.115 0.164 0.0846 Bacte… Firmi… Nega… Sele… Acida… "Aci… Acid…
#> 3 Actinomy… 0.0169 0.0338 0.0218 Bacte… Actin… Acti… Acti… Actin… "Act… Acti…
#> 4 Akkerman… 1.26 1.05 1.53 Bacte… Verru… Verr… Verr… Verru… "Akk… Akke…
#> 5 Alistipes 0.929 0.894 0.654 Bacte… Bacte… Bact… Bact… Riken… "Ali… Alis…
#> 6 Anaerosp… 0.00693 0.0132 0.00458 Bacte… Firmi… Clos… Clos… Clost… "Ana… Anae…
#> 7 Anaerost… 0.721 0.795 0.840 Bacte… Firmi… Clos… Clos… Lachn… "Ana… Anae…
#> 8 Anaerovo… 0.00364 0.0127 0.00499 Bacte… Firmi… Clos… Clos… Clost… "Ana… Anae…
#> 9 Bacteria… 0.0171 0.0271 0.137 Bacte… Actin… Acti… Cori… Corio… "" Bact…
#> 10 Bacteria… 0.0445 0.0311 0.0409 Bacte… Bacte… Bact… Bact… Porph… "" Bact…
#> # … with 63 more rows