Another Songbird Error: Local variable "i" referenced before assignment

Hi all!

Been working on my project again and have run into a snag relating to Songbird. I've gotten it to work in the past, but with my newly filtered dataset, am getting an error message similar to the one detailed in this post. Here is the full error output for ease:

Traceback (most recent call last):
  File "/opt/anaconda/anaconda3/envs/qiime2-songbird/lib/python3.6/site-packages/q2cli/commands.py", line 328, in __call__
    results = action(**arguments)
  File "</opt/anaconda/anaconda3/envs/qiime2-songbird/lib/python3.6/site-packages/decorator.py:decorator-gen-481>", line 2, in multinomial
  File "/opt/anaconda/anaconda3/envs/qiime2-songbird/lib/python3.6/site-packages/qiime2/sdk/action.py", line 240, in bound_callable
    output_types, provenance)
  File "/opt/anaconda/anaconda3/envs/qiime2-songbird/lib/python3.6/site-packages/qiime2/sdk/action.py", line 383, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/opt/anaconda/anaconda3/envs/qiime2-songbird/lib/python3.6/site-packages/songbirddev-1.0.2-py3.6.egg/songbird/q2/_method.py", line 69, in multinomial
    silent=silent)
  File "/opt/anaconda/anaconda3/envs/qiime2-songbird/lib/python3.6/site-packages/songbirddev-1.0.2-py3.6.egg/songbird/multinomial.py", line 213, in fit
    iter_n.append(i)
UnboundLocalError: local variable 'i' referenced before assignment

I'm running qiime2-2022.2, but for Songbird, I've been running source activate qiime2-songbird. This has been the command I'm trying to run:

qiime songbird multinomial --i-table table-filtered-taxa-F.qza --m-metadata-file FPIES_mycobiome_metadata_june2020_noS1.tsv --p-formula "1" --p-epochs 10000 --p-differential-prior 0.5 --p-training-column training_Column --p-summary-interval 1 --o-differentials null-diff.qza --o-regression-stats null-stats.qza --o-regression-biplot null-biplot.qza --verbose

I have a hunch that the problem is in my metadata. In the other post, the issue was solved with a designated training/testing column, which I have. I filtered my table by taxonomy, only looking for fungal species. In doing so, one of our samples was removed because no fungal species are present. I removed the corresponding sample from the metadata, and yet I'm getting this error message about iterations and floats. I'm not sure what else could be causing the issue, since Songbird has worked for me in the past (albeit with a full table). If anyone well versed in this field could give their insight, it would be greatly appreciated!

Thanks for your time!
Katherine

Hi, this error typically happens when you haven't set your training length properly - which can either happen due to a mismatch between your table / metadata, or mis-assignment of samples in your train / test split.

Thank you for such a quick response!

I had been focusing on it being a mismatch between my table and metadata. Songbird ran when I reassigned training and testing samples. I'm unsure as to why––but it worked! Thank you for your help and guidance. :grin:

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