This question was also asked on stack overflow
I have QIIME2 outputs (feature table, tree, taxonomy, and metadata) that I've imported into R using qiime2R (v. 0.99.6) ‘qza_to_phyloseq’ to create a phyloseq object. My QIIME feature table shows reasonable values for ASV abundance across all samples (n=16; feature table available upon request).
Problem: The otu_table the ASV values for an entire study (NCBI SRA accession PRJNA217520, named AS_Briggs_NGHP_17A in my data) are shown as 0. This is untrue according to QIIME2view outputs and core-metrics-results (generated following the moving pictures tutorial) and a barchart created using the phyloseq object. Additionally, some stats (alpha diversity) are calculated accurately yet other stats (core members of the microbiome) return errors citing the otu_table.
Ideal solution(s): 1) the otu_table from the phyloseq object is accurate, 2) I debug stats issues, and/or 3) all of the above.
Please see the following code and files for reproducibility below:
library("qiime2R")
library("phyloseq")
pyro_physeq<-qza_to_phyloseq(
features="/path/pyro_sg.table.qza",
tree="/path/pyro_sg.r.tree.qza",
taxonomy = "/path/pyro_sg.taxonomy.qza",
metadata = "/path/pyro_sg.met.short.txt")
#section out otu_table for ease
otu_table <- (otu_table(pyro_physeq))
otu_table #all SRRs are the study "AS_Briggs_NGHP_17A" except for the first two, SRR1539064 and SRR1795474
I am not expecting the majority of these values to be 0's. I can create barcharts with the same phyloseq object, which use the otu_table as the input.
plot_bar(pyro_physeq, fill="Class")
Alternatively, I've tried to section out the study "AS_Briggs_NGHP_17A" to visualize alone, and the barchart is how I'd expect. Similarly, I tried a quick shannon diversity analysis which was also calculated (and returned believable values).
phy_briggs <- subset_samples(pyro_physeq, name == "AS_Briggs_NGHP_17A")
plot_bar(phy_briggs, fill="Class")
div.sh <- data.frame(diversity(otu_ord, index = "shannon"))
HOWEVER, if I extract that otu_table it's all 0's. If I attempt to calculate the core microbiome using 'core_members' (R package microbiome), the 0's for all ASVs return errors.
pseq.core <- core_members(phy_briggs,prevalence = 50/100,detection = 1/100)
pseq.core
# returns 'character(0)', or to see the error:
pseq.core <- core(phy_briggs,prevalence = 50/100,detection = 1/100)
Error in validObject(.Object) : invalid class “otu_table” object:
OTU abundance data must have non-zero dimensions.
This also occurs for the full phyloseq object (pyro_physeq). Thoughts?
Data
feature table: https://www.dropbox.com/scl/fi/goav68y9osdhu6zoam2e0/pyro_sg.table.qza?rlkey=vzmbksfcpf1wvfyqy1frozxcs&dl=0
pyro_physeq
. Maybe just post the treefile and see if it looks reasonable. I appreciate the detail of the question, but to fully resolve this appears to be a lot of work. $\endgroup$