phy_betaPlot | R Documentation |
The function wraps the phyloseq functions "distance", "ordinate", and "plot_ordination", also adding some fancier represantations, called "spiders", "hulls" and "ellipses".
phy_betaPlot( physeq, dist = "bray", method = "PCoA", axes = 1:2, color, shape = NULL, visual_grouping = NULL, palette = "standard", ncores = 1, label_centroids = TRUE )
physeq |
A phyloseq object, **CAREFUL**: the function doesn't transform internally, so if you choose to calculate the distance matrix internally with "ordinate", make sure you transform the counts prior to function call (usually relative abundance is accepted) |
dist |
Distance object or character vector saying the distance metric to apply |
method |
One of the methods allowed by "ordinate" in the phyloseq object |
axes |
The axes to be plotted, default are the first 2, which should discriminate samples better |
color |
The variable to color the samples by. Only metadata variables are supported, to color taxa, use betaPlotTaxa |
shape |
Should you want to further differentiate your points. the default is that shapes are chosen based on the color variable |
visual_grouping |
This is the cool parameter of this function. the allowed ones are "spiders", "hulls" and "ellipses" |
palette |
Similarly to ggpubr's "palette" parameters, the function allows for a palette name, (default is "standard", the ggplot2 default palette). All palettes in the ggsci package are allowed too |
ncores |
A |
label_centroids |
A |
a ggplot2 object
data("enterotype") phy_betaPlot(physeq = enterotype, dist = "bray", method = "PCoA", axes = 1:2, color = "SeqTech", visual_grouping = "spiders", palette = "jco")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.