Can gneiss operate on feature table collapsed on taxonomy?

I would like to discuss with you the genesis analysis I want to adopt. I have 16s hiseq sequences data analysed in qiime 2, I got table.qza, rep-seq.qza and taxonomy.qza for both old samples and new samples. I wanted to see if time changes the abundance of my bacteria taxa in my old and new samples, also whether this is significant.
when I did the analysis with this command without collapsing my taxa I got misleading outcomes as same taxa were showing in nominator and denominator see attached:
qiime gneiss balance-taxonomy
--i-table composition.qza
--i-tree hierarchy.qza
--i-taxonomy taxonomy-.qza
--p-taxa-level 6
--p-balance-name 'y0'
--m-metadata-file meta.txt
--m-metadata-column group
--o-visualization y0_taxa_summary.qzv

I wanted to collapse then do the same but it did not work. is there a way to collapse taxonomy ?

qiime taxa collapse
--i-table table.qza
--i-taxonomy taxonomy.qza
--p-level 6
--o-collapsed-table table.collapsed.qza
then I recalculated the composition and hierarchy from the collapsed table.
qiime gneiss balance-taxonomy
--i-table composition-collapsed-sg1.qza
--i-tree hierarchy-collapsed-sg1.qza
--i-taxonomy taxonomy.qza
--p-taxa-level 2
--p-balance-name 'y0'
--m-metadata-file meta.txt
--m-metadata-column group
--o-visualization y0_taxa_summary.qzv

Is there a way to collapse taxonomy-collapse.qza as the same like table-collapsse.qza ?

thanks a lot for your help and advice.

HI @Hajar,

That is a confusing output, but it makes absolute sense and is not misleading when you consider what gneiss is comparing here.

You are running gneiss on a feature table of sequence variants that have had taxonomic lineages assigned to them. There is no reason to expect that each unique sequence variant would have its own unique taxonomic lineage, and in fact many are going to be assigned the same exact lineage, some even the same species. It looks like you are examining genus-level results in gneiss, so it is absolutely sensible to expect that there will be multiple sequence variants with the same genus assignment, and there is no reason to expect that all of those will display the same behavior.

Nothing misleading here. You have multiple sequence variants with the same taxonomic assignments that behave differently under your experimental conditions.

Did you see this topic? Look around — it is possible but only with some level of effort. What you are doing now is the “correct” way to do things. Collapsing by taxonomy will reduce potentially important information.

I hope that helps!

1 Like

thanks a lot for your quick reply Nicholas_Bokulich,
Yes I saw the post before posting this, but unfortunately it did not answer clearly to my concern.

what I want is to get OTU differences between my samples at genus level 6, if it is not significant then I can move down to species level, I don’t know if it is equivalent to level 7 or 8…
I am not interested to check ASVs at this stage. Do you know how to do that in gneiss ?
I got table.collapsed.qza which is equivalent to OTU table. But I do not know how to collapse.taxa or how to collapse rep.seq.qza.
thanks a lot for your support.


This type of operation is not supported in q2-gneiss at the moment, so you would need to do some custom analysis to rig up your data. There is no way to collapse rep.seqs — it just does not make sense. You can “collapse” taxonomy.qza by exporting that file, trimming to level 6, finding all unique lineages, and exporting a new taxonomy file where the level 6 lineage is both the feature ID and the taxonomy. Import that and it should correspond. This is outside of QIIME2 and really a custom operation, so we can’t provide specific support on how to do it.

Good luck!

ok thanks a lot, I will do that.

Hi Nicholas_Bokulich,

I collapsed the taxonomy outside qiime 2 then imported to match the table collapsed at level 6, but I am still receiving the same error:
attached the files used:
composition-sg1-level6-only.qza (48.6 KB)
Taxonomy-l6-sg1.qza (245.1 KB)

the command and the error:
qiime gneiss balance-taxonomy
--i-table composition-sg1-level6-only.qza
--i-tree hierarchy-sg1-level6-only.qza
--i-taxonomy Taxonomy-l6-sg1.qza
--p-taxa-level 6
--p-balance-name 'y0'
--m-metadata-file /mnt/beegfs/scratch/eh309/analysis-lane1and2/ssa1sg1/ssa1sg1-meta.txt
--m-metadata-column group
--o-visualization y0_taxa_summary.qzv

Plugin error from gneiss:
"None of {..} are in the [index]"

hierarchy-sg1-level6-only.qza (18.0 KB)

Do you know why I am receiving this error?

Thanks a lot.

The index is not matching up — the feature IDs are likely different between your files, since you did some custom processing. You will need to make sure that the feature IDs in your feature table and taxonomy match exactly.

Thanks a lot, it worked fine.
I have another concern regarding the output. I have 20 taxa as input table.qza but in the output I see only 15 taxa and 5 taxa are missing. Is there a restriction on the maximum limit of taxa in the output ?

I am expecting to see all the proportions of my taxa in the final view: y0_taxa_summary.qzv.
Thanks for your help.


How many taxa are in your tree? If they aren’t in your tree, they will be filtered out.

Could be possible that these taxa have zero abundances, which will also cause them to be filtered out.

1 Like

thanks for your reply @ mortonjt,

In the tree I have 21 taxa, which is good as nothing was missing. But in the final view 5 of my taxa were filtered and one of them is the second abundant feature in my samples. I can’t understand why were filtered.

Thanks for your advice.

@Hajar, I’m not sure either what is going on - will need a bit more information to help diagnose this.

Could you post the updated files / commands you ran along with the output files? It looks like the files in the previous post are dated

Thanks a lot for your reply @mortonjt:
below the files used and the otputs:
hierarchy_sg1-1000-rep15.qza (12.4 KB)
composition_sg1-1000-rep15.qza (23.2 KB)
taxonomy_23-1000-rep15.qza (4.6 KB)
y0_taxa_summary_sg1-1000-rep15-ta.qzv (85.0 KB)

the command used:
qiime gneiss balance-taxonomy
--i-table composition_sg1-1000-rep15.qza
--i-tree hierarchy_sg1-1000-rep15.qza
--i-taxonomy taxonomy_23-1000-rep15.qza
--p-taxa-level 6
--p-balance-name 'y0'
--m-metadata-file sample-metadata.tsv
--m-metadata-column group
--o-visualization y0_taxa_summary_sg1-1000-rep15-ta.qza

@Hajar, I’m looking at your summaries, and I still am having trouble understanding the problem. Are you referring to the taxonomy or proportion plots? If that is the case, it is important to note that this package is not a visualization library, so you may have to extract out the data to plot in something like Python or R.

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