qiime2 / q2-diversity

BSD 3-Clause "New" or "Revised" License
4 stars 45 forks source link

Bioenv raises a ValueError when a metadata file has columns with no values, even when other columns have values #320

Closed danielhjacobs closed 3 months ago

danielhjacobs commented 2 years ago

Bug Description If a metadata file has one or more columns with no values in any cells, bioenv will panic, even if there are several other columns with data in every cell. This behavior was not present in qiime version 2020.2, and was likely introduced by https://github.com/qiime2/q2-diversity/commit/76e368fb21d1a9d5a950e4387011680b0fac2859. Originally reported by me on the forums.

Steps to reproduce the behavior

  1. Use these files: bioenv_files.tar.gz
  2. Run the command qiime diversity core-metrics-phylogenetic --verbose --i-phylogeny rooted-tree.qza --i-table table-trim55126.qza --m-metadata-file 203967.metadata.tsv --p-sampling-depth 300 --output-dir ./output/
  3. Run the command qiime diversity bioenv --verbose --i-distance-matrix ./output/unweighted_unifrac_distance_matrix.qza --m-metadata-file 203967.metadata.tsv --o-visualization ./output/unweighted-unifrac-bioenv.qzv

Expected behavior I should see the output: Saved Visualization to: ./output/unweighted-unifrac-bioenv.qzv

Computation Environment

References

  1. https://forum.qiime2.org/t/bioenv-diversity-error-with-qiime-version-2021-4-but-not-with-2020-2/21319
lizgehret commented 4 months ago

Confirmed this behavior is still present in QIIME 2 2024.5 amplicon environment (tested on MacOS with intel chip).

lizgehret commented 4 months ago

Hey @danielhjacobs thanks for reporting this! I am currently working on a fix that will become available in our current amplicon development environment once merged, and then formally available in the 2024.10 release.

Cheers 🦎