qiime diversity alpha-group-significance All numbers are identical in kruskal

Hi Qiime folks!

I am having an issue with using the qiime diversity alpha-group-significance function.

Here is my input:

qiime diversity alpha-group-significance
--i-alpha-diversity diversity/shannon_vector.qza
--m-metadata-file $METADATA2
--verbose
--o-visualization diversity/shannon_compare_groups.qzv

Here's the output:

Plugin error from diversity:

All numbers are identical in kruskal

And here's the debug info:

/Users/s.d./miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_types/sample_data/_transformer.py:27: FutureWarning: errors='ignore' is deprecated and will raise in a future version. Use to_numeric without passing errors and catch exceptions explicitly instead
df[cols] = df[cols].apply(pd.to_numeric, errors='ignore')
Traceback (most recent call last):
File "/Users/s.d./miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 520, in call
results = self._execute_action(
File "/Users/s.d./miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 581, in _execute_action
results = action(**arguments)
File "", line 2, in alpha_group_significance
File "/Users/s.d./miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 342, in bound_callable
outputs = self.callable_executor(
File "/Users/s.d./miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 625, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File "/Users/s.d./miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_diversity/_alpha/_visualizer.py", line 97, in alpha_group_significance
kw_H_all, kw_p_all = scipy.stats.mstats.kruskalwallis(*groups)
File "/Users/s.d./miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/scipy/stats/_mstats_basic.py", line 1649, in kruskal
raise ValueError('All numbers are identical in kruskal')
ValueError: All numbers are identical in kruskal

My metadata file seems correct, I ran qiime metadata tabulate just to be sure. I can provide the TSV too if that would be useful.

Thanks for the help!

Hello,
This error arises when all numerical values to be compared are identical.
I guess that something went wrong at the diversity metrics calculation step.
I would export / extract the tsv file from the shannon_entropy_vector.qza file and manually inspect it to see if all values are identical, at least within one group. Double check the command you run for core-metrics.

Best,

Thank you! Yes, the core metrics were generated incorrectly. using a sampling depth of 1000 I got much better results. Is there a good rule of thumb for choosing a sampling depth for calculating these metrics?

Welcome!

This value is a compromise between the number of samples you want to keep (all samples with lower depth are removed) and the number of features you want to use for diversity metrics calculation.