Closed gregcaporaso closed 2 years ago
Hey @gregcaporaso! I took a look at this with @ebolyen today - this should be resolvable by filtering down the group_column
to only include rows with data in them (i.e. non-empty rows). I'll link a PR here once I have a working draft with those changes!
PR with fix can be found here: #174
Bug Description When running
pairwise-differences
andpairwise-distances
, I notice a discrepancy in how samples that are present in the metadata but not the data (e.g., alpha diversity forpairwise-differences
, or a distance matrix forpairwise-distances
) are handled. These "extra samples" in the metadata are ignored bypairwise-differences
, but can cause a failure withpairwise-distances
if they don't contain information in the state, group, and individual columns. Ignoring these "extra samples," aspairwise-differences
does, is more convenient as it allows the user to maintain a single metadata file, even if there are some samples in there that aren't relevant for thepairwise-*
analyses. As it stands, I have to comment out or remove the "extra samples" from my metadata file to use it withpairwise-distances
.Steps to reproduce the behavior
q2-longitudinal
tutorial.Run the following command - it will fail with the following error message:
Debug info has been saved to /var/folders/jp/_7s6840d2gdf_gkg1291p7x00000gn/T/qiime2-q2cli-err-e4aw2h6b.log
Traceback (most recent call last): File "/Users/gregcaporaso/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/commands.py", line 339, in call results = action(arguments) File "", line 2, in pairwise_distances
File "/Users/gregcaporaso/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
outputs = self._callableexecutor(scope, callable_args,
File "/Users/gregcaporaso/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 453, in _callableexecutor
ret_val = self._callable(output_dir=temp_dir, view_args)
File "/Users/gregcaporaso/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_longitudinal/_longitudinal.py", line 101, in pairwise_distances
_validate_input_values(metadata, None, individual_id_column, group_column,
File "/Users/gregcaporaso/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_longitudinal/_utilities.py", line 59, in _validate_input_values
_validate_state_in_dataframe(
File "/Users/gregcaporaso/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_longitudinal/_utilities.py", line 68, in _validate_state_in_dataframe
raise ValueError(
ValueError: State 0.0 is not represented by any members of nan group in metadata. Consider using a different group_column or state value.