How to use qiime2r?

(Sebastian Sudek) #1

Thanks for the tutorial. I am mostly interested in the *.qza to phyloseq functionality. Having a bit of trouble with that. I get an error message using qza_to_phyloseq.

Error in unzip(file, exdir = tmp, list = TRUE) :
zip file ‘DSEL16_whaleSIPABC_metadata.tsv’ cannot be opened

I am sure I don’t just have a typo in the filename. Rather I am wondering if maybe qza_to_phyloseq expects exactly three qza files? (I only have two, OTU table and taxonomy)

0 Likes

Tutorial: Integrating QIIME2 and R for data visualization and analysis using qiime2R
(Jordan Bisanz) #2

Hi Sebastian,

The function only requires one file as a minimum. If you do not specify which files you are feeding qza_to_phyloseq it expects features, tree, taxonomy, then metadata (see ?qza_to_phyloseq). If I am correctly understanding, you do not have a taxonomy or tree file so you would need something like this:

phyobj<-qza_to_phyloseq(features="data/table.qza", metadata="data/sample-metadata.qza")
0 Likes

(Sebastian Sudek) #3

Hi Jordan,

that was very helpful, thanks a lot! I did have a taxonomy but was able to pull it into phyloseq using taxonomy=“filename” along with feature and metadata as you described.

cheers.
Sebastian

0 Likes

(Sebastian Sudek) #4

If I may ask another amateur question…

My taxonomy is from Silva, so e.g. looks like this:
OTU_4604 D_0__Bacteria;D_1__Spirochaetae;D_2__Spirochaetes;D_3__Spirochaetales;D_4__Spirochaetaceae;D_5__Spirochaeta 2;D_6__uncultured bacterium;D_7__;D_8__;D_9__;D_10__;D_11__;D_12__;D_13__;D_14__

It doesn’t get parsed into the default “Kingdom” “Phylum” etc. of phyloseq. As far as I can tell the entire example above is currently stored under “Kingdom”. Seems like I would need to separate based on “;” and also remove D_7 to D_14. But, do I need to manipulate the qza file before the move to phyloseq? or can this be done afterwards within the phyloseq object? And if so, how?

0 Likes

(Jordan Bisanz) #5

I would not recommend modifying the original qza file as this defeats some of the strengths of the format. Instead, I would manually import your taxonomy using read_qza() and work on the table itself, then manually build the phyloseq object from each individual qza as shown in the tutorial.

0 Likes