Which approach is the most "up-to-date" for using .qsv files in R?

Hello, I've recently processed some 16S and ITS data (using the SILVA/UNITE dbs) with Qiime2 and am now in the stage of visualising my results in R.

I've already done some visualisations using phyloseq and the BIOM file I made, but the relative abundance graph takes ages to get produced and I seem to have wrote a never ending script (and much less efficient to the .qsv file I already have).

Consequently, I've been looking into alternate methods of using my Qiime2 data in R and found a few different threads. In particular these two threads:

Creating a relative abundance bar plot in R with qiime2 data - Other Bioinformatics Tools - QIIME 2 Forum

Tutorial: Integrating QIIME2 and R for data visualization and analysis using qiime2R - Community Contributions / Tutorials - QIIME 2 Forum

From the first post it seems like the method wrote by @colinbrislawn is the most straightforward and doesn't rely on phyloseq (which I only just learned isn't updated!) but I can't seem to replicate his usage in for my own .qsvs as I get the following errorL

Error in unzip(qvz.path, list = TRUE, exdir = tempdir()) :
unused argument (list = TRUE)

I'm just curious whether there is a preferred method for linking data from Qiime2 into R in 2024.

Thanks,
-Joe

1 Like

Hello Joe,

I was looking for something super simple and lightweight, which is why I rolled my own.
You can check out examples of loading Qiime2 data into R using reticulate in the multiple interfaces Moving Pictures Tutorial.

Let me see if I can help with this error:

Error in unzip(qvz.path, list = TRUE, exdir = tempdir()) :
unused argument (list = TRUE)

Are you running this from your Qiime2 conda environment? I ask because I'm using unzip() from the package:utils which should be included with Qiime2.

Thanks for the response and the link. My title was a little confusing, but I've already done all the processing/preparation on Qiime2 via BASH/Linux. I just wanted to see how I'd then look through the data on R. I've increasingly found that Qiime2 seems to have a built in feature for everything, but I want to make sure I know how to replicate analysis on R for my own learning!

For my script, I was running it directly in RStudio and not in the Qiime2 Conda environment but managed to re-work the code by using a regular script without functions:

qsv_testing <- unzip("16S-taxa-barplot.qzv", exdir = "16s_qsv_extract") #this works
level_5_data <- read.csv("16s_qsv_extract/9ed3786c-91e0-4588-9da6-5ede58731328/data/level-5.csv")

Which eventually allowed me to generate a plot that loads instantly (unlike the PhyloSeq one I made). I'm not sure what parameters I specifically want yet, but this is just the overall top 25 taxa by count (ignoring chloroplasts - unsure if this is a good choice) across all my samples. I fear asking somewhat redundant questions, but after figuring out how to extract the .qsv the files were relatively straightforward to work on.

Thanks for the link, I was entirely unaware it was possible to process the data through R itself using Qiime2!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.