Hello, I'm currently using the R package to analyze 16S data (dada2 and phyloseq). As a result, I built a phyloseq object in R, which I then wanted to import into qiime2 to continue the analysis:- However, I'm having problems and need assistance.
In R
Export taxonomy table as "tax.txt"
tax<-as(tax_table(ps),"matrix")
tax_cols <- colnames(tax)
tax<-as.data.frame(tax)
tax$taxonomy<-do.call(paste, c(tax[tax_cols], sep=";"))
for(co in tax_cols) tax[co]<-NULL
write.table(tax, "tax.txt", quote=FALSE, col.names=FALSE, sep="\t")
Export feature/OTU table
As a biom file
library(biomformat);packageVersion("biomformat")
[1] '1.6.0'
#if taxa are rows = FALSE
otu<-t(as(otu_table(ps),"matrix")) # 't' to transform if taxa_are_rows=FALSE
#if taxa_are_rows=TRUE
otu<-as(otu_table(prevabun_tree0),"matrix")
otu_biom<-make_biom(data=otu)
write_biom(otu_biom,"otu_biom.biom")
Export metadata
write.table(sample_data(ps),"sample-metadata.txt", sep="\t", row.names=FALSE, col.names=TRUE, quote=FALSE)
The phylogenetic tree was extracted from the ps object (which was identical to the ones above) and imported as an unrooted tree into qiime2.
The biom file, tax, and metadata were then loaded into qiime2. This became successful. When I tried to use the following command, however, it didn't work.
qiime feature-table summarize
--i-table feature-table.qza
--o-visualization feature-table.qzv
--m-sample-metadata-file sample-metadata-inter.txt
I'm getting an error that's related to this query. (qiime2-q2cli-err-luqiime2-q2cli-err-ludqvmq0.txt (3.6 MB) dqvmq0) - The log file can be found here.
Further trial on taxonomy bar plot generate an error (qiime2-q2cli-err-oofkziqbqiime2-q2cli-err-oofkziqb.txt (3.6 MB) )The lof file can be found here
qiime taxa barplot
--i-table feature-table.qza
--i-taxonomy taxonomy.qza
--m-metadata-file sample-metadata-inter.txt
--o-visualization taxa-bar-plots.qzv
Here is the list of variables in the metadata (few examples)
sample-id
Baseline-Endline
school
Intervention-groups
I appreciate your help in advance.