KasperSkytte / ampvis2

Tools for visualising microbial community amplicon data
https://kasperskytte.github.io/ampvis2/
GNU General Public License v3.0
67 stars 23 forks source link

Ordination plots without samples. #36

Closed grabear closed 6 years ago

grabear commented 6 years ago

I'm having trouble getting an ordination plot without samples. All I want is the OTU ordination plot as in phyloseq.

KasperSkytte commented 6 years ago

Hi @grabear

Thank you for pointing it out, we may consider implementing that. It will probably not be in the near future though, so for now I can just show you how to do it manually:

library(ampvis2)
library(tidyverse)

d <- amp_subset_taxa(AalborgWWTPs, 
                     c("p__Actinobacteria",
                       "p__Bacteroidetes", 
                       "p__Cyanobacteria",
                       "p__Firmicutes", 
                       "p__Proteobacteria"))
res <- amp_ordinate(d,
                    type = "CA",
                    transform = "hellinger",
                    detailed_output = TRUE)
ggplot(res$dspecies, aes_string(x = "CA1",
                                y = "CA2", 
                                color = "Phylum")) +
  geom_point() +
  theme_classic()
grabear commented 6 years ago

Ok! Thanks I might work on that if you're not opposed to it? @KasperSkytte

KasperSkytte commented 6 years ago

Sure, give it a go! :)

KasperSkytte commented 6 years ago

@grabear I know this is from February, but did you give it a go? If so then there is no reason to spend time that has already been spent implementing it :)