Hi all,
I know this isn’t 100% related to qiime2 since it also involves phyloseq so I am posting in the general discussion section.
I just discovered that the relative abundance plots I’ve made in phyloseq match none of my qiime2 taxa bar plots.
Here is an example.
Phyloseq:
qiime2:
I trust the qiime2 one more since it makes a lot more sense biologically. It appears that the microbiome diversity is getting “homogenized” after importing into phyloseq.
Here is my phyloseq code. I have tried making the plot pre filtering, post filtering, merging samples by metadata column in qiime2 and then importing, but nothing works.
Any ideas?
setwd(“C:/Users/samde/OneDrive - UCLA IT Services/Fish Project/ISLAND COMPILED PROJECT”)
otu_table=read.csv(“i3otumerged.csv”,sep=",",row.names=1, header=TRUE)
destroyX(otu_table)
otu_table=as.matrix(otu_table)
taxonomy=read.csv(“i3taxonomymerged.csv”,sep=",",row.names=1,header=TRUE)
taxonomy=as.matrix(taxonomy)
#dont forget header=TRUE for metadata
metadata=read.csv(“compiled_island_metadata.csv”,row.names=1,header=TRUE)
phy_tree=read.tree(“i3tree.nwk”)
OTU=otu_table(otu_table, taxa_are_rows=TRUE)
TAX=tax_table(taxonomy)
META=sample_data(metadata)
#tree already imported as a phyloseq object
#merge into phyloseq object
isl=phyloseq(OTU,TAX,META,phy_tree)
islim <- merge_samples(islclean, “Tax”)
imr=rarefy_even_depth(im)
imr
imrt=transform_sample_counts(imr, function(x) x/sum(x))
ip=tax_glom(im,taxrank=“Phylum”)
ipt=transform_sample_counts(ip, function(x) x/sum(x))imP=tax_glom(im,taxrank=“Phylum”)
imPf = filter_taxa(imP, function(x) sum(x > 0) > (0.000001*length(x)), TRUE)
imPf
imPfr=rarefy_even_depth(imPf)
imPfr
imPfrt=transform_sample_counts(imPfr, function(x) x/sum(x))ip=plot_bar(imPfrt,fill=“Phylum”)
ip2=(ip+geom_bar(aes(fill=Phylum),stat=“identity”))
ip2