lexicographical sorting in `qiime feature-table tabulate-seqs`

Greetings Qiime2 community,

My .qzv files load nicely in https://view.qiime2.org/, running either Chrome Version 128.0.6613.138 or Firefox version 140.0.4, on Catalina (Mac OS 10.15.7, which is quite old).
I am using qiime2 version 2025.7

However, the sorting as by the arrows next to column headers is treating row entries as strings in alphabetical order, rather than numerical order, maybe?

So for example, I will have sorted rows by number of samples per feature, and the result is ‘2 2 2 31 3 3 3’. Or, sorting by frequency results in ‘10.0 10.0 10.0 102.0 108.0 11.0 11.0’ etc.

Additionally, I was really interested in sorting my view by Sequence Length. There is an arrow next to that column header, suggesting I should be able to sort by length, but nothing happens when I click it.

Is sorting lexicographically the default behavior for q2 view, or is it a result of my older computer and OS maybe?

If default in q2 view, is there a way to hopefully sort the numerical categories by numerical value?

Please lmk if I should have posted this under a different category, or point out any previous forum posts on this topic that I missed. Thanks for any info you could provide!

1 Like

Hi there,

I am an amateur to the qiime2 as well. Please forgive me that I may not be very familiar to the q2 settings. But I think Python and R being strong tools to solve your problem.

Can you try to convert qza to tsv using the qiime tools export and biom convert commands, and then use pandas in Python for sorting multiple numeric columns? If you agree, you can find codes and tutorials in Python Pandas page.

However, it may be needed to adjust the tsv back to qiime2 format and store as qza again.

Many thanks. Feedbacks are appreciated.

1 Like

Hi @sibilant,
Thanks for bringing this up - the lexographic (as opposed to numeric) sorting does appear to be a bug in the qiime feature-table tabulate-seqs action, and I confirmed that this is present in 2025.10 (the most recent release). I've created an issue for this on the relevant issue tracker here.

Sorry for the trouble! We'll get this fixed asap.

UPDATE: I realized I didn't answer your question about sorting on Sequence length. You should get an arrow if you click on that column heading. This visualization can be a little slow though when the tables are large, so it might be that you just need to wait for the triangle to appear.

2 Likes

Thanks very much, Professor. And congratulations on the new Q2 release!

2 Likes

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