| umap_pq | R Documentation |
https://journals.asm.org/doi/full/10.1128/msystems.00691-21
umap_pq(physeq, pkg = "umap", ...)
physeq |
(required) a |
pkg |
Which R packages to use, either "umap" or "uwot". |
... |
Additional arguments passed on to |
This function is mainly a wrapper of the work of others.
Please make a reference to umap::umap() if you
use this function.
A dataframe with samples informations and the x_umap and y_umap position
Adrien Taudière
umap::umap(), tsne_pq(), phyloseq::plot_ordination()
library("umap")
data_f <- prune_samples(
sample_names(data_fungi_mini)[1:20],
data_fungi_mini
)
df_umap <- umap_pq(data_f, n_neighbors = 3)
ggplot(df_umap, aes(x = x_umap, y = y_umap, col = Height)) +
geom_point(size = 2)
## Not run:
df_uwot <- umap_pq(data_fungi_mini, pkg = "uwot")
library(patchwork)
physeq <- data_fungi_mini
df_umap <- umap_pq(physeq, n_neighbors = 3)
res_tsne <- tsne_pq(data_fungi_mini)
df_umap_tsne <- df_umap
df_umap_tsne$x_tsne <- res_tsne$Y[, 1]
df_umap_tsne$y_tsne <- res_tsne$Y[, 2]
((ggplot(df_umap, aes(x = x_umap, y = y_umap, col = Height)) +
geom_point(size = 2) +
ggtitle("UMAP")) +
(plot_ordination(physeq,
ordination = ordinate(physeq, method = "PCoA", distance = "bray"),
color = "Height"
) + ggtitle("PCoA"))) /
((ggplot(df_umap_tsne, aes(x = x_tsne, y = y_tsne, col = Height)) +
geom_point(size = 2) +
ggtitle("tsne")) +
(plot_ordination(physeq,
ordination = ordinate(physeq, method = "NMDS", distance = "bray"),
color = "Height"
) + ggtitle("NMDS"))) +
patchwork::plot_layout(guides = "collect")
(ggplot(df_umap, aes(x = x_umap, y = y_umap, col = Height)) +
geom_point(size = 2) +
ggtitle("umap::umap")) /
(ggplot(df_uwot, aes(x = x_umap, y = y_umap, col = Height)) +
geom_point(size = 2) +
ggtitle("uwot::umap2"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.