Qiime gneiss gradient-clustering with categorical variable


I would like to perform qiime gneiss gradient-clustering on a categorical variable with two levels (F and C). however when I run this, I get the following error:

qiime gneiss gradient-clustering
–i-table sv_tax_filtered.biom.qza
–m-gradient-file sv_metals.tsv
–m-gradient-column Size
–o-clustering sv_size_hierarchy.nwk.qza

There was an issue with retrieving column 'Size' from the metadata:
Metadata column 'Size' is categorical. Option --m-gradient-column expects the column to be numeric.

Judging from this post it seems, that the option --m-gradient-column would work on a categorical variable only. However, when I dig into the Usage Options it seems this works on a numeric column only.

Is it (still?) possible to perform gradient clustering on categorical variables?

I could convert my gradient column into numeric values, e.g. F=1, C=2, however I was wondering if there is a better way to do this.

Thank you.


1 Like

Howdy @VivyanCyril!

Thanks for the cross-references, that was super helpful!

On close inspection, I think that post is only implying that categorical values should be used in the dendrogram-heatmap method:

It sounds like the numerical values in the gradient-clustering command weren’t really part of the question in that original thread (“Appears to work for the gradient-clustering command” sounds to me like their numeric pH column worked without modification). I had to read the post a few times to get it straight in my head, so please double-check me, I might’ve missed something!

See my interpretation above, I don’t think this was ever possible, with respect to gradient-clustering.

This will probably be your best bet moving forward, although you don’t need to remove your existing column, you could just define a new column and point gneiss gradient-clustering to that new column!

Hope that helps! :qiime2: :t_rex:


Hi @thermokarst ,

Thanks for your help with this, seems clear now! :slight_smile:

It was a bit confusing, that dendrogram-heatmap would use categorical values and gradient-clustering numeric values of the same variable - ph in this example of 88soils.



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