RE: Error: Plugin error from diversity

Don't know how to comment of the original post:

This bug haven't been solved in the latest version of 2021.4
having same problem with the eveness but not with faith_pd_vector.qza
qiime diversity alpha-group-significance \

--i-alpha-diversity core-metrics-results/evenness_vector.qza
--m-metadata-file metadatasheet.tsv
--o-visualization core-metrics-results/evenness-group-significance.qzv
Plugin error from diversity:

float division by zero

Debug info has been saved to /tmp/qiime2-q2cli-err-yotl_40h.log

Hi @MarwaTawfik!

Thanks for doing your research, but that bug you linked to has been addressed, and I don't think its relevant to the error message you have posted. Let's take a closer look:

Ahh that doesn't sound like it is related to the bug you shared at the top of your post - this looks like an issue with the nature of the data - can you please either re-run with the --verbose flag, or share the contents of the log file:

Thanks!

:qiime2:

Thanks for your reply, :slightly_smiling_face:

(qiime2-2021.4) [email protected]:~/qiime2/nutriprog$ nice -n 19 qiime diversity alpha-group-significance \
>   --i-alpha-diversity core-metrics-results/evenness_vector.qza \
>   --m-metadata-file metadatasheet.tsv \
>   --o-visualization core-metrics-results/evenness-group-significance.qzv
Plugin error from diversity:

  float division by zero

nano /tmp/qiime2-q2cli-err-yotl_40h.log
Traceback (most recent call last):
  File "/home/r01mt19/.conda/envs/qiime2-2021.4/lib/python3.8/site-packages/q2cli/commands.py", line 329, in __call__
    results = action(**arguments)
  File "<decorator-gen-435>", line 2, in alpha_group_significance
  File "/home/r01mt19/.conda/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 244, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/home/r01mt19/.conda/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 452, in _callable_executor_
    ret_val = self._callable(output_dir=temp_dir, **view_args)
  File "/home/r01mt19/.conda/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_diversity/_alpha/_visualizer.py", line 97, in alpha_group_significance
    H, p = scipy.stats.mstats.kruskalwallis(groups[i],
  File "/home/r01mt19/.conda/envs/qiime2-2021.4/lib/python3.8/site-packages/scipy/stats/mstats_basic.py", line 1239, in kruskal
    T = 1. - sum(v*(k**3-k) for (k,v) in ties.items())/float(ntot**3-ntot)
ZeroDivisionError: float division by zero

I ran qiime2 commands also in nf-core workflow and it gives back this error

Error executing process > 'AMPLISEQ:QIIME2_DIVERSITY:QIIME2_DIVERSITY_ALPHA (evenness_vector)'

Caused by:
  Process `AMPLISEQ:QIIME2_DIVERSITY:QIIME2_DIVERSITY_ALPHA (evenness_vector)` terminated with an error exit status (1)

Command executed:

  export XDG_CONFIG_HOME="${PWD}/HOME"

  qiime diversity alpha-group-significance             --i-alpha-diversity evenness_vector.qza             --m-metadata-file all.metadatasheet.tsv             --o-visualization evenness_vector-vis.qzv
  qiime tools export --input-path evenness_vector-vis.qzv             --output-path "alpha_diversity/evenness_vector"

  echo $(qiime --version | sed -e "s/q2cli version //g" | tr -d '`' | sed -e "s/Run qiime info for more version details.//g") > qiime2.version.txt

Command exit status:
  1

Command output:
  (empty)

Command error:
  QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.
  Plugin error from diversity:

    float division by zero

  Debug info has been saved to /tmp/qiime2-q2cli-err-nl5v9u8g.log

Work dir:
  /uoa/scratch/users/r01mt19/amliseq/16Ssamples/trimGalored/work/b1/ec9d26615d4b47504e02216f8b8473

Tip: view the complete command output by changing to the process work dir and entering the command `cat .command.out`


nano /tmp/qiime2-q2cli-err-nl5v9u8g.log
Traceback (most recent call last):
  File "/opt/conda/envs/qiime2-2021.2/lib/python3.6/site-packages/q2cli/commands.py", line 329, in __call__
    results = action(**arguments)
  File "<decorator-gen-443>", line 2, in alpha_group_significance
  File "/opt/conda/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
    output_types, provenance)
  File "/opt/conda/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 452, in _callable_executor_
    ret_val = self._callable(output_dir=temp_dir, **view_args)
  File "/opt/conda/envs/qiime2-2021.2/lib/python3.6/site-packages/q2_diversity/_alpha/_visualizer.py", line 98, in alpha_group_significance
    groups[j])
  File "/opt/conda/envs/qiime2-2021.2/lib/python3.6/site-packages/scipy/stats/mstats_basic.py", line 1243, in kruskal
    T = 1. - sum(v*(k**3-k) for (k,v) in ties.items())/float(ntot**3-ntot)
ZeroDivisionError: float division by zero


 
nano /tmp/qiime2-q2cli-err-nl5v9u8g.log


Traceback (most recent call last):
  File "/opt/conda/envs/qiime2-2021.2/lib/python3.6/site-packages/q2cli/commands.py", line 329, in __call__
    results = action(**arguments)
  File "<decorator-gen-443>", line 2, in alpha_group_significance
  File "/opt/conda/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
    output_types, provenance)
  File "/opt/conda/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 452, in _callable_executor_
    ret_val = self._callable(output_dir=temp_dir, **view_args)
  File "/opt/conda/envs/qiime2-2021.2/lib/python3.6/site-packages/q2_diversity/_alpha/_visualizer.py", line 98, in alpha_group_significance
    groups[j])
  File "/opt/conda/envs/qiime2-2021.2/lib/python3.6/site-packages/scipy/stats/mstats_basic.py", line 1243, in kruskal
    T = 1. - sum(v*(k**3-k) for (k,v) in ties.items())/float(ntot**3-ntot)
ZeroDivisionError: float division by zero

Thanks @MarwaTawfik! It sounds like the issue might actually be in your evenness vector - that error implies that at there might be some issue with at least one of the pairwise comparisons. Can you share core-metrics-results/evenness_vector.qza with me? You can send a download link in a private message to me if you don't feel comfortable sharing publicly. Thanks!

Thanks, Mathew
I confirm I sent the following to you via a private message when requested.

core-metrics-results/evenness_vector.qza

1 Like

Hi @MarwaTawfik - yes, I received your message, thank you for your patience!

You evenness vector result is missing two values, one for sample s178 and one for s185 - the next question here is to figure out why! Could you please send me your feature table, the one you used in core-metrics-phylogenetic? The artifact's uuid is 2f4705ee-ef80-48f4-9a36-ed78b2249e60

Thanks!

Just sent the aritifact with that certain uuid

1 Like

Hi @MarwaTawfik - I was able to work through this problem a bit more - the reason this is failing is because some of your samples have fewer than 2 observed features, after rarefying your table. One option is to manually compute the Pielou's Evenness using diversity-lib pielou-evenness, specifying the --p-drop-undefined-samples. Then you can plug the output of that command into alpha-group-significance!

Keep us posted!

:qiime2: