Raw data for gneiss proportion boxplot

Hi, all!

I recently ran gneiss balance taxonomy in qiime2 v2019.1 (code below) and wanted to recreate the proportion plot output from the summary qzv file in R. However, I don't see any options for downloading the raw data underlying the figure. There's only a "download pdf" option (which leads to a failed download due to "No file").

Is there another place I should be looking for the proportion plot data?

Code for balance taxonomy:

qiime gneiss balance-taxonomy
--i-table filtered-table.qza
--i-tree hierarchy.qza
--m-metadata-file metadata.tsv
--m-metadata-column "Phenotype"
--i-taxonomy taxonomy.qza
--p-taxa-level 2
--p-balance-name 'y0'
--o-visualization y0-taxa-summary.qzv

Many thanks!

Hi @adecandia - all of the raw data is available in the input data types, namely filtered-table.qza, hierarchy.qza and metadata.tsv. It mainly boils down to unzipping those files and loading them into Python/R.

1 Like

Hi @mortonjt, thanks for your reply!

I looked into downloading the data in those files, but had trouble with the hierarchy file. Whenever I’ve downloaded .qza data in the past, I’ve first converted it to a .qzv file, loaded the file into Qiime2-View, and downloaded the data as a tsv. However, when I ran the following code, I received an error message:

qiime metadata tabulate
–m-input-file hierarchy.qza
–o-visualization hierarchy.qzv

error: **There was an issue with viewing the artifact hierarchy.qza as QIIME 2 Metadata:
Artifact <artifact: Hierarchy uuid: 44afee69-efbc-4390-8f3f-36b5e97d63db> cannot be viewed as QIIME 2 Metadata.

Is there another way to download this data? I don’t think I can recreate the boxplot figure using just the filtered table, balances, etc.

Alternatively, is there another way to obtain the raw data (or at least the algorithm used internally by gneiss) to make the boxplot figure? For example, the alpha rarefaction qzv file allows you to download a CSV with the underlying data in Qiime2 View. I believe alpha group significance qzv files do the same. This makes it a lot faster to recreate figures in R/Python.

Thanks for your help!

1 Like

Use qiime tools export to export the data from hierarchy.qza. You cannot use metadata tabulate to view those data because it has the wrong data format.

Good luck!

1 Like

Perfect, thank you! That export function worked beautifully. I was able to get my hierarchy exported as a .nwk file, and visualized the tree via https://itol.embl.de/upload.cgi

I am still struggling with the proportion plots, however. How exactly are those proportions calculated? Using my taxon abundances, I have calculated:

(1) feature count/SUM(all feature counts in dataset) per group
(2) feature count/SUM(all feature counts in balance numerator) per group
(3) feature count/SUM(all feature counts in balance denominator) per group
(4) feature count/SUM(all feature counts in balance numerator+denominator) per group

but none of those calculations matched the proportions given in my balance taxonomy output (figure above in first post). What proportions do those figures contain? And how may I go about calculating them with my taxa abundance data?

I have been referencing the code underlying gneiss (https://github.com/biocore/gneiss/blob/master/gneiss/plot/_decompose.py#L14), but haven’t found the answer. It seems the proportion calculation is (lambda x: x / x.sum(), axis=1) but I can’t figure out what exactly x and x.sum refer to.

Many thanks for your time and help!

1 Like

Hi @adecandia,

Glad to hear that the export function worked!

The proportions plots are generated from the proportions of the feature table - the counts are normalized so that the microbe abundances sum to 1 for every sample (this is what the lambda function does)

Once the proportions are obtained, then the mean proportions / std deviations per group are plotted as shown above.

Hi @mortonjt,

Your post solved my problem! Thank you so much! I had been looking at the wrong feature table, which explains why my calculated proportions were off. I was able to export the (correct) feature table, add taxonomy information, and calculate the proper proportions to remake my figures.

Much appreciated for your patience and help!

All best,


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