Closed marwa38 closed 2 years ago
I am afraid that I can't answer your question until a reproducible example of your phyloseq
object is provided.
Dear @gaospecial sorry for my late reply here is a phyloseq object in form of .rds (zipped) ps.prev.rooted.zip please let mem know Cheers M
Hi @gaospecial again Incase more clarification is needed, I want to create Venn diagrams of ASVs for each group examples that I need to create from my above-shared dataset Thanks M
FYI.
d = readRDS("ps.prev.rooted.rds")
sample = sample_data(d)
library(dplyr)
sample_origin = sample$sample %>% unique()
get_otu = function(x){
otu = otu_table(x)
otu_count = colSums(otu)
otu_name = names(otu_count)
otu_name[otu>0]
}
list = vector("list", length = 3)
list[[1]] = subset_samples(d, Sample == sample_origin[[1]]) %>% get_otu()
list[[2]] = subset_samples(d, Sample == sample_origin[[2]]) %>% get_otu()
list[[3]] = subset_samples(d, Sample == sample_origin[[3]]) %>% get_otu()
library(ggVennDiagram)
ggVennDiagram(list, category.names = sample_origin)
Could you please let me know how to transform my phyloseq object to be accepted as input data to use ggVennDiagram? Many thanks M