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

**URL:** https://forum.qiime2.org/t/which-approach-is-the-most-up-to-date-for-using-qsv-files-in-r/32089
**Category:** User Support
**Created:** [December 9, 2024, 4:12pm UTC](https://forum.qiime2.org/t/which-approach-is-the-most-up-to-date-for-using-qsv-files-in-r/32089 "2024-12-09T16:12:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Joeee](https://forum.qiime2.org/user_avatar/forum.qiime2.org/joeee/32/19626_2.png) [@Joeee](https://forum.qiime2.org/u/Joeee)
#### Post date: [December 9, 2024, 4:12pm UTC](https://forum.qiime2.org/t/which-approach-is-the-most-up-to-date-for-using-qsv-files-in-r/32089/1 "2024-12-09T16:12:50Z")

</div>

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](https://forum.qiime2.org/t/creating-a-relative-abundance-bar-plot-in-r-with-qiime2-data/30574)

[Tutorial: Integrating QIIME2 and R for data visualization and analysis using qiime2R - Community Contributions / Tutorials - QIIME 2 Forum](https://forum.qiime2.org/t/tutorial-integrating-qiime2-and-r-for-data-visualization-and-analysis-using-qiime2r/4121)

> [@Creating a relative abundance bar plot in R with qiime2 data](https://forum.qiime2.org/t/creating-a-relative-abundance-bar-plot-in-r-with-qiime2-data/30574/4):
>
> Sorry to double-post! I've been meaning to post a modern example, so here goes! Because I usually run qiime taxa barplot anyway, I just import that .qzv file into R. This uses Base R + Tidyverse (no Phylose, not even qiime2r!) Full code on GitHub:

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

---

<div class="post-metadata">

### Author: ![gregcaporaso](https://forum.qiime2.org/user_avatar/forum.qiime2.org/gregcaporaso/32/17769_2.png) [@gregcaporaso](https://forum.qiime2.org/u/gregcaporaso)
#### Post date: [December 9, 2024, 4:56pm UTC](https://forum.qiime2.org/t/which-approach-is-the-most-up-to-date-for-using-qsv-files-in-r/32089/3 "2024-12-09T16:56:48Z")

</div>



---

<div class="post-metadata">

### Author: ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)
#### Post date: [December 9, 2024, 5:46pm UTC](https://forum.qiime2.org/t/which-approach-is-the-most-up-to-date-for-using-qsv-files-in-r/32089/5 "2024-12-09T17:46:04Z")

</div>

Hello Joe,

> [@Joeee](#):
>
> I'm just curious whether there is a preferred method for linking data from Qiime2 into R in 2024.

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](https://docs.qiime2.org/2024.10/tutorials/moving-pictures-usage/).

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/4/a/4ae874466eb8a363cbefa834c275f83e207ca4a9.png)

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.

---

<div class="post-metadata">

### Author: ![Joeee](https://forum.qiime2.org/user_avatar/forum.qiime2.org/joeee/32/19626_2.png) [@Joeee](https://forum.qiime2.org/u/Joeee)
#### Post date: [December 9, 2024, 6:35pm UTC](https://forum.qiime2.org/t/which-approach-is-the-most-up-to-date-for-using-qsv-files-in-r/32089/6 "2024-12-09T18:35:25Z")

</div>

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.

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/9/d/9d5c7dd7c637d4b6aeee3d828819dd22f5ecaca7.png)

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

---

<div class="post-metadata">

### Author: ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)
#### Post date: [December 9, 2024, 8:11pm UTC](https://forum.qiime2.org/t/which-approach-is-the-most-up-to-date-for-using-qsv-files-in-r/32089/7 "2024-12-09T20:11:07Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [January 10, 2025, 2:11am UTC](https://forum.qiime2.org/t/which-approach-is-the-most-up-to-date-for-using-qsv-files-in-r/32089/8 "2025-01-10T02:11:19Z")

</div>

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